Audacity 3.2.0
TracksBehaviorsPrefs.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 TracksBehaviorsPrefs.cpp
6
7 Steve Daulton
8
9
10*******************************************************************//*******************************************************************/
16
17
19#include "ViewInfo.h"
20
21#include <wx/stattext.h>
22#include <wx/radiobut.h>
23#include <wx/statbox.h>
24
25#include "Prefs.h"
26#include "ShuttleGui.h"
27#include "WaveTrack.h"
28#include "WindowAccessible.h"
29
30TracksBehaviorsPrefs::TracksBehaviorsPrefs(wxWindow * parent, wxWindowID winid)
31/* i18n-hint: i.e. the behaviors of tracks */
32: PrefsPanel(parent, winid, XO("Tracks Behaviors"))
33{
34 Populate();
35}
36
38{
39}
40
42{
44}
45
47{
48 return XO("Preferences for TracksBehaviors");
49}
50
52{
53 return "Tracks_Behaviors_Preferences";
54}
55
57{
58 //------------------------- Main section --------------------
59 // Now construct the GUI itself.
62 // ----------------------- End of main section --------------
63}
64
66 wxT("/GUI/Solo"),
67 {
69 { XO("Simple"), XO("Multi-track"), XO("None") },
70 { wxT("Simple"), wxT("Multi"), wxT("None") }
71 },
72 0, // "Simple"
73};
74
75namespace
76{
78 XO("Smart clip.\n"
79 "The entire source clip will be pasted into your project, allowing you to access\ntrimmed audio data anytime."),
80 XO("Selected audio only.\n"
81 "Only the selected portion of the source clip will be pasted."),
82 XO("Ask me each time.\n"
83 "Show dialog each time audio is pasted."),
84 };
85}
86
88 wxT("/GUI/AudioTrackPastePolicy"),
89 {
91 { {}, {}, {} },
92 { wxT("Keep"), wxT("Discard"), wxT("Ask") }
93 },
94 2, // "Ask"
95};
96
98{
99 S.SetBorder(2);
100 S.StartScroller();
101
102 S.StartStatic(XO("Behaviors"));
103 {
104 S.TieCheckBox(XXO("&Select all audio, if selection required"),
105 {wxT("/GUI/SelectAllOnNone"),
106 false});
107 /* i18n-hint: Cut-lines are lines that can expand to show the cut audio.*/
108 S.TieCheckBox(XXO("Enable cut &lines"),
109 {wxT("/GUI/EnableCutLines"),
110 false});
111 S.TieCheckBox(XXO("Enable &dragging selection edges"),
112 {wxT("/GUI/AdjustSelectionEdges"),
113 true});
114 S
115 .TieCheckBox(XXO("Editing a clip can &move other clips"),
117 S.TieCheckBox(XXO("\"Move track focus\" c&ycles repeatedly through tracks"),
118 {wxT("/GUI/CircularTrackNavigation"),
119 false});
120 S.TieCheckBox(XXO("&Type to create a label"),
121 {wxT("/GUI/TypeToCreateLabel"),
122 false});
123 S.TieCheckBox(XXO("Use dialog for the &name of a new label"),
124 {wxT("/GUI/DialogForNameNewLabel"),
125 false});
126#ifdef EXPERIMENTAL_SCROLLING_LIMITS
127 S.TieCheckBox(XXO("Enable scrolling left of &zero"),
129#endif
130 S.TieCheckBox(XXO("Advanced &vertical zooming"),
131 {wxT("/GUI/VerticalZooming"),
132 false});
133
134 S.AddSpace(10);
135
136 S.StartMultiColumn(2);
137 {
138 S.TieChoice( XXO("Solo &Button:"), TracksBehaviorsSolo);
139 }
140 S.EndMultiColumn();
141 }
142 S.EndStatic();
143 auto pastedAudioBox = S.StartStatic(XO("Pasted audio"));
144 {
145 const auto header = S.AddVariableText(XO("Paste audio from other Audacity project as"));
146#if wxUSE_ACCESSIBILITY
147 if(pastedAudioBox != nullptr)
148 {
149 pastedAudioBox->SetName(header->GetLabel());
150 safenew WindowAccessible(pastedAudioBox);
151 }
152#endif
153 S.StartRadioButtonGroup(TracksBehaviorsAudioTrackPastePolicy);
154 for(int i = 0;
156 ++i)
157 {
158 S.StartHorizontalLay(wxALIGN_LEFT);
159 {
160 wxRadioButton* radioButton{};
161 S.StartVerticalLay(0);
162 {
163 radioButton =
164 S.Name(audioPasteModeText[i]).TieRadioButton();
165 S.AddSpace(0, 0, 1);
166 }
167 S.EndVerticalLay();
168
169 S.AddVariableText(audioPasteModeText[i])->Bind(
170 wxEVT_LEFT_UP, [=](auto)
171 {
172 radioButton->SetValue(true);
173 });
174 #if wxUSE_ACCESSIBILITY
175 safenew WindowAccessible(radioButton);
176 #endif
177 }
178 S.EndHorizontalLay();
179 }
180 S.EndRadioButtonGroup();
181 }
182 S.EndStatic();
183
184 S.EndScroller();
185}
186
188{
193
194 return true;
195}
196
197namespace{
199 [](wxWindow *parent, wxWindowID winid, AudacityProject *)
200 {
201 wxASSERT(parent); // to justify safenew
202 return safenew TracksBehaviorsPrefs(parent, winid);
203 },
204 false,
205 // Place it at a lower tree level
206 { "Tracks" }
207};
208}
wxT("CloseDown"))
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define safenew
Definition: MemoryX.h:10
ByColumns_t ByColumns
Definition: Prefs.cpp:474
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
ChoiceSetting TracksBehaviorsSolo
ChoiceSetting TracksBehaviorsAudioTrackPastePolicy
#define TRACKS_BEHAVIORS_PREFS_PLUGIN_SYMBOL
BoolSetting ScrollingPreference
Definition: ViewInfo.cpp:336
BoolSetting EditClipsCanMove
Definition: WaveTrack.cpp:2595
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
const EnumValueSymbols & GetSymbols() const
Definition: Prefs.h:434
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
void Invalidate() override
Definition: Prefs.h:282
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:625
A PrefsPanel for Tracks Behaviors settings.
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
TracksBehaviorsPrefs(wxWindow *parent, wxWindowID winid)
void PopulateOrExchange(ShuttleGui &S) override
ComponentInterfaceSymbol GetSymbol() const override
TranslatableString GetDescription() const override
Holds a msgid for the translation catalog; may also bind format arguments.
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...