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("Editing a clip can &move other clips"),
103 S.TieCheckBox(
104 XXO("&Always paste audio as new clips"),
105 { wxT("/GUI/PasteAsNewClips"), false });
106 S.TieCheckBox(XXO("\"Move track focus\" c&ycles repeatedly through tracks"),
107 {wxT("/GUI/CircularTrackNavigation"),
108 false});
109 S.TieCheckBox(XXO("&Type to create a label"),
110 {wxT("/GUI/TypeToCreateLabel"),
111 false});
112 S.TieCheckBox(XXO("Use dialog for the &name of a new label"),
113 {wxT("/GUI/DialogForNameNewLabel"),
114 false});
115
116 S.AddSpace(10);
117
118 S.StartMultiColumn(2);
119 {
120 S.TieChoice( XXO("Solo &Button:"), TracksBehaviorsSolo);
121 }
122 S.EndMultiColumn();
123 }
124 S.EndStatic();
125 auto pastedAudioBox = S.StartStatic(XO("Pasted audio"));
126 {
127 const auto header = S.AddVariableText(XO("Paste audio from other Audacity project as"));
128#if wxUSE_ACCESSIBILITY
129 if(pastedAudioBox != nullptr)
130 {
131 pastedAudioBox->SetName(header->GetLabel());
132 safenew WindowAccessible(pastedAudioBox);
133 }
134#endif
135 S.StartRadioButtonGroup(TracksBehaviorsAudioTrackPastePolicy);
136 for(int i = 0;
138 ++i)
139 {
140 S.StartHorizontalLay(wxALIGN_LEFT);
141 {
142 wxRadioButton* radioButton{};
143 S.StartVerticalLay(0);
144 {
145 radioButton =
146 S.Name(audioPasteModeText[i]).TieRadioButton();
147 S.AddSpace(0, 0, 1);
148 }
149 S.EndVerticalLay();
150
151 if (auto pText = S.AddVariableText(audioPasteModeText[i])) {
152 pText->Bind(
153 wxEVT_LEFT_UP, [=](auto)
154 {
155 radioButton->SetValue(true);
156 });
157 }
158 #if wxUSE_ACCESSIBILITY
159 safenew WindowAccessible(radioButton);
160 #endif
161 }
162 S.EndHorizontalLay();
163 }
164 S.EndRadioButtonGroup();
165 }
166 S.EndStatic();
167
168 S.EndScroller();
169}
170
172{
176
177 return true;
178}
179
180namespace{
182 [](wxWindow *parent, wxWindowID winid, AudacityProject *)
183 {
184 wxASSERT(parent); // to justify safenew
185 return safenew TracksBehaviorsPrefs(parent, winid);
186 },
187 false,
188 // Place it at a lower tree level
189 { "Tracks" }
190};
191}
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:515
@ 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 EditClipsCanMove
Definition: WaveTrack.cpp:3417
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:441
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:289
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
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 ...