Audacity 3.2.0
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
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
30PlaybackPrefs::PlaybackPrefs(wxWindow * parent, wxWindowID winid)
31: PrefsPanel(parent, winid, XO("Playback"))
32{
33 Populate();
34}
35
37{
38}
39
41{
43}
44
46{
47 return XO("Preferences for Playback");
48}
49
51{
52 return "Playback_Preferences";
53}
54
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}
65
66namespace {
68 {
69 return "/AudioIO/UnpinnedScrubbing";
70 }
72 {
73 return true;
74 }
76}
77
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}
164
166{
167 if ( iPreferenceUnpinned >= 0 )
168 return iPreferenceUnpinned == 1;
169 bool bResult = gPrefs->ReadBool(
172 iPreferenceUnpinned = bResult ? 1: 0;
173 return bResult;
174}
175
177{
179
182
183 return true;
184}
185
186namespace{
188 [](wxWindow *parent, wxWindowID winid, AudacityProject *)
189 {
190 wxASSERT(parent); // to justify safenew
191 return safenew PlaybackPrefs(parent, winid);
192 }
193};
194}
wxT("CloseDown"))
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define safenew
Definition: MemoryX.h:10
#define PLAYBACK_PREFS_PLUGIN_SYMBOL
Definition: PlaybackPrefs.h:21
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
A PrefsPanel used to select playback options.
Definition: PlaybackPrefs.h:24
void PopulateOrExchange(ShuttleGui &S) override
ComponentInterfaceSymbol GetSymbol() const override
static bool GetUnpinnedScrubbingPreference()
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
TranslatableString GetDescription() const override
bool Commit() override
virtual ~PlaybackPrefs()
PlaybackPrefs(wxWindow *parent, wxWindowID winid)
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Holds a msgid for the translation catalog; may also bind format arguments.
bool ReadBool(const wxString &key, bool defaultValue) const
PrefsPanel::Registration sAttachment