Audacity  3.0.3
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:
[legend]
Collaboration diagram for PlaybackPrefs:
[legend]

Public Member Functions

 PlaybackPrefs (wxWindow *parent, wxWindowID winid)
 
virtual ~PlaybackPrefs ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
bool Commit () override
 
ManualPageID HelpPageName () override
 If not empty string, the Help button is added below the panel. More...
 
void PopulateOrExchange (ShuttleGui &S) override
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const TranslatableString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual PluginPath GetPath ()
 
virtual VendorSymbol GetVendor ()
 
virtual wxString GetVersion ()
 
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 TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- 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 ()
 
- Static Public Member Functions inherited from PrefsPanel
static FactoriesDefaultFactories ()
 

Private Member Functions

void Populate ()
 

Additional Inherited Members

- Public Types inherited from PrefsPanel
using Factories = std::vector< PrefsPanel::PrefsNode >
 
using Factory = std::function< PrefsPanel *(wxWindow *parent, wxWindowID winid, AudacityProject *) >
 

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::PlaybackPrefs ( wxWindow *  parent,
wxWindowID  winid 
)

Definition at line 30 of file PlaybackPrefs.cpp.

31 : PrefsPanel(parent, winid, XO("Playback"))
32 {
33  Populate();
34 }

References Populate().

Here is the call graph for this function:

◆ ~PlaybackPrefs()

PlaybackPrefs::~PlaybackPrefs ( )
virtual

Definition at line 36 of file PlaybackPrefs.cpp.

37 {
38 }

Member Function Documentation

◆ Commit()

bool PlaybackPrefs::Commit ( )
overridevirtual

Implements PrefsPanel.

Definition at line 175 of file PlaybackPrefs.cpp.

176 {
177  iPreferenceUnpinned = -1;
178 
179  ShuttleGui S(this, eIsSavingToPrefs);
181 
182  return true;
183 }

References eIsSavingToPrefs, anonymous_namespace{PlaybackPrefs.cpp}::iPreferenceUnpinned, and PopulateOrExchange().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString PlaybackPrefs::GetDescription ( )
overridevirtual

Implements ComponentInterface.

Definition at line 45 of file PlaybackPrefs.cpp.

46 {
47  return XO("Preferences for Playback");
48 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol PlaybackPrefs::GetSymbol ( )
overridevirtual

Implements ComponentInterface.

Definition at line 40 of file PlaybackPrefs.cpp.

41 {
43 }

References PLAYBACK_PREFS_PLUGIN_SYMBOL.

◆ GetUnpinnedScrubbingPreference()

bool PlaybackPrefs::GetUnpinnedScrubbingPreference ( )
static

Definition at line 164 of file PlaybackPrefs.cpp.

165 {
166  if ( iPreferenceUnpinned >= 0 )
167  return iPreferenceUnpinned == 1;
168  bool bResult = gPrefs->ReadBool(
171  iPreferenceUnpinned = bResult ? 1: 0;
172  return bResult;
173 }

References gPrefs, anonymous_namespace{PlaybackPrefs.cpp}::iPreferenceUnpinned, anonymous_namespace{PlaybackPrefs.cpp}::UnpinnedScrubbingPreferenceDefault(), and anonymous_namespace{PlaybackPrefs.cpp}::UnpinnedScrubbingPreferenceKey().

Referenced by Scrubber::ShouldScrubPinned().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HelpPageName()

ManualPageID PlaybackPrefs::HelpPageName ( )
overridevirtual

If not empty string, the Help button is added below the panel.

Default returns empty string.

Reimplemented from PrefsPanel.

Definition at line 50 of file PlaybackPrefs.cpp.

51 {
52  return "Playback_Preferences";
53 }

◆ Populate()

void PlaybackPrefs::Populate ( )
private

Definition at line 55 of file PlaybackPrefs.cpp.

56 {
57  //------------------------- Main section --------------------
58  // Now construct the GUI itself.
59  // Use 'eIsCreatingFromPrefs' so that the GUI is
60  // initialised with values from gPrefs.
63  // ----------------------- End of main section --------------
64 }

References eIsCreatingFromPrefs, and PopulateOrExchange().

Referenced by PlaybackPrefs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopulateOrExchange()

void PlaybackPrefs::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 78 of file PlaybackPrefs.cpp.

79 {
80  const auto suffix = XO("seconds");
81 
82  S.StartScroller();
83  S.SetBorder(2);
84 
85  S.StartStatic(XO("Effects Preview"));
86  {
87  S.StartThreeColumn();
88  {
89  S.NameSuffix(suffix)
90  .TieNumericTextBox(XXO("&Length:"),
91  {wxT("/AudioIO/EffectsPreviewLen"),
92  6.0},
93  9);
94  S.AddUnits(XO("seconds"));
95  }
96  S.EndThreeColumn();
97  }
98  S.EndStatic();
99 
100  /* i18n-hint: (noun) this is a preview of the cut */
101  S.StartStatic(XO("Cut Preview"));
102  {
103  S.StartThreeColumn();
104  {
105  S.NameSuffix(suffix)
106  .TieNumericTextBox(XXO("&Before cut region:"),
107  {wxT("/AudioIO/CutPreviewBeforeLen"),
108  2.0},
109  9);
110  S.AddUnits(XO("seconds"));
111 
112  S.NameSuffix(suffix)
113  .TieNumericTextBox(XXO("&After cut region:"),
114  {wxT("/AudioIO/CutPreviewAfterLen"),
115  1.0},
116  9);
117  S.AddUnits(XO("seconds"));
118  }
119  S.EndThreeColumn();
120  }
121  S.EndStatic();
122 
123  S.StartStatic(XO("Seek Time when playing"));
124  {
125  S.StartThreeColumn();
126  {
127  S.NameSuffix(suffix)
128  .TieNumericTextBox(XXO("&Short period:"),
129  {wxT("/AudioIO/SeekShortPeriod"),
130  1.0},
131  9);
132  S.AddUnits(XO("seconds"));
133 
134  S.NameSuffix(suffix)
135  .TieNumericTextBox(XXO("Lo&ng period:"),
136  {wxT("/AudioIO/SeekLongPeriod"),
137  15.0},
138  9);
139  S.AddUnits(XO("seconds"));
140  }
141  S.EndThreeColumn();
142  }
143  S.EndStatic();
144 
145  S.StartStatic(XO("Options"));
146  {
147  S.StartVerticalLay();
148  {
149  S.TieCheckBox(XXO("&Vari-Speed Play"), {"/AudioIO/VariSpeedPlay", true});
150  S.TieCheckBox(XXO("&Micro-fades"), {"/AudioIO/Microfades", false});
151  S.TieCheckBox(XXO("Always scrub un&pinned"),
154  }
155  S.EndVerticalLay();
156  }
157  S.EndStatic();
158 
159 
160  S.EndScroller();
161 
162 }

References ShuttleGuiBase::AddUnits(), ShuttleGuiBase::EndScroller(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndThreeColumn(), ShuttleGuiBase::EndVerticalLay(), ShuttleGui::NameSuffix(), ShuttleGuiBase::SetBorder(), ShuttleGuiBase::StartScroller(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartThreeColumn(), ShuttleGuiBase::StartVerticalLay(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieNumericTextBox(), anonymous_namespace{PlaybackPrefs.cpp}::UnpinnedScrubbingPreferenceDefault(), anonymous_namespace{PlaybackPrefs.cpp}::UnpinnedScrubbingPreferenceKey(), XO, and XXO.

Referenced by Commit(), and Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
ShuttleGui::NameSuffix
ShuttleGui & NameSuffix(const TranslatableString &suffix)
Definition: ShuttleGui.h:671
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
anonymous_namespace{PlaybackPrefs.cpp}::UnpinnedScrubbingPreferenceKey
const char * UnpinnedScrubbingPreferenceKey()
Definition: PlaybackPrefs.cpp:67
ShuttleGuiBase::EndThreeColumn
void EndThreeColumn()
Definition: ShuttleGui.h:369
PlaybackPrefs::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: PlaybackPrefs.cpp:78
anonymous_namespace{PlaybackPrefs.cpp}::iPreferenceUnpinned
int iPreferenceUnpinned
Definition: PlaybackPrefs.cpp:75
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
PlaybackPrefs::Populate
void Populate()
Definition: PlaybackPrefs.cpp:55
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
XO
#define XO(s)
Definition: Internat.h:31
PLAYBACK_PREFS_PLUGIN_SYMBOL
#define PLAYBACK_PREFS_PLUGIN_SYMBOL
Definition: PlaybackPrefs.h:21
ShuttleGuiBase::EndScroller
void EndScroller()
Definition: ShuttleGui.cpp:971
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::StartScroller
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:938
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
ShuttleGuiBase::AddUnits
void AddUnits(const TranslatableString &Prompt, int wrapWidth=0)
Left aligned text string.
Definition: ShuttleGui.cpp:263
ShuttleGuiBase::StartThreeColumn
void StartThreeColumn()
Definition: ShuttleGui.h:368
ShuttleGuiBase::TieNumericTextBox
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1673
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:48
anonymous_namespace{PlaybackPrefs.cpp}::UnpinnedScrubbingPreferenceDefault
bool UnpinnedScrubbingPreferenceDefault()
Definition: PlaybackPrefs.cpp:71
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:47
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
PrefsPanel::PrefsPanel
PrefsPanel(wxWindow *parent, wxWindowID winid, const TranslatableString &title)
Definition: PrefsPanel.h:90