Audacity  3.0.3
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 
18 #include "TracksBehaviorsPrefs.h"
19 
20 #include "Prefs.h"
21 #include "../ShuttleGui.h"
22 
23 TracksBehaviorsPrefs::TracksBehaviorsPrefs(wxWindow * parent, wxWindowID winid)
24 /* i18n-hint: i.e. the behaviors of tracks */
25 : PrefsPanel(parent, winid, XO("Tracks Behaviors"))
26 {
27  Populate();
28 }
29 
31 {
32 }
33 
35 {
37 }
38 
40 {
41  return XO("Preferences for TracksBehaviors");
42 }
43 
45 {
46  return "Tracks_Behaviors_Preferences";
47 }
48 
50 {
51  static auto string = wxT("/GUI/ScrollBeyondZero");
52  return string;
53 }
54 
56 {
57  //------------------------- Main section --------------------
58  // Now construct the GUI itself.
61  // ----------------------- End of main section --------------
62 }
63 
65  wxT("/GUI/Solo"),
66  {
67  ByColumns,
68  { XO("Simple"), XO("Multi-track"), XO("None") },
69  { wxT("Simple"), wxT("Multi"), wxT("None") }
70  },
71  0, // "Simple"
72 };
73 
75 {
76  S.SetBorder(2);
77  S.StartScroller();
78 
79  S.StartStatic(XO("Behaviors"));
80  {
81  S.TieCheckBox(XXO("&Select all audio, if selection required"),
82  {wxT("/GUI/SelectAllOnNone"),
83  false});
84  /* i18n-hint: Cut-lines are lines that can expand to show the cut audio.*/
85  S.TieCheckBox(XXO("Enable cut &lines"),
86  {wxT("/GUI/EnableCutLines"),
87  false});
88  S.TieCheckBox(XXO("Enable &dragging selection edges"),
89  {wxT("/GUI/AdjustSelectionEdges"),
90  true});
91  S.TieCheckBox(XXO("Editing a clip can &move other clips"),
92  {wxT("/GUI/EditClipCanMove"),
93  true});
94  S.TieCheckBox(XXO("\"Move track focus\" c&ycles repeatedly through tracks"),
95  {wxT("/GUI/CircularTrackNavigation"),
96  false});
97  S.TieCheckBox(XXO("&Type to create a label"),
98  {wxT("/GUI/TypeToCreateLabel"),
99  false});
100  S.TieCheckBox(XXO("Use dialog for the &name of a new label"),
101  {wxT("/GUI/DialogForNameNewLabel"),
102  false});
103 #ifdef EXPERIMENTAL_SCROLLING_LIMITS
104  S.TieCheckBox(XXO("Enable scrolling left of &zero"),
107 #endif
108  S.TieCheckBox(XXO("Advanced &vertical zooming"),
109  {wxT("/GUI/VerticalZooming"),
110  false});
111 
112  S.AddSpace(10);
113 
114  S.StartMultiColumn(2);
115  {
116  S.TieChoice( XXO("Solo &Button:"), TracksBehaviorsSolo);
117  }
118  S.EndMultiColumn();
119  }
120  S.EndStatic();
121  S.EndScroller();
122 }
123 
125 {
126  ShuttleGui S(this, eIsSavingToPrefs);
128 
129  return true;
130 }
131 
132 namespace{
134  [](wxWindow *parent, wxWindowID winid, AudacityProject *)
135  {
136  wxASSERT(parent); // to justify safenew
137  return safenew TracksBehaviorsPrefs(parent, winid);
138  },
139  false,
140  // Place it at a lower tree level
141  { "Tracks" }
142 };
143 }
144 
145 // Bug 825 is essentially that SyncLock requires EditClipsCanMove.
146 // SyncLock needs rethinking, but meanwhile this function
147 // fixes the issues of Bug 825 by allowing clips to move when in
148 // SyncLock.
150 {
151  bool mIsSyncLocked;
152  gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
153  if( mIsSyncLocked )
154  return true;
155  bool editClipsCanMove;
156  gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipsCanMove, true);
157  return editClipsCanMove;
158 }
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
TracksBehaviorsSolo
ChoiceSetting TracksBehaviorsSolo
Definition: TracksBehaviorsPrefs.cpp:64
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2447
GetEditClipsCanMove
bool GetEditClipsCanMove()
Definition: TracksBehaviorsPrefs.cpp:149
PrefsPanel::Registration
Definition: PrefsPanel.h:84
XO
#define XO(s)
Definition: Internat.h:31
TracksBehaviorsPrefs::ScrollingPreferenceKey
static const wxChar * ScrollingPreferenceKey()
Definition: TracksBehaviorsPrefs.cpp:49
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
TracksBehaviorsPrefs.h
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
anonymous_namespace{TracksBehaviorsPrefs.cpp}::sAttachment
PrefsPanel::Registration sAttachment
Definition: TracksBehaviorsPrefs.cpp:133
TracksBehaviorsPrefs::TracksBehaviorsPrefs
TracksBehaviorsPrefs(wxWindow *parent, wxWindowID winid)
Definition: TracksBehaviorsPrefs.cpp:23
ShuttleGuiBase::EndScroller
void EndScroller()
Definition: ShuttleGui.cpp:971
ChoiceSetting
Definition: Prefs.h:267
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::StartScroller
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:938
TracksBehaviorsPrefs::GetDescription
TranslatableString GetDescription() override
Definition: TracksBehaviorsPrefs.cpp:39
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
TracksBehaviorsPrefs::ScrollingPreferenceDefault
static bool ScrollingPreferenceDefault()
Definition: TracksBehaviorsPrefs.h:36
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:48
TracksBehaviorsPrefs::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: TracksBehaviorsPrefs.cpp:74
TracksBehaviorsPrefs::~TracksBehaviorsPrefs
~TracksBehaviorsPrefs()
Definition: TracksBehaviorsPrefs.cpp:30
TracksBehaviorsPrefs::Populate
void Populate()
Definition: TracksBehaviorsPrefs.cpp:55
TaggedIdentifier< ManualPageIDTag >
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:113
TRACKS_BEHAVIORS_PREFS_PLUGIN_SYMBOL
#define TRACKS_BEHAVIORS_PREFS_PLUGIN_SYMBOL
Definition: TracksBehaviorsPrefs.h:22
TracksBehaviorsPrefs::HelpPageName
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
Definition: TracksBehaviorsPrefs.cpp:44
PrefsPanel
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
TracksBehaviorsPrefs
A PrefsPanel for Tracks Behaviors settings.
Definition: TracksBehaviorsPrefs.h:25
Prefs.h
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
ByColumns
ByColumns_t ByColumns
Definition: Prefs.cpp:414
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:47
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
safenew
#define safenew
Definition: MemoryX.h:10
TracksBehaviorsPrefs::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: TracksBehaviorsPrefs.cpp:34
ShuttleGuiBase::TieChoice
wxChoice * TieChoice(const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
Definition: ShuttleGui.cpp:1727
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
TracksBehaviorsPrefs::Commit
bool Commit() override
Definition: TracksBehaviorsPrefs.cpp:124