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
65namespace
66{
68 XO("Smart clip.\n"
69 "The entire source clip will be pasted into your project, allowing you to access\ntrimmed audio data anytime."),
70 XO("Selected audio only.\n"
71 "Only the selected portion of the source clip will be pasted."),
72 XO("Ask me each time.\n"
73 "Show dialog each time audio is pasted."),
74 };
75}
76
78 wxT("/GUI/AudioTrackPastePolicy"),
79 {
81 { {}, {}, {} },
82 { wxT("Keep"), wxT("Discard"), wxT("Ask") }
83 },
84 2, // "Ask"
85};
86
88{
89 S.SetBorder(2);
90 S.StartScroller();
91
92 S.StartStatic(XO("Behaviors"));
93 {
94 S.TieCheckBox(XXO("&Select all audio, if selection required"),
95 {wxT("/GUI/SelectAllOnNone"),
96 false});
97 /* i18n-hint: Cut-lines are lines that can expand to show the cut audio.*/
98 S.TieCheckBox(XXO("Enable cut &lines"),
99 {wxT("/GUI/EnableCutLines"),
100 false});
101 S.TieCheckBox(XXO("Enable &dragging selection edges"),
102 {wxT("/GUI/AdjustSelectionEdges"),
103 true});
104 S
105 .TieCheckBox(XXO("Editing a clip can &move other clips"),
107 S.TieCheckBox(XXO("\"Move track focus\" c&ycles repeatedly through tracks"),
108 {wxT("/GUI/CircularTrackNavigation"),
109 false});
110 S.TieCheckBox(XXO("&Type to create a label"),
111 {wxT("/GUI/TypeToCreateLabel"),
112 false});
113 S.TieCheckBox(XXO("Use dialog for the &name of a new label"),
114 {wxT("/GUI/DialogForNameNewLabel"),
115 false});
116#ifdef EXPERIMENTAL_SCROLLING_LIMITS
117 S.TieCheckBox(XXO("Enable scrolling left of &zero"),
119#endif
120 S.TieCheckBox(XXO("Advanced &vertical zooming"),
121 {wxT("/GUI/VerticalZooming"),
122 false});
123
124 S.AddSpace(10);
125
126 S.StartMultiColumn(2);
127 {
128 S.TieChoice( XXO("Solo &Button:"), TracksBehaviorsSolo);
129 }
130 S.EndMultiColumn();
131 }
132 S.EndStatic();
133 auto pastedAudioBox = S.StartStatic(XO("Pasted audio"));
134 {
135 const auto header = S.AddVariableText(XO("Paste audio from other Audacity project as"));
136#if wxUSE_ACCESSIBILITY
137 if(pastedAudioBox != nullptr)
138 {
139 pastedAudioBox->SetName(header->GetLabel());
140 safenew WindowAccessible(pastedAudioBox);
141 }
142#endif
143 S.StartRadioButtonGroup(TracksBehaviorsAudioTrackPastePolicy);
144 for(int i = 0;
146 ++i)
147 {
148 S.StartHorizontalLay(wxALIGN_LEFT);
149 {
150 wxRadioButton* radioButton{};
151 S.StartVerticalLay(0);
152 {
153 radioButton =
154 S.Name(audioPasteModeText[i]).TieRadioButton();
155 S.AddSpace(0, 0, 1);
156 }
157 S.EndVerticalLay();
158
159 if (auto pText = S.AddVariableText(audioPasteModeText[i])) {
160 pText->Bind(
161 wxEVT_LEFT_UP, [=](auto)
162 {
163 radioButton->SetValue(true);
164 });
165 }
166 #if wxUSE_ACCESSIBILITY
167 safenew WindowAccessible(radioButton);
168 #endif
169 }
170 S.EndHorizontalLay();
171 }
172 S.EndRadioButtonGroup();
173 }
174 S.EndStatic();
175
176 S.EndScroller();
177}
178
180{
185
186 return true;
187}
188
189namespace{
191 [](wxWindow *parent, wxWindowID winid, AudacityProject *)
192 {
193 wxASSERT(parent); // to justify safenew
194 return safenew TracksBehaviorsPrefs(parent, winid);
195 },
196 false,
197 // Place it at a lower tree level
198 { "Tracks" }
199};
200}
wxT("CloseDown"))
XO("Cut/Copy/Paste")
XXO("&Cut/Copy/Paste Toolbar")
#define safenew
Definition: MemoryX.h:10
EnumSetting< SoloBehavior > TracksBehaviorsSolo
ByColumns_t ByColumns
Definition: Prefs.cpp:489
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
ChoiceSetting TracksBehaviorsAudioTrackPastePolicy
#define TRACKS_BEHAVIORS_PREFS_PLUGIN_SYMBOL
BoolSetting ScrollingPreference
Definition: ViewInfo.cpp:336
BoolSetting EditClipsCanMove
Definition: WaveTrack.cpp:4150
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:439
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:287
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:630
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 ...