Audacity  2.3.1
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
PlaybackPrefs Class Referencefinal

A PrefsPanel used to select playback options. More...

#include <PlaybackPrefs.h>

Inheritance diagram for PlaybackPrefs:
PrefsPanel wxPanelWrapper wxTabTraversalWrapper< wxPanel >

Public Member Functions

 PlaybackPrefs (wxWindow *parent, wxWindowID winid)
 
virtual ~PlaybackPrefs ()
 
bool Commit () override
 
wxString HelpPageName () override
 
void PopulateOrExchange (ShuttleGui &S) override
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const wxString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual bool ShowsPreviewButton ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual void Cancel ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&...args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Member Functions

static bool GetUnpinnedScrubbingPreference ()
 

Private Member Functions

void Populate ()
 

Detailed Description

A PrefsPanel used to select playback options.

Presents interface for user to update the various playback options like previewing and seeking.

Definition at line 23 of file PlaybackPrefs.h.

Constructor & Destructor Documentation

PlaybackPrefs::PlaybackPrefs ( wxWindow *  parent,
wxWindowID  winid 
)

Definition at line 31 of file PlaybackPrefs.cpp.

References Populate().

32 : PrefsPanel(parent, winid, _("Playback"))
33 {
34  Populate();
35 }
PrefsPanel(wxWindow *parent, wxWindowID winid, const wxString &title)
Definition: PrefsPanel.h:48
_("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
PlaybackPrefs::~PlaybackPrefs ( )
virtual

Definition at line 37 of file PlaybackPrefs.cpp.

38 {
39 }

Member Function Documentation

bool PlaybackPrefs::Commit ( )
overridevirtual

Implements PrefsPanel.

Definition at line 165 of file PlaybackPrefs.cpp.

References eIsSavingToPrefs, and PopulateOrExchange().

166 {
167  iPreferenceUnpinned = -1;
168 
169  ShuttleGui S(this, eIsSavingToPrefs);
171 
172  return true;
173 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
void PopulateOrExchange(ShuttleGui &S) override
bool PlaybackPrefs::GetUnpinnedScrubbingPreference ( )
static

Definition at line 154 of file PlaybackPrefs.cpp.

References gPrefs.

Referenced by Scrubber::ShouldScrubPinned().

155 {
156  if ( iPreferenceUnpinned >= 0 )
157  return iPreferenceUnpinned == 1;
158  bool bResult = gPrefs->ReadBool(
159  UnpinnedScrubbingPreferenceKey(),
160  UnpinnedScrubbingPreferenceDefault());
161  iPreferenceUnpinned = bResult ? 1: 0;
162  return bResult;
163 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
wxString PlaybackPrefs::HelpPageName ( )
overridevirtual

Reimplemented from PrefsPanel.

Definition at line 175 of file PlaybackPrefs.cpp.

176 {
177  return "Playback_Preferences";
178 }
void PlaybackPrefs::Populate ( )
private

Definition at line 41 of file PlaybackPrefs.cpp.

References eIsCreatingFromPrefs, and PopulateOrExchange().

Referenced by PlaybackPrefs().

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 }
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
void PopulateOrExchange(ShuttleGui &S) override
void PlaybackPrefs::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 64 of file PlaybackPrefs.cpp.

References _(), ShuttleGuiBase::AddUnits(), ShuttleGuiBase::EndScroller(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndThreeColumn(), ShuttleGuiBase::EndTwoColumn(), ShuttleGuiBase::SetBorder(), ShuttleGuiBase::StartScroller(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartThreeColumn(), ShuttleGuiBase::StartTwoColumn(), ShuttleGuiBase::TieCheckBox(), and ShuttleGuiBase::TieNumericTextBox().

Referenced by Commit(), and Populate().

65 {
66  wxTextCtrl *w;
67 
68  S.StartScroller();
69  S.SetBorder(2);
70 
71  S.StartStatic(_("Effects Preview"));
72  {
73  S.StartThreeColumn();
74  {
75  w = S.TieNumericTextBox(_("&Length:"),
76  wxT("/AudioIO/EffectsPreviewLen"),
77  6.0,
78  9);
79  S.AddUnits(_("seconds"));
80  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
81  }
82  S.EndThreeColumn();
83  }
84  S.EndStatic();
85 
86  /* i18n-hint: (noun) this is a preview of the cut */
87  S.StartStatic(_("Cut Preview"));
88  {
89  S.StartThreeColumn();
90  {
91  w = S.TieNumericTextBox(_("&Before cut region:"),
92  wxT("/AudioIO/CutPreviewBeforeLen"),
93  2.0,
94  9);
95  S.AddUnits(_("seconds"));
96  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
97 
98  w = S.TieNumericTextBox(_("&After cut region:"),
99  wxT("/AudioIO/CutPreviewAfterLen"),
100  1.0,
101  9);
102  S.AddUnits(_("seconds"));
103  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
104  }
105  S.EndThreeColumn();
106  }
107  S.EndStatic();
108 
109  S.StartStatic(_("Seek Time when playing"));
110  {
111  S.StartThreeColumn();
112  {
113  w = S.TieNumericTextBox(_("&Short period:"),
114  wxT("/AudioIO/SeekShortPeriod"),
115  1.0,
116  9);
117  S.AddUnits(_("seconds"));
118  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
119 
120  w = S.TieNumericTextBox(_("Lo&ng period:"),
121  wxT("/AudioIO/SeekLongPeriod"),
122  15.0,
123  9);
124  S.AddUnits(_("seconds"));
125  if( w ) w->SetName(w->GetName() + wxT(" ") + _("seconds"));
126  }
127  S.EndThreeColumn();
128  }
129  S.EndStatic();
130 
131  S.StartStatic(_("Options"));
132  {
133  S.StartTwoColumn();
134  {
135  S.TieCheckBox(_("&Vari-Speed Play"), "/AudioIO/VariSpeedPlay", true);
136  }
137  S.EndTwoColumn();
138 
139  S.StartTwoColumn();
140  {
141  S.TieCheckBox(_("Always scrub un&pinned"),
142  UnpinnedScrubbingPreferenceKey(),
143  UnpinnedScrubbingPreferenceDefault());
144  }
145  S.EndTwoColumn();
146  }
147  S.EndStatic();
148 
149 
150  S.EndScroller();
151 
152 }
void EndThreeColumn()
Definition: ShuttleGui.h:139
void EndScroller()
Definition: ShuttleGui.cpp:836
void AddUnits(const wxString &Prompt)
Left aligned text string.
Definition: ShuttleGui.cpp:260
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:803
void StartTwoColumn()
Definition: ShuttleGui.h:136
wxTextCtrl * TieNumericTextBox(const wxString &Prompt, WrappedType &WrappedRef, const int nChars)
void StartThreeColumn()
Definition: ShuttleGui.h:138
_("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)
wxStaticBox * StartStatic(const wxString &Str, int iProp=0)
Definition: ShuttleGui.cpp:771
void SetBorder(int Border)
Definition: ShuttleGui.h:286
void EndTwoColumn()
Definition: ShuttleGui.h:137

The documentation for this class was generated from the following files: