Audacity  3.0.3
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
SelectionBar Class Referencefinal

(not quite a Toolbar) at foot of screen for setting and viewing the selection range. More...

#include <SelectionBar.h>

Inheritance diagram for SelectionBar:
[legend]
Collaboration diagram for SelectionBar:
[legend]

Public Member Functions

 SelectionBar (AudacityProject &project)
 
virtual ~SelectionBar ()
 
void Create (wxWindow *parent) override
 
void Populate () override
 
void Repaint (wxDC *WXUNUSED(dc)) override
 
void EnableDisableButtons () override
 
void UpdatePrefs () override
 
void SetTimes (double start, double end, double audio)
 
void SetSnapTo (int)
 
void SetSelectionFormat (const NumericFormatSymbol &format)
 
void SetRate (double rate)
 
void SetListener (SelectionBarListener *l)
 
void RegenerateTooltips () override
 
- Public Member Functions inherited from ToolBar
 ToolBar (AudacityProject &project, int type, const TranslatableString &label, const wxString &section, bool resizable=false)
 
virtual ~ToolBar ()
 
bool AcceptsFocus () const override
 
virtual void SetToDefaultSize ()
 
virtual void ReCreateButtons ()
 
void UpdatePrefs () override
 
int GetType ()
 
TranslatableString GetTitle ()
 
TranslatableString GetLabel ()
 
wxString GetSection ()
 
ToolDockGetDock ()
 
void SetLabel (const TranslatableString &label)
 
virtual void SetDocked (ToolDock *dock, bool pushed)
 
virtual bool Expose (bool show=true)
 
bool IsResizable () const
 
bool IsVisible () const
 
bool IsDocked () const
 
bool IsPositioned ()
 
void SetVisible (bool bVisible)
 
void SetPositioned ()
 
virtual int GetInitialWidth ()
 Resizable toolbars should implement these. More...
 
virtual int GetMinToolbarWidth ()
 
virtual wxSize GetDockedSize ()
 
wxSize GetSmartDockedSize ()
 
virtual void ResizingDone ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Member Functions

static SelectionBarGet (AudacityProject &project)
 
static const SelectionBarGet (const AudacityProject &project)
 
- Static Public Member Functions inherited from ToolBar
static AButtonMakeButton (wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size)
 
static void MakeAlternateImages (AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size)
 
static void SetButtonToolTip (AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
 
static void MakeButtonBackgroundsSmall ()
 
static void MakeButtonBackgroundsLarge ()
 

Private Member Functions

auStaticTextAddTitle (const TranslatableString &Title, wxSizer *pSizer)
 
NumericTextCtrlAddTime (const TranslatableString &Name, int id, wxSizer *pSizer)
 
void AddVLine (wxSizer *pSizer)
 
void SetSelectionMode (int mode)
 
void ShowHideControls (int mode)
 
void SetDrivers (int driver1, int driver2)
 
void ValuesToControls ()
 
void OnUpdate (wxCommandEvent &evt)
 
void OnChangedTime (wxCommandEvent &evt)
 
void OnRate (wxCommandEvent &event)
 
void OnSnapTo (wxCommandEvent &event)
 
void OnChoice (wxCommandEvent &event)
 
void OnFocus (wxFocusEvent &event)
 
void OnCaptureKey (wxCommandEvent &event)
 
void OnSize (wxSizeEvent &evt)
 
void OnIdle (wxIdleEvent &evt)
 
void ModifySelection (int newDriver, bool done=false)
 
void UpdateRates ()
 
void SelectionModeUpdated ()
 

Private Attributes

SelectionBarListenermListener
 
double mRate
 
double mStart
 
double mEnd
 
double mLength
 
double mCenter
 
double mAudio
 
int mDrive1
 
int mDrive2
 
int mSelectionMode { 0 }
 
int mLastSelectionMode { 0 }
 
NumericTextCtrlmStartTime
 
NumericTextCtrlmCenterTime
 
NumericTextCtrlmLengthTime
 
NumericTextCtrlmEndTime
 
NumericTextCtrlmAudioTime
 
wxChoice * mChoice
 
wxStaticText * mProxy
 
wxComboBox * mRateBox
 
wxChoice * mSnapTo
 
wxWindow * mRateText
 
wxString mLastValidText
 

Additional Inherited Members

- Public Types inherited from ToolBar
using Holder = wxWindowPtr< ToolBar >
 
- Protected Member Functions inherited from ToolBar
void SetButton (bool down, AButton *button)
 
wxBoxSizer * GetSizer ()
 
void Add (wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
 
void Add (wxSizer *sizer, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 
void Add (int width, int height, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL)
 
void AddSpacer (int size=14)
 
void AddStretchSpacer (int prop=1)
 
void Detach (wxWindow *window)
 
void Detach (wxSizer *sizer)
 
void Updated ()
 
int GetResizeGrabberWidth ()
 Returns the width in pixels of the resizer element. More...
 
virtual void Repaint (wxDC *dc)=0
 
void OnErase (wxEraseEvent &event)
 
void OnPaint (wxPaintEvent &event)
 
void OnMouseEvents (wxMouseEvent &event)
 
- Protected Member Functions inherited from PrefsListener
virtual void UpdateSelectedPrefs (int id)
 
 PrefsListener ()
 
virtual ~PrefsListener ()
 
- Static Protected Member Functions inherited from ToolBar
static void MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
static void MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
- Static Protected Member Functions inherited from PrefsListener
static void Broadcast (int id=0)
 Call this static function to notify all PrefsListener objects. More...
 
- Protected Attributes inherited from ToolBar
AudacityProjectmProject
 
TranslatableString mLabel
 
wxString mSection
 
int mType
 

Detailed Description

(not quite a Toolbar) at foot of screen for setting and viewing the selection range.

Definition at line 45 of file SelectionBar.h.

Constructor & Destructor Documentation

◆ SelectionBar()

SelectionBar::SelectionBar ( AudacityProject project)

Definition at line 110 of file SelectionBar.cpp.

111 : ToolBar(project, SelectionBarID, XO("Selection"), wxT("Selection")),
112  mListener(NULL), mRate(0.0),
113  mStart(0.0), mEnd(0.0), mLength(0.0), mCenter(0.0), mAudio(0.0),
115  mSelectionMode(0),
116  mStartTime(NULL), mCenterTime(NULL), mLengthTime(NULL), mEndTime(NULL),
117  mAudioTime(NULL),
118  mChoice(NULL)
119 {
120  // Make sure we have a valid rate as the NumericTextCtrl()s
121  // created in Populate()
122  // depend on it. Otherwise, division-by-zero floating point exceptions
123  // will occur.
124  // Refer to bug #462 for a scenario where the division-by-zero causes
125  // Audacity to fail.
126  // We expect mRate to be set from the project later.
128 
129  // Selection mode of 0 means showing 'start' and 'end' only.
130  mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
131 }

References QualitySettings::DefaultSampleRate, gPrefs, and Read().

Here is the call graph for this function:

◆ ~SelectionBar()

SelectionBar::~SelectionBar ( )
virtual

Definition at line 133 of file SelectionBar.cpp.

134 {
135 }

Member Function Documentation

◆ AddTime()

NumericTextCtrl * SelectionBar::AddTime ( const TranslatableString Name,
int  id,
wxSizer *  pSizer 
)
private

Definition at line 167 of file SelectionBar.cpp.

168  {
169  auto formatName = mListener ? mListener->AS_GetSelectionFormat()
171  auto pCtrl = safenew NumericTextCtrl(
172  this, id, NumericConverter::TIME, formatName, 0.0, mRate);
173  pCtrl->SetName( Name );
174  pSizer->Add(pCtrl, 0, wxALIGN_TOP | wxRIGHT, 5);
175  return pCtrl;
176 }

References SelectionBarListener::AS_GetSelectionFormat(), mListener, mRate, safenew, and NumericConverter::TIME.

Referenced by Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddTitle()

auStaticText * SelectionBar::AddTitle ( const TranslatableString Title,
wxSizer *  pSizer 
)
private

Definition at line 155 of file SelectionBar.cpp.

156  {
157  const auto translated = Title.Translation();
158  auStaticText * pTitle = safenew auStaticText(this, translated );
159  pTitle->SetBackgroundColour( theTheme.Colour( clrMedium ));
160  pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
161  pSizer->Add( pTitle, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxRIGHT, 5 );
162 
163  return pTitle;
164 }

References ThemeBase::Colour(), safenew, theTheme, and TranslatableString::Translation().

Referenced by Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddVLine()

void SelectionBar::AddVLine ( wxSizer *  pSizer)
private

Definition at line 178 of file SelectionBar.cpp.

178  {
179  pSizer->Add(safenew wxStaticLine(this, -1, wxDefaultPosition,
180  wxSize(1, toolbarSingle-10),
181  wxLI_VERTICAL),
182  0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
183 }

References safenew, and toolbarSingle.

Referenced by Populate().

Here is the caller graph for this function:

◆ Create()

void SelectionBar::Create ( wxWindow *  parent)
overridevirtual

Reimplemented from ToolBar.

Definition at line 148 of file SelectionBar.cpp.

149 {
150  ToolBar::Create(parent);
151  UpdatePrefs();
152 }

References ToolBar::Create(), and UpdatePrefs().

Here is the call graph for this function:

◆ EnableDisableButtons()

void SelectionBar::EnableDisableButtons ( )
inlineoverridevirtual

Implements ToolBar.

Definition at line 58 of file SelectionBar.h.

58 {};

◆ Get() [1/2]

SelectionBar & SelectionBar::Get ( AudacityProject project)
static

Definition at line 137 of file SelectionBar.cpp.

138 {
139  auto &toolManager = ToolManager::Get( project );
140  return *static_cast<SelectionBar*>( toolManager.GetToolBar(SelectionBarID) );
141 }

References ToolManager::Get(), and SelectionBarID.

Referenced by ProjectFileManager::AddImportedTracks(), SetProjectCommand::Apply(), ProjectSelectionManager::AS_SetRate(), ProjectSelectionManager::AS_SetSelectionFormat(), ProjectSelectionManager::AS_SetSnapTo(), Get(), AUPImportFileHandle::Import(), ProjectManager::New(), ProjectFileManager::OpenProjectFile(), and ProjectSettings::UpdatePrefs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [2/2]

const SelectionBar & SelectionBar::Get ( const AudacityProject project)
static

Definition at line 143 of file SelectionBar.cpp.

144 {
145  return Get( const_cast<AudacityProject&>( project )) ;
146 }

References Get().

Here is the call graph for this function:

◆ ModifySelection()

void SelectionBar::ModifySelection ( int  newDriver,
bool  done = false 
)
private

Definition at line 412 of file SelectionBar.cpp.

413 {
414  // If the user moved to a different control, then update which
415  // two controls drive the others.
416  if( newDriver != mDrive2 )
417  SetDrivers( mDrive2, newDriver);
418 
419  // Only update a value if user typed something in.
420  // The reason is the controls may be less accurate than
421  // the values.
422  if( newDriver == StartTimeID )
424  if( newDriver == EndTimeID )
425  mEnd = mEndTime->GetValue();
426  if( newDriver == LengthTimeID )
428  if( newDriver == CenterTimeID )
430 
431  // There are four controls, and two constraints, which are:
432  // mid = (start+end)/2
433  // length = (end-start)
434  // Therefore we can select any two controls as 'drivers' of
435  // the other two.
436  // Here we compute 'i' which combines the identity of the two
437  // driving controls, to use it as an index.
438  // The order of the two drivers generally does not matter much,
439  // except that we want:
440  // start < end
441  // and preserve that by adjusting the least dominant driving
442  // control.
443  int i = mDrive1 + 4 * mDrive2;
444  switch(i) {
445  case StartTimeID + 4 * EndTimeID:
446  if( mEnd < mStart )
447  mStart = mEnd;
448  case StartTimeID * 4 + EndTimeID:
449  if( mStart > mEnd )
450  mEnd = mStart;
451  mLength = mEnd - mStart;
452  mCenter = (mStart+mEnd)/2.0;
453  break;
454 
455  case StartTimeID + 4 * LengthTimeID:
456  case StartTimeID * 4 + LengthTimeID:
457  mEnd = mStart+mLength;
458  mCenter = (mStart+mEnd)/2.0;
459  break;
460 
461  case EndTimeID + 4 * LengthTimeID:
462  if( mEnd - mLength < 0 )
463  mEnd += (mLength - mEnd);
464  case EndTimeID * 4 + LengthTimeID:
465  if( mEnd - mLength < 0)
466  mLength -= (mLength - mEnd);
467  mStart = mEnd - mLength;
468  mCenter = (mStart+mEnd)/2.0;
469  break;
470 
471  case LengthTimeID + 4 * CenterTimeID:
472  if( mCenter - (mLength / 2) < 0 )
473  mLength = (mCenter * 2);
474  case LengthTimeID * 4 + CenterTimeID:
475  if( mCenter - (mLength / 2) < 0 )
476  mCenter = (mLength / 2);
477  mStart = mCenter - mLength/2.0;
478  mEnd = mCenter + mLength/2.0;
479  break;
480 
481  default:
482  // The above should cover all legal combinations of two distinct controls.
483  wxFAIL_MSG( "Illegal sequence of selection changes");
484  }
485 
486  // Refresh the controls now
488 
489  // Places the start-end markers on the track panel.
491 }

References SelectionBarListener::AS_ModifySelection(), CenterTimeID, EndTimeID, NumericConverter::GetValue(), LengthTimeID, mCenter, mCenterTime, mDrive1, mDrive2, mEnd, mEndTime, mLength, mLengthTime, mListener, mStart, mStartTime, SetDrivers(), StartTimeID, and ValuesToControls().

Referenced by OnChangedTime().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnCaptureKey()

void SelectionBar::OnCaptureKey ( wxCommandEvent &  event)
private

Definition at line 775 of file SelectionBar.cpp.

776 {
777  wxKeyEvent *kevent = (wxKeyEvent *)event.GetEventObject();
778  wxWindow *w = FindFocus();
779  int keyCode = kevent->GetKeyCode();
780 
781  // Convert numeric keypad entries.
782  if ((keyCode >= WXK_NUMPAD0) && (keyCode <= WXK_NUMPAD9)) {
783  keyCode -= WXK_NUMPAD0 - '0';
784  }
785 
786  if (keyCode >= '0' && keyCode <= '9') {
787  return;
788  }
789 
790  // UP/DOWN/LEFT/RIGHT for mRateText
791  if (w == mRateText) {
792  switch (keyCode)
793  {
794  case WXK_LEFT:
795  case WXK_RIGHT:
796  case WXK_UP:
797  case WXK_DOWN:
798  case WXK_DELETE:
799  case WXK_BACK:
800  return;
801  }
802  }
803 
804  event.Skip();
805 }

References mRateText.

◆ OnChangedTime()

void SelectionBar::OnChangedTime ( wxCommandEvent &  evt)
private

Definition at line 493 of file SelectionBar.cpp.

494 {
495  ModifySelection(event.GetId(), event.GetInt() != 0);
496 }

References ModifySelection().

Here is the call graph for this function:

◆ OnChoice()

void SelectionBar::OnChoice ( wxCommandEvent &  event)
private

Definition at line 585 of file SelectionBar.cpp.

586 {
587  int mode = mChoice->GetSelection();
588  SetSelectionMode( mode );
590 }

References mChoice, SelectionModeUpdated(), and SetSelectionMode().

Here is the call graph for this function:

◆ OnFocus()

void SelectionBar::OnFocus ( wxFocusEvent &  event)
private

Definition at line 770 of file SelectionBar.cpp.

771 {
772  KeyboardCapture::OnFocus( *this, event );
773 }

References KeyboardCapture::OnFocus().

Referenced by Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnIdle()

void SelectionBar::OnIdle ( wxIdleEvent &  evt)
private

Definition at line 592 of file SelectionBar.cpp.

593 {
594  evt.Skip();
595  auto &project = mProject;
596  const auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
597 
598  double audioTime;
599 
600  auto &projectAudioIO = ProjectAudioIO::Get( project );
601  if ( projectAudioIO.IsAudioActive() ){
602  auto gAudioIO = AudioIO::Get();
603  audioTime = gAudioIO->GetStreamTime();
604  }
605  else {
606  const auto &playRegion = ViewInfo::Get( project ).playRegion;
607  audioTime = playRegion.GetStart();
608  }
609 
610  SetTimes(selectedRegion.t0(), selectedRegion.t1(), audioTime);
611 }

References AudioIO::Get(), ViewInfo::Get(), ProjectAudioIO::Get(), PlayRegion::GetStart(), ToolBar::mProject, ViewInfo::playRegion, ViewInfo::selectedRegion, and SetTimes().

Here is the call graph for this function:

◆ OnRate()

void SelectionBar::OnRate ( wxCommandEvent &  event)
private

Definition at line 736 of file SelectionBar.cpp.

737 {
738  auto value = mRateBox->GetValue();
739 
740  if (value.ToDouble(&mRate) && // is a numeric value
741  (mRate != 0.0))
742  {
744  int i;
745  for(i=0;i<5;i++)
746  if( *Ctrls[i] )
747  (*Ctrls[i])->SetSampleRate( mRate );
749 
750  mLastValidText = value;
751  }
752  else
753  {
754  // Bug 2497 - Undo paste into text box if it's not numeric
755  mRateBox->SetValue(mLastValidText);
756  }
757 }

References SelectionBarListener::AS_SetRate(), mAudioTime, mCenterTime, mEndTime, mLastValidText, mLengthTime, mListener, mRate, mRateBox, and mStartTime.

Here is the call graph for this function:

◆ OnSize()

void SelectionBar::OnSize ( wxSizeEvent &  evt)
private

Definition at line 403 of file SelectionBar.cpp.

404 {
405  Refresh( true );
406 
407  evt.Skip();
408 }

◆ OnSnapTo()

void SelectionBar::OnSnapTo ( wxCommandEvent &  event)
private

Definition at line 807 of file SelectionBar.cpp.

808 {
809  mListener->AS_SetSnapTo(mSnapTo->GetSelection());
810 }

References SelectionBarListener::AS_SetSnapTo(), mListener, and mSnapTo.

Here is the call graph for this function:

◆ OnUpdate()

void SelectionBar::OnUpdate ( wxCommandEvent &  evt)
private

Definition at line 499 of file SelectionBar.cpp.

500 {
501  wxWindow *w = FindFocus();
503  int i;
504  int iFocus = -1;
505  for(i=0;i<5;i++)
506  if( w == *Ctrls[i] )
507  iFocus = i;
508 
509  evt.Skip(false);
510 
512 
513  // Save format name before recreating the controls so they resize properly
514  if (mStartTime)
515  {
516  if (mListener)
518  }
519 
520  // ReCreateButtons() will get rid of our sizers and controls
521  // so reset pointers first.
522  for( i=0;i<5;i++)
523  *Ctrls[i]=NULL;
524 
525  mChoice = NULL;
526  mRateBox = NULL;
527  mRateText = NULL;
528  mSnapTo = NULL;
529 
531 
533 
534  for( i=0;i<5;i++)
535  if( *Ctrls[i] )
536  (*Ctrls[i])->SetFormatName( format );
537 
538  if( iFocus >=0 )
539  if( *Ctrls[iFocus] )
540  (*Ctrls[iFocus])->SetFocus();
541 
543 
544  Updated();
545 }

References SelectionBarListener::AS_SetSelectionFormat(), format, NumericConverter::LookupFormat(), mAudioTime, mCenterTime, mChoice, mEndTime, mLengthTime, mListener, mRateBox, mRateText, mSnapTo, mStartTime, ToolBar::ReCreateButtons(), RegenerateTooltips(), NumericConverter::TIME, ToolBar::Updated(), and ValuesToControls().

Referenced by SetSelectionFormat(), and UpdatePrefs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Populate()

void SelectionBar::Populate ( )
overridevirtual

Implements ToolBar.

Definition at line 185 of file SelectionBar.cpp.

186 {
187  SetBackgroundColour( theTheme.Colour( clrMedium ) );
188 
190 
191  // Outer sizer has space top and left.
192  // Inner sizers have space on right only.
193  // This choice makes for a nice border and internal spacing and places clear responsibility
194  // on each sizer as to what spacings it creates.
195  wxFlexGridSizer *mainSizer = safenew wxFlexGridSizer(SIZER_COLS, 1, 1);
196  Add(mainSizer, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 5);
197 
198  // Top row (mostly labels)
199  wxColour clrText = theTheme.Colour( clrTrackPanelText );
200  wxColour clrText2 = *wxBLUE;
201  auStaticText *rateLabel = AddTitle( XO("Project Rate (Hz)"), mainSizer );
202  AddVLine( mainSizer );
203  auStaticText *snapLabel = AddTitle( XO("Snap-To"), mainSizer );
204  AddVLine( mainSizer );
205 #ifdef TIME_IN_SELECT_TOOLBAR
206  AddTitle( XO("Audio Position"), mainSizer );
207  AddVLine( mainSizer );
208 #endif
209 
210  {
211  const wxString choices[4] = {
212  _("Start and End of Selection"),
213  _("Start and Length of Selection"),
214  _("Length and End of Selection"),
215  _("Length and Center of Selection"),
216  };
217  mChoice = safenew wxChoice
218  (this, ChoiceID, wxDefaultPosition, wxDefaultSize, 4, choices,
219  0, wxDefaultValidator, _("Show"));
220  mChoice->SetSelection(0);
221 #if wxUSE_ACCESSIBILITY
222  // so that name can be set on a standard control
223  mChoice->SetAccessible(safenew WindowAccessible(mChoice));
224 #endif
225  mainSizer->Add(mChoice, 0, wxEXPAND | wxALIGN_TOP | wxRIGHT, 6);
226  }
227 
228  // Bottom row, (mostly time controls)
229  mRateBox = safenew wxComboBox(this, RateID,
230  wxT(""),
231  wxDefaultPosition, wxDefaultSize);
232 #if wxUSE_ACCESSIBILITY
233  // so that name can be set on a standard control
234  mRateBox->SetAccessible(safenew WindowAccessible(mRateBox));
235 #endif
236  mRateBox->SetName(_("Project Rate (Hz)"));
237  //mRateBox->SetForegroundColour( clrText2 );
238  wxTextValidator vld(wxFILTER_INCLUDE_CHAR_LIST);
239  vld.SetIncludes(wxArrayString(10, numbers));
240  mRateBox->SetValidator(vld);
241  mRateBox->SetValue(wxString::Format(wxT("%d"), (int)mRate));
242  UpdateRates(); // Must be done _after_ setting value on mRateBox!
243 
244  // We need to capture the SetFocus and KillFocus events to set up
245  // for keyboard capture. On Windows and GTK it's easy since the
246  // combobox is presented as one control to hook into.
248 
249 #if defined(__WXMAC__)
250  // The Mac uses a standard wxTextCtrl for the edit portion and that's
251  // the control that gets the focus events. So we have to find the
252  // textctrl.
253  wxWindowList kids = mRateBox->GetChildren();
254  for (unsigned int i = 0; i < kids.size(); i++) {
255  wxClassInfo *ci = kids[i]->GetClassInfo();
256  if (ci->IsKindOf(CLASSINFO(wxTextCtrl))) {
257  mRateText = kids[i];
258  break;
259  }
260  }
261 #endif
262 
263  mRateText->Bind(wxEVT_SET_FOCUS,
265  this);
266  mRateText->Bind(wxEVT_KILL_FOCUS,
268  this);
269 
270  mainSizer->Add(mRateBox, 0, wxEXPAND | wxALIGN_TOP | wxRIGHT, 5);
271 
272  AddVLine( mainSizer );
273 
274  mSnapTo = safenew wxChoice(this, SnapToID,
275  wxDefaultPosition, wxDefaultSize,
276  transform_container< wxArrayStringEx >(
278  std::mem_fn( &TranslatableString::Translation ) ) );
279 
280 #if wxUSE_ACCESSIBILITY
281  // so that name can be set on a standard control
282  mSnapTo->SetAccessible(safenew WindowAccessible(mSnapTo));
283 #endif
284  mSnapTo->SetName(_("Snap To"));
285  //mSnapTo->SetForegroundColour( clrText2 );
286  mSnapTo->SetSelection(mListener ? mListener->AS_GetSnapTo() : SNAP_OFF);
287 
288  mSnapTo->Bind(wxEVT_SET_FOCUS,
290  this);
291  mSnapTo->Bind(wxEVT_KILL_FOCUS,
293  this);
294 
295  mainSizer->Add(mSnapTo, 0, wxEXPAND | wxALIGN_TOP | wxRIGHT, 5);
296 
297  AddVLine( mainSizer );
298 
299 #ifdef TIME_IN_SELECT_TOOLBAR
300  mAudioTime = AddTime( XO("Audio Position"), AudioTimeID, mainSizer );
301  // This vertical line is NOT just for decoration!
302  // It works around a wxWidgets-on-Windows RadioButton bug, where tabbing
303  // into the radiobutton group jumps to selecting the first item in the
304  // group even if some other item had been selected.
305  // It is an important bug to work around for screen reader users, who use TAB
306  // a lot in navigation.
307  // More about the bug here:
308  // https://forums.wxwidgets.org/viewtopic.php?t=41120
309  AddVLine( mainSizer );
310 #endif
311 
312  {
313  auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
314 
315  mStartTime = AddTime( XO("Start"), StartTimeID, hSizer.get() );
316  mLengthTime = AddTime( XO("Length"), LengthTimeID, hSizer.get() );
317  mCenterTime = AddTime( XO("Center"), CenterTimeID, hSizer.get() );
318  mEndTime = AddTime( XO("End"), EndTimeID, hSizer.get() );
319  mainSizer->Add(hSizer.release(), 0, wxALIGN_TOP | wxRIGHT, 0);
320  }
321 
322 #if defined(__WXGTK3__)
323  // Nothing special
324 #elif defined(__WXGTK__)
325  // Ensure the font fits inside (hopefully)
326  wxFont font = mChoice->GetFont();
327  font.Scale((double) toolbarSingle / mChoice->GetSize().GetHeight());
328 
329  rateLabel->SetFont(font);
330  snapLabel->SetFont(font);
331  mChoice->SetFont(font);
332  mRateBox->SetFont(font);
333  mRateText->SetFont(font);
334  mSnapTo->SetFont(font);
335 #endif
336 
337  // Make sure they are fully expanded to the longest item
338  mChoice->SetMinSize(wxSize(mChoice->GetBestSize().x, toolbarSingle));
339  mRateBox->SetMinSize(wxSize(mRateBox->GetBestSize().x, toolbarSingle));
340  mSnapTo->SetMinSize(wxSize(mSnapTo->GetBestSize().x, toolbarSingle));
341 
342  mChoice->MoveBeforeInTabOrder( mStartTime );
343  // This shows/hides controls.
344  // Do this before layout so that we are sized right.
346  mainSizer->Layout();
348  Layout();
349 }

References _, ToolBar::Add(), AddTime(), AddTitle(), AddVLine(), SelectionBarListener::AS_GetSnapTo(), AudioTimeID, CenterTimeID, ChoiceID, ThemeBase::Colour(), EndTimeID, SnapManager::GetSnapLabels(), LengthTimeID, mAudioTime, mCenterTime, mChoice, mEndTime, mLengthTime, mListener, mRate, mRateBox, mRateText, mSelectionMode, mSnapTo, mStartTime, numbers, OnFocus(), RateID, RegenerateTooltips(), safenew, SetSelectionMode(), SIZER_COLS, SNAP_OFF, SnapToID, StartTimeID, theTheme, toolbarSingle, TranslatableString::Translation(), UpdateRates(), and XO.

Here is the call graph for this function:

◆ RegenerateTooltips()

void SelectionBar::RegenerateTooltips ( )
overridevirtual

Implements ToolBar.

Definition at line 390 of file SelectionBar.cpp.

391 {
392 #if wxUSE_TOOLTIPS
393  auto formatName =
394  mListener
397  mSnapTo->SetToolTip(
398  wxString::Format(
399  _("Snap Clicks/Selections to %s"), formatName.Translation() ));
400 #endif
401 }

References _, SelectionBarListener::AS_GetSelectionFormat(), mListener, and mSnapTo.

Referenced by OnUpdate(), Populate(), and UpdatePrefs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Repaint()

void SelectionBar::Repaint ( wxDC *  WXUNUSEDdc)
inlineoverride

Definition at line 57 of file SelectionBar.h.

57 {};

◆ SelectionModeUpdated()

void SelectionBar::SelectionModeUpdated ( )
private

Definition at line 613 of file SelectionBar.cpp.

614 {
615  // We just changed the mode. Remember it.
616  gPrefs->Write(wxT("/SelectionToolbarMode"), mSelectionMode);
617  gPrefs->Flush();
618 
619  wxSize sz = GetMinSize();
620  sz.SetWidth( 10 );
621  SetMinSize( sz );
622  Fit();
623  Layout();
624  Updated();
625 }

References FileConfig::Flush(), gPrefs, mSelectionMode, and ToolBar::Updated().

Referenced by OnChoice().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDrivers()

void SelectionBar::SetDrivers ( int  driver1,
int  driver2 
)
private

Definition at line 549 of file SelectionBar.cpp.

550 {
551  mDrive1 = driver1;
552  mDrive2 = driver2;
553 
555  static TranslatableString Text[4] = {
556  /* i18n-hint noun */
557  XO("Start"),
558  XO("Center"),
559  XO("Length"),
560  /* i18n-hint noun */
561  XO("End")
562  };
563 
564  for(int i=0;i<4;i++){
565  int id = i + StartTimeID;
566  int fixed = (( id == mDrive2 )?mDrive1:mDrive2)-StartTimeID;
567 
568  const auto &Temp = Text[i];
569  auto Title = ( (id!=mDrive1) && (id!=mDrive2 ) )
570  /* i18n-hint: %s is replaced e.g by one of 'Length', 'Center',
571  'Start', or 'End' (translated), to indicate that it will be
572  calculated from other parameters. */
573  ? XO("%s - driven").Format( Temp )
574  : Temp ;
575  auto VoiceOverText =
576  /* i18n-hint: each string is replaced by one of 'Length', 'Center',
577  'Start', or 'End' (translated) */
578  XO("Selection %s. %s won't change.").Format( Temp, Text[fixed] );
579  if( *Ctrls[i] ){
580  (*Ctrls[i])->SetName( Temp );
581  }
582  }
583 }

References mCenterTime, mDrive1, mDrive2, mEndTime, mLengthTime, mStartTime, wxPanelWrapper::SetName(), StartTimeID, and XO.

Referenced by ModifySelection(), and SetSelectionMode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetListener()

void SelectionBar::SetListener ( SelectionBarListener l)

Definition at line 382 of file SelectionBar.cpp.

References SelectionBarListener::AS_GetRate(), SelectionBarListener::AS_GetSelectionFormat(), SelectionBarListener::AS_GetSnapTo(), mListener, SetRate(), SetSelectionFormat(), and SetSnapTo().

Referenced by ProjectManager::New().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetRate()

void SelectionBar::SetRate ( double  rate)

Definition at line 720 of file SelectionBar.cpp.

721 {
722  if (rate != mRate) {
723  // if the rate is actually being changed
724  mRate = rate; // update the stored rate
725  mRateBox->SetValue(wxString::Format(wxT("%d"), (int)rate));
726 
727  // update the TimeTextCtrls if they exist
729  int i;
730  for(i=0;i<5;i++)
731  if( *Ctrls[i] )
732  (*Ctrls[i])->SetSampleRate( rate );
733  }
734 }

References mAudioTime, mCenterTime, mEndTime, mLengthTime, mRate, mRateBox, and mStartTime.

Referenced by ProjectFileManager::AddImportedTracks(), ProjectSelectionManager::AS_SetRate(), ProjectFileManager::OpenProjectFile(), and SetListener().

Here is the caller graph for this function:

◆ SetSelectionFormat()

void SelectionBar::SetSelectionFormat ( const NumericFormatSymbol format)

Definition at line 707 of file SelectionBar.cpp.

708 {
709  bool changed =
711 
712  // Test first whether changed, to avoid infinite recursion from OnUpdate
713  if ( changed ) {
714  wxCommandEvent e;
715  e.SetString(format.Internal());
716  OnUpdate(e);
717  }
718 }

References format, NumericConverter::GetBuiltinFormat(), mStartTime, OnUpdate(), and NumericTextCtrl::SetFormatString().

Referenced by ProjectSelectionManager::AS_SetSelectionFormat(), and SetListener().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetSelectionMode()

void SelectionBar::SetSelectionMode ( int  mode)
private

Definition at line 630 of file SelectionBar.cpp.

631 {
632  // Only modes 0 to 3 are now supported,
633  // so fix up a mode that could have come from the config.
634  const int maxMode = 3;
635 
636  if( mode > maxMode )
637  mode = 0;
638  if( mode < 0 )
639  mode = 0;
640  mSelectionMode = mode;
641  mChoice->SetSelection( mode );
642 
643  // First decide which two controls drive the others...
644  // For example the last option is with all controls shown, and in that mode we
645  // initially have start and end driving.
646  int Drive2[] = { StartTimeID, StartTimeID, LengthTimeID, LengthTimeID,
648  int Drive1[] = { EndTimeID, LengthTimeID, EndTimeID, CenterTimeID,
650 
651  SetDrivers( Drive1[mode], Drive2[mode] );
652  // Then show/hide the relevant controls.
653  ShowHideControls( mode );
654 }

References CenterTimeID, EndTimeID, LengthTimeID, mChoice, mSelectionMode, SetDrivers(), ShowHideControls(), and StartTimeID.

Referenced by OnChoice(), and Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetSnapTo()

void SelectionBar::SetSnapTo ( int  snap)

Definition at line 702 of file SelectionBar.cpp.

703 {
704  mSnapTo->SetSelection(snap);
705 }

References mSnapTo.

Referenced by ProjectSelectionManager::AS_SetSnapTo(), and SetListener().

Here is the caller graph for this function:

◆ SetTimes()

void SelectionBar::SetTimes ( double  start,
double  end,
double  audio 
)

Definition at line 686 of file SelectionBar.cpp.

687 {
688  if ( start != mStart || end != mEnd || audio != mAudio
690  ) {
691  mStart = start;
692  mEnd = end;
693  mLength = end-start;
694  mCenter = (end+start)/2.0;
695  mAudio = audio;
697 
699  }
700 }

References mAudio, mCenter, mEnd, mLastSelectionMode, mLength, mSelectionMode, mStart, and ValuesToControls().

Referenced by OnIdle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowHideControls()

void SelectionBar::ShowHideControls ( int  mode)
private

Definition at line 657 of file SelectionBar.cpp.

658 {
659  // The bits in these say which controls are visible.
660  int masks[8]= {
661  9, 5, 12, 6, // 2 items shown
662  13, 7, 11,// 3 items shown
663  15};
664  int mask = masks[mode];
665 
667  for(int i=0;i<4;i++){
668  if( *Ctrls[i]){
669  (*Ctrls[i])->Show( (mask & (1<<i))!=0 );
670  (*Ctrls[i])->Refresh();
671  }
672  }
673 }

References mCenterTime, mEndTime, mLengthTime, and mStartTime.

Referenced by SetSelectionMode().

Here is the caller graph for this function:

◆ UpdatePrefs()

void SelectionBar::UpdatePrefs ( )
overridevirtual

Implements PrefsListener.

Definition at line 351 of file SelectionBar.cpp.

352 {
353  // The project rate is no longer driven from here.
354  // When preferences change, the Project learns about it too.
355  // If necessary we can drive the SelectionBar mRate via the Project
356  // calling our SetRate().
357  // As of 13-Sep-2018, changes to the sample rate pref will only affect
358  // creation of new projects, not the sample rate in existing ones.
359 
360  // This will only change the selection mode during a "Reset Configuration"
361  // action since the read value will be the same during a normal preferences
362  // update.
363  mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
364 
365  // This will only change the time format during a "Reset Configuration"
366  // action since the read value will be the same during a normal preferences
367  // update.
368  wxCommandEvent e;
369  e.SetString(NumericTextCtrl::LookupFormat(
371  gPrefs->Read(wxT("/SelectionFormat"), wxT(""))).Internal());
372  OnUpdate(e);
373 
374  // Set label to pull in language change
375  SetLabel(XO("Selection"));
376 
378  // Give base class a chance
380 }

References gPrefs, Internal, NumericConverter::LookupFormat(), mSelectionMode, OnUpdate(), RegenerateTooltips(), ToolBar::SetLabel(), NumericConverter::TIME, ToolBar::UpdatePrefs(), and XO.

Referenced by Create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateRates()

void SelectionBar::UpdateRates ( )
private

Definition at line 759 of file SelectionBar.cpp.

760 {
761  wxString oldValue = mRateBox->GetValue();
762  mRateBox->Clear();
763  for (int i = 0; i < AudioIOBase::NumStandardRates; i++) {
764  mRateBox->Append(
765  wxString::Format(wxT("%d"), AudioIOBase::StandardRates[i]));
766  }
767  mRateBox->SetValue(oldValue);
768 }

References mRateBox, AudioIOBase::NumStandardRates, and AudioIOBase::StandardRates.

Referenced by Populate().

Here is the caller graph for this function:

◆ ValuesToControls()

void SelectionBar::ValuesToControls ( )
private

Definition at line 675 of file SelectionBar.cpp.

676 {
678  double Values[5] = {mStart, mEnd, mLength, mCenter, mAudio };
679  int i;
680  for(i=0;i<5;i++)
681  if( *Ctrls[i] )
682  (*Ctrls[i])->SetValue( Values[i] );
683 }

References mAudio, mAudioTime, mCenter, mCenterTime, mEnd, mEndTime, mLength, mLengthTime, mStart, and mStartTime.

Referenced by ModifySelection(), OnUpdate(), and SetTimes().

Here is the caller graph for this function:

Member Data Documentation

◆ mAudio

double SelectionBar::mAudio
private

Definition at line 95 of file SelectionBar.h.

Referenced by SetTimes(), and ValuesToControls().

◆ mAudioTime

NumericTextCtrl* SelectionBar::mAudioTime
private

Definition at line 109 of file SelectionBar.h.

Referenced by OnRate(), OnUpdate(), Populate(), SetRate(), and ValuesToControls().

◆ mCenter

double SelectionBar::mCenter
private

Definition at line 95 of file SelectionBar.h.

Referenced by ModifySelection(), SetTimes(), and ValuesToControls().

◆ mCenterTime

NumericTextCtrl* SelectionBar::mCenterTime
private

◆ mChoice

wxChoice* SelectionBar::mChoice
private

Definition at line 110 of file SelectionBar.h.

Referenced by OnChoice(), OnUpdate(), Populate(), and SetSelectionMode().

◆ mDrive1

int SelectionBar::mDrive1
private

Definition at line 99 of file SelectionBar.h.

Referenced by ModifySelection(), and SetDrivers().

◆ mDrive2

int SelectionBar::mDrive2
private

Definition at line 100 of file SelectionBar.h.

Referenced by ModifySelection(), and SetDrivers().

◆ mEnd

double SelectionBar::mEnd
private

Definition at line 95 of file SelectionBar.h.

Referenced by ModifySelection(), SetTimes(), and ValuesToControls().

◆ mEndTime

NumericTextCtrl* SelectionBar::mEndTime
private

◆ mLastSelectionMode

int SelectionBar::mLastSelectionMode { 0 }
private

Definition at line 103 of file SelectionBar.h.

Referenced by SetTimes().

◆ mLastValidText

wxString SelectionBar::mLastValidText
private

Definition at line 116 of file SelectionBar.h.

Referenced by OnRate().

◆ mLength

double SelectionBar::mLength
private

Definition at line 95 of file SelectionBar.h.

Referenced by ModifySelection(), SetTimes(), and ValuesToControls().

◆ mLengthTime

NumericTextCtrl* SelectionBar::mLengthTime
private

◆ mListener

SelectionBarListener* SelectionBar::mListener
private

◆ mProxy

wxStaticText* SelectionBar::mProxy
private

Definition at line 111 of file SelectionBar.h.

◆ mRate

double SelectionBar::mRate
private

Definition at line 94 of file SelectionBar.h.

Referenced by AddTime(), OnRate(), Populate(), and SetRate().

◆ mRateBox

wxComboBox* SelectionBar::mRateBox
private

Definition at line 112 of file SelectionBar.h.

Referenced by OnRate(), OnUpdate(), Populate(), SetRate(), and UpdateRates().

◆ mRateText

wxWindow* SelectionBar::mRateText
private

Definition at line 114 of file SelectionBar.h.

Referenced by OnCaptureKey(), OnUpdate(), and Populate().

◆ mSelectionMode

int SelectionBar::mSelectionMode { 0 }
private

◆ mSnapTo

wxChoice* SelectionBar::mSnapTo
private

Definition at line 113 of file SelectionBar.h.

Referenced by OnSnapTo(), OnUpdate(), Populate(), RegenerateTooltips(), and SetSnapTo().

◆ mStart

double SelectionBar::mStart
private

Definition at line 95 of file SelectionBar.h.

Referenced by ModifySelection(), SetTimes(), and ValuesToControls().

◆ mStartTime

NumericTextCtrl* SelectionBar::mStartTime
private

The documentation for this class was generated from the following files:
SelectionBar::Get
static SelectionBar & Get(AudacityProject &project)
Definition: SelectionBar.cpp:137
SelectionBar::mAudioTime
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:109
SelectionBar::mCenter
double mCenter
Definition: SelectionBar.h:95
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:161
StartTimeID
@ StartTimeID
Definition: SelectionBar.cpp:86
SNAP_OFF
@ SNAP_OFF
Definition: ProjectSettings.h:29
SelectionBar::mDrive2
int mDrive2
Definition: SelectionBar.h:100
AudioIOBase::StandardRates
static const int StandardRates[]
Array of common audio sample rates.
Definition: AudioIOBase.h:201
SelectionBar::mListener
SelectionBarListener * mListener
Definition: SelectionBar.h:93
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
SelectionBarListener::AS_ModifySelection
virtual void AS_ModifySelection(double &start, double &end, bool done)=0
SelectionBar::mEnd
double mEnd
Definition: SelectionBar.h:95
ViewInfo::playRegion
PlayRegion playRegion
Definition: ViewInfo.h:197
SelectionBar::mLength
double mLength
Definition: SelectionBar.h:95
NumericTextCtrl::SetFormatString
bool SetFormatString(const FormatStrings &formatString)
Definition: NumericTextCtrl.cpp:1449
ToolBar::mProject
AudacityProject & mProject
Definition: ToolBar.h:235
ToolBar::SetLabel
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:398
SelectionBar::mRate
double mRate
Definition: SelectionBar.h:94
SelectionBarListener::AS_GetSnapTo
virtual int AS_GetSnapTo()=0
SelectionBar::SetRate
void SetRate(double rate)
Definition: SelectionBar.cpp:720
ToolManager::Get
static ToolManager & Get(AudacityProject &project)
Definition: ToolManager.cpp:356
SelectionBar::mDrive1
int mDrive1
Definition: SelectionBar.h:99
PlayRegion::GetStart
double GetStart() const
Definition: ViewInfo.h:134
SelectionBar::AddVLine
void AddVLine(wxSizer *pSizer)
Definition: SelectionBar.cpp:178
SelectionBar::mStartTime
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:105
XO
#define XO(s)
Definition: Internat.h:31
SelectionBar::mStart
double mStart
Definition: SelectionBar.h:95
SelectionBar::mEndTime
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:108
AudioIOBase::NumStandardRates
static const int NumStandardRates
How many standard sample rates there are.
Definition: AudioIOBase.h:203
ToolBar::ReCreateButtons
virtual void ReCreateButtons()
Definition: ToolBar.cpp:516
LengthTimeID
@ LengthTimeID
Definition: SelectionBar.cpp:87
ProjectAudioIO::Get
static ProjectAudioIO & Get(AudacityProject &project)
Definition: ProjectAudioIO.cpp:22
SelectionBar::AddTitle
auStaticText * AddTitle(const TranslatableString &Title, wxSizer *pSizer)
Definition: SelectionBar.cpp:155
SelectionBar::mLastSelectionMode
int mLastSelectionMode
Definition: SelectionBar.h:103
SelectionBar::SetTimes
void SetTimes(double start, double end, double audio)
Definition: SelectionBar.cpp:686
NumericTextCtrl
Definition: NumericTextCtrl.h:172
numbers
static const wxChar * numbers[]
Definition: SelectionBar.cpp:72
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
SelectionBarListener::AS_SetRate
virtual void AS_SetRate(double rate)=0
SelectionBar::OnUpdate
void OnUpdate(wxCommandEvent &evt)
Definition: SelectionBar.cpp:499
SelectionBar::mLengthTime
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:107
EndTimeID
@ EndTimeID
Definition: SelectionBar.cpp:89
SelectionBar::mCenterTime
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:106
SelectionBar::SetDrivers
void SetDrivers(int driver1, int driver2)
Definition: SelectionBar.cpp:549
SelectionBar::SetSelectionMode
void SetSelectionMode(int mode)
Definition: SelectionBar.cpp:630
AudioTimeID
@ AudioTimeID
Definition: SelectionBar.cpp:91
NumericConverter::LookupFormat
static NumericFormatSymbol LookupFormat(Type type, const wxString &id)
Definition: NumericTextCtrl.cpp:702
SelectionBarListener::AS_GetSelectionFormat
virtual const NumericFormatSymbol & AS_GetSelectionFormat()=0
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:196
SelectionBarListener::AS_SetSelectionFormat
virtual void AS_SetSelectionFormat(const NumericFormatSymbol &format)=0
NumericConverter::GetBuiltinFormat
FormatStrings GetBuiltinFormat(const int index)
Definition: NumericTextCtrl.cpp:1207
ToolBar::ToolBar
ToolBar(AudacityProject &project, int type, const TranslatableString &label, const wxString &section, bool resizable=false)
Definition: ToolBar.cpp:330
SelectionBar::mSnapTo
wxChoice * mSnapTo
Definition: SelectionBar.h:113
SelectionBar::mRateText
wxWindow * mRateText
Definition: SelectionBar.h:114
SelectionBar::UpdateRates
void UpdateRates()
Definition: SelectionBar.cpp:759
ToolBar::UpdatePrefs
void UpdatePrefs() override
Definition: ToolBar.cpp:605
SelectionBar::ValuesToControls
void ValuesToControls()
Definition: SelectionBar.cpp:675
NumericConverter::TIME
@ TIME
Definition: NumericTextCtrl.h:52
SelectionBar::SetSelectionFormat
void SetSelectionFormat(const NumericFormatSymbol &format)
Definition: SelectionBar.cpp:707
SelectionBar::mAudio
double mAudio
Definition: SelectionBar.h:95
format
int format
Definition: ExportPCM.cpp:56
QualitySettings::DefaultSampleRate
PROJECT_RATE_API IntSetting DefaultSampleRate
Definition: QualitySettings.cpp:15
WindowAccessible
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
SelectionBar::AddTime
NumericTextCtrl * AddTime(const TranslatableString &Name, int id, wxSizer *pSizer)
Definition: SelectionBar.cpp:167
SelectionBar::mSelectionMode
int mSelectionMode
Definition: SelectionBar.h:102
SelectionBar::OnFocus
void OnFocus(wxFocusEvent &event)
Definition: SelectionBar.cpp:770
ToolBar::Create
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:475
SelectionBar::mChoice
wxChoice * mChoice
Definition: SelectionBar.h:110
SelectionBar::mRateBox
wxComboBox * mRateBox
Definition: SelectionBar.h:112
SelectionBar::ModifySelection
void ModifySelection(int newDriver, bool done=false)
Definition: SelectionBar.cpp:412
SelectionBar::UpdatePrefs
void UpdatePrefs() override
Definition: SelectionBar.cpp:351
SelectionBarID
@ SelectionBarID
Definition: ToolBar.h:82
wxPanelWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:61
SelectionBar
(not quite a Toolbar) at foot of screen for setting and viewing the selection range.
Definition: SelectionBar.h:45
auStaticText
is like wxStaticText, except it can be themed. wxStaticText can't be.
Definition: Theme.h:183
SnapToID
@ SnapToID
Definition: SelectionBar.cpp:81
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
Read
gPrefs Read(wxT("/GUI/VerticalZooming"), &bVZoom, false)
SnapManager::GetSnapLabels
static const TranslatableStrings & GetSnapLabels()
Definition: Snap.cpp:315
_
#define _(s)
Definition: Internat.h:75
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
SelectionBar::mLastValidText
wxString mLastValidText
Definition: SelectionBar.h:116
SelectionBar::RegenerateTooltips
void RegenerateTooltips() override
Definition: SelectionBar.cpp:390
SelectionBarListener::AS_GetRate
virtual double AS_GetRate()=0
SelectionBar::ShowHideControls
void ShowHideControls(int mode)
Definition: SelectionBar.cpp:657
KeyboardCapture::OnFocus
void OnFocus(wxWindow &window, wxFocusEvent &event)
a function useful to implement a focus event handler The window releases the keyboard if the event is...
Definition: KeyboardCapture.cpp:95
ExceptionType::Internal
@ Internal
Indicates internal failure from Audacity.
ThemeBase::Colour
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1197
theTheme
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:203
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
ToolBar::Updated
void Updated()
Definition: ToolBar.cpp:661
ChoiceID
@ ChoiceID
Definition: SelectionBar.cpp:84
AudioIO::Get
static AudioIO * Get()
Definition: AudioIO.cpp:606
safenew
#define safenew
Definition: MemoryX.h:10
RateID
@ RateID
Definition: SelectionBar.cpp:80
toolbarSingle
#define toolbarSingle
Definition: ToolBar.h:59
SelectionBar::SelectionModeUpdated
void SelectionModeUpdated()
Definition: SelectionBar.cpp:613
CenterTimeID
@ CenterTimeID
Definition: SelectionBar.cpp:88
NumericConverter::GetValue
double GetValue()
Definition: NumericTextCtrl.cpp:1172
SelectionBar::SetSnapTo
void SetSnapTo(int)
Definition: SelectionBar.cpp:702
SIZER_COLS
#define SIZER_COLS
Definition: SelectionBar.h:30
ToolBar::Add
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:686
SelectionBarListener::AS_SetSnapTo
virtual void AS_SetSnapTo(int snap)=0