Audacity 3.2.0
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 () const override
 
TranslatableString GetDescription () const 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 bool Commit ()=0
 
virtual PluginPath GetPath () const override
 
virtual VendorSymbol GetVendor () const override
 
virtual wxString GetVersion () const override
 
virtual bool ShowsPreviewButton ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual ManualPageID HelpPageName ()
 If not empty string, the Help button is added below the panel. More...
 
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}
XO("Cut/Copy/Paste")
PrefsPanel(wxWindow *parent, wxWindowID winid, const TranslatableString &title)
Definition: PrefsPanel.h:94

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 176 of file PlaybackPrefs.cpp.

177{
179
182
183 return true;
184}
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
void PopulateOrExchange(ShuttleGui &S) override
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640

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

Here is the call graph for this function:

◆ GetDescription()

TranslatableString PlaybackPrefs::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 45 of file PlaybackPrefs.cpp.

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

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol PlaybackPrefs::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 40 of file PlaybackPrefs.cpp.

41{
43}
#define PLAYBACK_PREFS_PLUGIN_SYMBOL
Definition: PlaybackPrefs.h:21

References PLAYBACK_PREFS_PLUGIN_SYMBOL.

◆ GetUnpinnedScrubbingPreference()

bool PlaybackPrefs::GetUnpinnedScrubbingPreference ( )
static

Definition at line 165 of file PlaybackPrefs.cpp.

166{
167 if ( iPreferenceUnpinned >= 0 )
168 return iPreferenceUnpinned == 1;
169 bool bResult = gPrefs->ReadBool(
172 iPreferenceUnpinned = bResult ? 1: 0;
173 return bResult;
174}
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
bool ReadBool(const wxString &key, bool defaultValue) const

References gPrefs, anonymous_namespace{PlaybackPrefs.cpp}::iPreferenceUnpinned, audacity::BasicSettings::ReadBool(), 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}
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46

References eIsCreatingFromPrefs, PopulateOrExchange(), and S.

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 //Removing Vari-Speed Play from PlaybackPrefs
150 //S.TieCheckBox(XXO("&Vari-Speed Play"), {"/AudioIO/VariSpeedPlay", true});
151 S.TieCheckBox(XXO("&Micro-fades"), {"/AudioIO/Microfades", false});
152 S.TieCheckBox(XXO("Always scrub un&pinned"),
155 }
156 S.EndVerticalLay();
157 }
158 S.EndStatic();
159
160
161 S.EndScroller();
162
163}
wxT("CloseDown"))
XXO("&Cut/Copy/Paste Toolbar")

References S, anonymous_namespace{PlaybackPrefs.cpp}::UnpinnedScrubbingPreferenceDefault(), anonymous_namespace{PlaybackPrefs.cpp}::UnpinnedScrubbingPreferenceKey(), wxT(), 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: