Audacity  2.2.2
PlaybackPrefs.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  PlaybackPrefs.cpp
6 
7  Joshua Haberman
8  Dominic Mazzoni
9  James Crook
10 
11 *******************************************************************//********************************************************************/
20 
21 #include "../Audacity.h"
22 #include "PlaybackPrefs.h"
23 
24 #include <wx/defs.h>
25 #include <wx/textctrl.h>
26 
27 #include "../ShuttleGui.h"
28 #include "../Prefs.h"
29 #include "../Internat.h"
30 
31 PlaybackPrefs::PlaybackPrefs(wxWindow * parent, wxWindowID winid)
32 : PrefsPanel(parent, winid, _("Playback"))
33 {
34  Populate();
35 }
36 
38 {
39 }
40 
42 {
43  //------------------------- Main section --------------------
44  // Now construct the GUI itself.
45  // Use 'eIsCreatingFromPrefs' so that the GUI is
46  // initialised with values from gPrefs.
49  // ----------------------- End of main section --------------
50 }
51 
53 {
54  wxTextCtrl *w;
55 
56  S.StartScroller();
57  S.SetBorder(2);
58 
59  S.StartStatic(_("Effects Preview"));
60  {
61  S.StartThreeColumn();
62  {
63  w = S.TieNumericTextBox(_("&Length:"),
64  wxT("/AudioIO/EffectsPreviewLen"),
65  6.0,
66  9);
67  S.AddUnits(_("seconds"));
68  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
69  }
70  S.EndThreeColumn();
71  }
72  S.EndStatic();
73 
74  /* i18n-hint: (noun) this is a preview of the cut */
75  S.StartStatic(_("Cut Preview"));
76  {
77  S.StartThreeColumn();
78  {
79  w = S.TieNumericTextBox(_("&Before cut region:"),
80  wxT("/AudioIO/CutPreviewBeforeLen"),
81  2.0,
82  9);
83  S.AddUnits(_("seconds"));
84  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
85 
86  w = S.TieNumericTextBox(_("&After cut region:"),
87  wxT("/AudioIO/CutPreviewAfterLen"),
88  1.0,
89  9);
90  S.AddUnits(_("seconds"));
91  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
92  }
93  S.EndThreeColumn();
94  }
95  S.EndStatic();
96 
97  S.StartStatic(_("Seek Time when playing"));
98  {
99  S.StartThreeColumn();
100  {
101  w = S.TieNumericTextBox(_("&Short period:"),
102  wxT("/AudioIO/SeekShortPeriod"),
103  1.0,
104  9);
105  S.AddUnits(_("seconds"));
106  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
107 
108  w = S.TieNumericTextBox(_("Lo&ng period:"),
109  wxT("/AudioIO/SeekLongPeriod"),
110  15.0,
111  9);
112  S.AddUnits(_("seconds"));
113  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
114  }
115  S.EndThreeColumn();
116  }
117  S.EndStatic();
118 
119  S.StartStatic(_("Options"));
120  {
121  S.StartTwoColumn();
122  {
123  S.TieCheckBox("&Vari-Speed Play", "/AudioIO/VariSpeedPlay", true);
124  }
125  S.EndTwoColumn();
126  }
127  S.EndStatic();
128 
129 
130  S.EndScroller();
131 
132 }
133 
135 {
136  ShuttleGui S(this, eIsSavingToPrefs);
138 
139  return true;
140 }
141 
143 {
144  return "Playback_Preferences";
145 }
146 
147 PrefsPanel *PlaybackPrefsFactory::operator () (wxWindow *parent, wxWindowID winid)
148 {
149  wxASSERT(parent); // to justify safenew
150  return safenew PlaybackPrefs(parent, winid);
151 }
152 
void EndThreeColumn()
Definition: ShuttleGui.h:139
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
void PopulateOrExchange(ShuttleGui &S) override
void EndScroller()
Definition: ShuttleGui.cpp:828
A PrefsPanel used to select playback options.
Definition: PlaybackPrefs.h:23
#define safenew
Definition: Audacity.h:230
void AddUnits(const wxString &Prompt)
Left aligned text string.
Definition: ShuttleGui.cpp:260
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:795
void StartTwoColumn()
Definition: ShuttleGui.h:136
wxTextCtrl * TieNumericTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
void StartThreeColumn()
Definition: ShuttleGui.h:138
PlaybackPrefs(wxWindow *parent, wxWindowID winid)
virtual ~PlaybackPrefs()
Used within the PrefsDialog, classes derived from this class include AudioIOPrefs, BatchPrefs, DirectoriesPrefs, FileFormatPrefs, GUIPrefs, KeyConfigPrefs, MousePrefs, QualityPrefs, SpectrumPrefs and ThemePrefs.
Definition: PrefsPanel.h:45
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
wxCheckBox * TieCheckBox(const wxString &Prompt, WrappedType &WrappedRef)
bool Commit() override
wxStaticBox * StartStatic(const wxString &Str, int iProp=0)
Definition: ShuttleGui.cpp:763
PrefsPanel * operator()(wxWindow *parent, wxWindowID winid) override
wxString HelpPageName() override
void SetBorder(int Border)
Definition: ShuttleGui.h:286
void EndTwoColumn()
Definition: ShuttleGui.h:137