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 #include "ViewInfo.h"
20 
21 #include "Prefs.h"
22 #include "../ShuttleGui.h"
23 
24 TracksBehaviorsPrefs::TracksBehaviorsPrefs(wxWindow * parent, wxWindowID winid)
25 /* i18n-hint: i.e. the behaviors of tracks */
26 : PrefsPanel(parent, winid, XO("Tracks Behaviors"))
27 {
28  Populate();
29 }
30 
32 {
33 }
34 
36 {
38 }
39 
41 {
42  return XO("Preferences for TracksBehaviors");
43 }
44 
46 {
47  return "Tracks_Behaviors_Preferences";
48 }
49 
51 {
52  //------------------------- Main section --------------------
53  // Now construct the GUI itself.
56  // ----------------------- End of main section --------------
57 }
58 
60  wxT("/GUI/Solo"),
61  {
62  ByColumns,
63  { XO("Simple"), XO("Multi-track"), XO("None") },
64  { wxT("Simple"), wxT("Multi"), wxT("None") }
65  },
66  0, // "Simple"
67 };
68 
70 {
71  S.SetBorder(2);
72  S.StartScroller();
73 
74  S.StartStatic(XO("Behaviors"));
75  {
76  S.TieCheckBox(XXO("&Select all audio, if selection required"),
77  {wxT("/GUI/SelectAllOnNone"),
78  false});
79  /* i18n-hint: Cut-lines are lines that can expand to show the cut audio.*/
80  S.TieCheckBox(XXO("Enable cut &lines"),
81  {wxT("/GUI/EnableCutLines"),
82  false});
83  S.TieCheckBox(XXO("Enable &dragging selection edges"),
84  {wxT("/GUI/AdjustSelectionEdges"),
85  true});
86  S.TieCheckBox(XXO("Editing a clip can &move other clips"),
87  {wxT("/GUI/EditClipCanMove"),
88  false});
89  S.TieCheckBox(XXO("\"Move track focus\" c&ycles repeatedly through tracks"),
90  {wxT("/GUI/CircularTrackNavigation"),
91  false});
92  S.TieCheckBox(XXO("&Type to create a label"),
93  {wxT("/GUI/TypeToCreateLabel"),
94  false});
95  S.TieCheckBox(XXO("Use dialog for the &name of a new label"),
96  {wxT("/GUI/DialogForNameNewLabel"),
97  false});
98 #ifdef EXPERIMENTAL_SCROLLING_LIMITS
99  S.TieCheckBox(XXO("Enable scrolling left of &zero"),
101 #endif
102  S.TieCheckBox(XXO("Advanced &vertical zooming"),
103  {wxT("/GUI/VerticalZooming"),
104  false});
105 
106  S.AddSpace(10);
107 
108  S.StartMultiColumn(2);
109  {
110  S.TieChoice( XXO("Solo &Button:"), TracksBehaviorsSolo);
111  }
112  S.EndMultiColumn();
113  }
114  S.EndStatic();
115  S.EndScroller();
116 }
117 
119 {
120  ShuttleGui S(this, eIsSavingToPrefs);
122 
123  return true;
124 }
125 
126 namespace{
128  [](wxWindow *parent, wxWindowID winid, AudacityProject *)
129  {
130  wxASSERT(parent); // to justify safenew
131  return safenew TracksBehaviorsPrefs(parent, winid);
132  },
133  false,
134  // Place it at a lower tree level
135  { "Tracks" }
136 };
137 }
138 
139 // Bug 825 is essentially that SyncLock requires EditClipsCanMove.
140 // SyncLock needs rethinking, but meanwhile this function
141 // fixes the issues of Bug 825 by allowing clips to move when in
142 // SyncLock.
144 {
145  bool mIsSyncLocked;
146  gPrefs->Read(wxT("/GUI/SyncLockTracks"), &mIsSyncLocked, false);
147  if( mIsSyncLocked )
148  return true;
149  bool editClipsCanMove;
150  gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipsCanMove, false);
151  return editClipsCanMove;
152 }
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
TracksBehaviorsSolo
ChoiceSetting TracksBehaviorsSolo
Definition: TracksBehaviorsPrefs.cpp:59
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:2459
GetEditClipsCanMove
bool GetEditClipsCanMove()
Definition: TracksBehaviorsPrefs.cpp:143
PrefsPanel::Registration
Definition: PrefsPanel.h:84
XO
#define XO(s)
Definition: Internat.h:31
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:127
ScrollingPreference
BoolSetting ScrollingPreference
Definition: ViewInfo.cpp:346
TracksBehaviorsPrefs::TracksBehaviorsPrefs
TracksBehaviorsPrefs(wxWindow *parent, wxWindowID winid)
Definition: TracksBehaviorsPrefs.cpp:24
ShuttleGuiBase::EndScroller
void EndScroller()
Definition: ShuttleGui.cpp:971
ChoiceSetting
Definition: Prefs.h:270
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:40
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
ViewInfo.h
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:69
TracksBehaviorsPrefs::~TracksBehaviorsPrefs
~TracksBehaviorsPrefs()
Definition: TracksBehaviorsPrefs.cpp:31
TracksBehaviorsPrefs::Populate
void Populate()
Definition: TracksBehaviorsPrefs.cpp:50
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:92
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:45
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:420
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:35
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:118