Audacity  2.3.1
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:
ToolBar wxPanelWrapper wxTabTraversalWrapper< wxPanel >

Public Member Functions

 SelectionBar ()
 
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 NumericFormatId &format)
 
void SetRate (double rate)
 
void SetListener (SelectionBarListener *l)
 
void RegenerateTooltips () override
 
- Public Member Functions inherited from ToolBar
 ToolBar (int type, const wxString &label, const wxString &section, bool resizable=false)
 
virtual ~ToolBar ()
 
bool AcceptsFocus () const override
 
void SetToDefaultSize ()
 
virtual void ReCreateButtons ()
 
int GetType ()
 
wxString GetTitle ()
 
wxString GetLabel ()
 
wxString GetSection ()
 
ToolDockGetDock ()
 
void SetLabel (const wxString &label) override
 
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 ()
 
- 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 wxString &name=_("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const wxString &name=_("Panel"))
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&...args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

auStaticTextAddTitle (const wxString &Title, wxSizer *pSizer)
 
NumericTextCtrlAddTime (const wxString 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 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
 
NumericTextCtrlmStartTime
 
NumericTextCtrlmCenterTime
 
NumericTextCtrlmLengthTime
 
NumericTextCtrlmEndTime
 
NumericTextCtrlmAudioTime
 
wxChoice * mChoice
 
wxStaticText * mProxy
 
wxComboBox * mRateBox
 
wxChoice * mSnapTo
 
wxWindow * mRateText
 

Additional Inherited Members

- Public Types inherited from ToolBar
using Holder = Destroy_ptr< ToolBar >
 
- 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 (AButton &button, const TranslatedInternalString commands[], size_t nCommands)
 
- Protected Member Functions inherited from ToolBar
void SetButton (bool down, AButton *button)
 
void MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
void MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
void MakeButtonBackgroundsLarge ()
 
void MakeButtonBackgroundsSmall ()
 
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 Attributes inherited from ToolBar
wxString 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 44 of file SelectionBar.h.

Constructor & Destructor Documentation

SelectionBar::SelectionBar ( )

Definition at line 103 of file SelectionBar.cpp.

References AudioIO::GetOptimalSupportedSampleRate(), and gPrefs.

104 : ToolBar(SelectionBarID, _("Selection"), wxT("Selection")),
105  mListener(NULL), mRate(0.0),
106  mStart(0.0), mEnd(0.0), mLength(0.0), mCenter(0.0), mAudio(0.0),
108  mSelectionMode(0),
109  mStartTime(NULL), mCenterTime(NULL), mLengthTime(NULL), mEndTime(NULL),
110  mAudioTime(NULL),
111  mChoice(NULL)
112 {
113  // Make sure we have a valid rate as the NumericTextCtrl()s
114  // created in Populate()
115  // depend on it. Otherwise, division-by-zero floating point exceptions
116  // will occur.
117  // Refer to bug #462 for a scenario where the division-by-zero causes
118  // Audacity to fail.
119  // We expect mRate to be set from the project later.
120  mRate = (double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"),
122 
123  // Selection mode of 0 means showing 'start' and 'end' only.
124  mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
125 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
SelectionBarListener * mListener
Definition: SelectionBar.h:88
double mAudio
Definition: SelectionBar.h:90
static int GetOptimalSupportedSampleRate()
Get a supported sample rate which can be used a an optimal default.
Definition: AudioIO.cpp:3085
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
double mLength
Definition: SelectionBar.h:90
double mCenter
Definition: SelectionBar.h:90
wxChoice * mChoice
Definition: SelectionBar.h:104
double mStart
Definition: SelectionBar.h:90
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:103
int mSelectionMode
Definition: SelectionBar.h:97
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
ToolBar(int type, const wxString &label, const wxString &section, bool resizable=false)
Definition: ToolBar.cpp:315
double mRate
Definition: SelectionBar.h:89
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102
SelectionBar::~SelectionBar ( )
virtual

Definition at line 127 of file SelectionBar.cpp.

128 {
129 }

Member Function Documentation

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

Definition at line 146 of file SelectionBar.cpp.

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

Referenced by Populate().

146  {
147  auto formatName = mListener ? mListener->AS_GetSelectionFormat()
148  : NumericFormatId{};
149  auto pCtrl = safenew NumericTextCtrl(
150  this, id, NumericConverter::TIME, formatName, 0.0, mRate);
151  pCtrl->SetName(Name);
152  pSizer->Add(pCtrl, 0, wxALIGN_TOP | wxRIGHT, 5);
153  return pCtrl;
154 }
SelectionBarListener * mListener
Definition: SelectionBar.h:88
#define safenew
Definition: Audacity.h:230
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
virtual const NumericFormatId & AS_GetSelectionFormat()=0
double mRate
Definition: SelectionBar.h:89
auStaticText * SelectionBar::AddTitle ( const wxString &  Title,
wxSizer *  pSizer 
)
private

Definition at line 137 of file SelectionBar.cpp.

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

Referenced by Populate().

137  {
138  auStaticText * pTitle = safenew auStaticText(this, Title );
139  pTitle->SetBackgroundColour( theTheme.Colour( clrMedium ));
140  pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
141  pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (Title.Length() == 1 ) ? 0:5);
142  return pTitle;
143 }
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
is like wxStaticText, except it can be themed. wxStaticText can't be.
Definition: Theme.h:177
#define safenew
Definition: Audacity.h:230
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
void SelectionBar::AddVLine ( wxSizer *  pSizer)
private

Definition at line 156 of file SelectionBar.cpp.

References safenew, and toolbarSingle.

Referenced by Populate().

156  {
157  pSizer->Add(safenew wxStaticLine(this, -1, wxDefaultPosition,
158  wxSize(1, toolbarSingle-10),
159  wxLI_VERTICAL),
160  0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
161 }
#define toolbarSingle
Definition: ToolBar.h:54
#define safenew
Definition: Audacity.h:230
void SelectionBar::Create ( wxWindow *  parent)
overridevirtual

Reimplemented from ToolBar.

Definition at line 131 of file SelectionBar.cpp.

References ToolBar::Create().

132 {
133  ToolBar::Create(parent);
134 }
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:445
void SelectionBar::EnableDisableButtons ( )
inlineoverridevirtual

Implements ToolBar.

Definition at line 54 of file SelectionBar.h.

54 {};
void SelectionBar::ModifySelection ( int  newDriver,
bool  done = false 
)
private

Definition at line 394 of file SelectionBar.cpp.

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

Referenced by OnChangedTime().

395 {
396  // If the user moved to a different control, then update which
397  // two controls drive the others.
398  if( newDriver != mDrive2 )
399  SetDrivers( mDrive2, newDriver);
400 
401  // Only update a value if user typed something in.
402  // The reason is the controls may be less accurate than
403  // the values.
404  if( newDriver == StartTimeID )
406  if( newDriver == EndTimeID )
407  mEnd = mEndTime->GetValue();
408  if( newDriver == LengthTimeID )
410  if( newDriver == CenterTimeID )
412 
413  // There are four controls, and two constraints, which are:
414  // mid = (start+end)/2
415  // length = (end-start)
416  // Therefore we can select any two controls as 'drivers' of
417  // the other two.
418  // Here we compute 'i' which combines the identity of the two
419  // driving controls, to use it as an index.
420  // The order of the two drivers generally does not matter much,
421  // except that we have want:
422  // start < end
423  // and preserve that by adjusting the least dominant driving
424  // control.
425  int i = mDrive1 + 4 * mDrive2;
426  switch(i){
427  case StartTimeID + 4 * EndTimeID:
428  if( mEnd < mStart )
429  mStart = mEnd;
430  case StartTimeID * 4 + EndTimeID:
431  if( mStart > mEnd )
432  mEnd = mStart;
433  mLength = mEnd - mStart;
434  mCenter = (mStart+mEnd)/2.0;
435  break;
436  case StartTimeID + 4 * LengthTimeID:
437  case StartTimeID * 4 + LengthTimeID:
438  if( mLength < 0 )
439  mLength = 0;
440  mEnd = mStart+mLength;
441  mCenter = (mStart+mEnd)/2.0;
442  break;
443  case StartTimeID + 4 * CenterTimeID:
444  if( mCenter < mStart )
445  mCenter = mStart;
446  case StartTimeID * 4 + CenterTimeID:
447  if( mStart > mCenter )
448  mStart = mCenter;
449  mEnd = mCenter * 2 - mStart;
450  mLength = mStart - mEnd;
451  break;
452  case EndTimeID + 4 * LengthTimeID:
453  case EndTimeID * 4 + LengthTimeID:
454  if( mLength < 0 )
455  mLength = 0;
456  mStart = mEnd - mLength;
457  mCenter = (mStart+mEnd)/2.0;
458  break;
459  case EndTimeID + 4 * CenterTimeID:
460  if( mCenter > mEnd )
461  mCenter = mEnd;
462  case EndTimeID * 4 + CenterTimeID:
463  if( mEnd < mCenter )
464  mEnd = mCenter;
465  mStart = mCenter * 2.0 - mEnd;
466  mLength = mEnd - mStart;
467  break;
468  case LengthTimeID + 4 * CenterTimeID:
469  case LengthTimeID * 4 + CenterTimeID:
470  if( mLength < 0 )
471  mLength = 0;
472  mStart = mCenter - mLength/2.0;
473  mEnd = mCenter + mLength/2.0;
474  break;
475  default:
476  // The above should cover all legal combinations of two distinct controls.
477  wxFAIL_MSG( "Illegal sequence of selection changes");
478  }
479 
480  // Places the start-end mrkers on the track panel.
481  mListener->AS_ModifySelection(mStart, mEnd, done);
482 }
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
SelectionBarListener * mListener
Definition: SelectionBar.h:88
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
double mLength
Definition: SelectionBar.h:90
double mCenter
Definition: SelectionBar.h:90
void SetDrivers(int driver1, int driver2)
double mStart
Definition: SelectionBar.h:90
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
virtual void AS_ModifySelection(double &start, double &end, bool done)=0
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102
void SelectionBar::OnCaptureKey ( wxCommandEvent &  event)
private

Definition at line 714 of file SelectionBar.cpp.

References mRateText.

715 {
716  wxKeyEvent *kevent = (wxKeyEvent *)event.GetEventObject();
717  wxWindow *w = FindFocus();
718  int keyCode = kevent->GetKeyCode();
719 
720  // Convert numeric keypad entries.
721  if ((keyCode >= WXK_NUMPAD0) && (keyCode <= WXK_NUMPAD9)) {
722  keyCode -= WXK_NUMPAD0 - '0';
723  }
724 
725  if (keyCode >= '0' && keyCode <= '9') {
726  return;
727  }
728 
729  // UP/DOWN/LEFT/RIGHT for mRateText
730  if (w == mRateText) {
731  switch (keyCode)
732  {
733  case WXK_LEFT:
734  case WXK_RIGHT:
735  case WXK_UP:
736  case WXK_DOWN:
737  case WXK_DELETE:
738  case WXK_BACK:
739  return;
740  }
741  }
742 
743  event.Skip();
744 }
wxWindow * mRateText
Definition: SelectionBar.h:108
void SelectionBar::OnChangedTime ( wxCommandEvent &  evt)
private

Definition at line 484 of file SelectionBar.cpp.

References ModifySelection().

485 {
486  ModifySelection(event.GetId(), event.GetInt() != 0);
487 }
void ModifySelection(int newDriver, bool done=false)
void SelectionBar::OnChoice ( wxCommandEvent &  event)
private

Definition at line 558 of file SelectionBar.cpp.

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

559 {
560  int mode = mChoice->GetSelection();
561  SetSelectionMode( mode );
563 }
void SelectionModeUpdated()
wxChoice * mChoice
Definition: SelectionBar.h:104
void SetSelectionMode(int mode)
void SelectionBar::OnFocus ( wxFocusEvent &  event)
private

Definition at line 701 of file SelectionBar.cpp.

References AudacityProject::CaptureKeyboard(), and AudacityProject::ReleaseKeyboard().

Referenced by Populate().

702 {
703  if (event.GetEventType() == wxEVT_KILL_FOCUS) {
705  }
706  else {
708  }
709 
710  Refresh(false);
711  event.Skip();
712 }
static void CaptureKeyboard(wxWindow *handler)
Definition: Project.cpp:5350
static void ReleaseKeyboard(wxWindow *handler)
Definition: Project.cpp:5361
void SelectionBar::OnRate ( wxCommandEvent &  event)
private

Definition at line 677 of file SelectionBar.cpp.

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

678 {
679  if (mRateBox->GetValue().ToDouble(&mRate) && // is a numeric value
680  (mRate != 0.0))
681  {
683  int i;
684  for(i=0;i<5;i++)
685  if( *Ctrls[i] )
686  (*Ctrls[i])->SetSampleRate( mRate );
688  }
689 }
wxComboBox * mRateBox
Definition: SelectionBar.h:106
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
SelectionBarListener * mListener
Definition: SelectionBar.h:88
virtual void AS_SetRate(double rate)=0
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:103
double mRate
Definition: SelectionBar.h:89
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102
void SelectionBar::OnSize ( wxSizeEvent &  evt)
private

Definition at line 385 of file SelectionBar.cpp.

386 {
387  Refresh( true );
388 
389  evt.Skip();
390 }
void SelectionBar::OnSnapTo ( wxCommandEvent &  event)
private

Definition at line 746 of file SelectionBar.cpp.

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

747 {
748  mListener->AS_SetSnapTo(mSnapTo->GetSelection());
749 }
virtual void AS_SetSnapTo(int snap)=0
SelectionBarListener * mListener
Definition: SelectionBar.h:88
wxChoice * mSnapTo
Definition: SelectionBar.h:107
void SelectionBar::OnUpdate ( wxCommandEvent &  evt)
private

Definition at line 490 of file SelectionBar.cpp.

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

Referenced by SetSelectionFormat(), and UpdatePrefs().

491 {
492  int index = evt.GetInt();
493  wxWindow *w = FindFocus();
495  int i;
496  int iFocus = -1;
497  for(i=0;i<5;i++)
498  if( w == *Ctrls[i] )
499  iFocus = i;
500 
501  evt.Skip(false);
502 
503  // Save format name before recreating the controls so they resize properly
504  {
505  auto format = mStartTime->GetBuiltinName(index);
507  }
508 
510 
511  // ToolBar::ReCreateButtons() will get rid of our sizers and controls
512  // so reset pointers first.
513  for( i=0;i<5;i++)
514  *Ctrls[i]=NULL;
515 
516  mRateBox = NULL;
517  mRateText = NULL;
518 
520 
522 
523  auto format = mStartTime->GetBuiltinFormat(index);
524  for( i=0;i<5;i++)
525  (*Ctrls[i])->SetFormatString( format );
526 
527  if( iFocus >=0 )
528  (*Ctrls[iFocus])->SetFocus();
529  Updated();
530 }
void RegenerateTooltips() override
wxWindow * mRateText
Definition: SelectionBar.h:108
wxComboBox * mRateBox
Definition: SelectionBar.h:106
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
SelectionBarListener * mListener
Definition: SelectionBar.h:88
virtual void ReCreateButtons()
Definition: ToolBar.cpp:473
virtual void AS_SetSelectionFormat(const NumericFormatId &format)=0
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
int format
Definition: ExportPCM.cpp:56
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:103
wxString GetBuiltinFormat(const int index)
void Updated()
Definition: ToolBar.cpp:612
NumericFormatId GetBuiltinName(const int index)
void ValuesToControls()
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102
void SelectionBar::Populate ( )
overridevirtual

Implements ToolBar.

Definition at line 163 of file SelectionBar.cpp.

References _(), ToolBar::Add(), AddTime(), AddTitle(), AddVLine(), SelectionBarListener::AS_GetSnapTo(), AudioTimeID, CenterTimeID, ChoiceID, ThemeBase::Colour(), EndTimeID, ToolBar::GetSizer(), 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, and UpdateRates().

164 {
165  SetBackgroundColour( theTheme.Colour( clrMedium ) );
166 
168 
169  // This will be inherited by all children:
170  SetFont(wxFont(
171 #ifdef __WXMAC__
172  12
173 #else
174  9
175 #endif
176  ,
177  wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
178 
179  wxFlexGridSizer *mainSizer;
180 
181  /* we don't actually need a control yet, but we want to use its methods
182  * to do some look-ups, so we'll have to create one. We can't make the
183  * look-ups static because they depend on translations which are done at
184  * runtime */
185 
186  // Outer sizer has space top and left.
187  // Inner sizers have space on right only.
188  // This choice makes for a nice border and internal spacing and places clear responsibility
189  // on each sizer as to what spacings it creates.
190  Add((mainSizer = safenew wxFlexGridSizer(SIZER_COLS, 1, 1)), 0, wxALIGN_TOP | wxLEFT | wxTOP, 5);
191 
192  // Top row (mostly labels)
193  wxColour clrText = theTheme.Colour( clrTrackPanelText );
194  wxColour clrText2 = *wxBLUE;
195  AddTitle( _("Project Rate (Hz)"), mainSizer );
196  AddVLine( mainSizer );
197  AddTitle( _("Snap-To"), mainSizer );
198  AddVLine( mainSizer );
199  AddTitle( _("Audio Position"), mainSizer );
200  AddVLine( mainSizer );
201 
202  {
203  const wxString choices[4] = {
204  _("Start and End of Selection"),
205  _("Start and Length of Selection"),
206  _("Length and End of Selection"),
207  _("Length and Center of Selection"),
208  };
209  mChoice = safenew wxChoice
210  (this, ChoiceID, wxDefaultPosition, wxDefaultSize, 4, choices,
211  0, wxDefaultValidator, _("Show"));
212  mChoice->SetSelection(0);
213 #if wxUSE_ACCESSIBILITY
214  // so that name can be set on a standard control
215  mChoice->SetAccessible(safenew WindowAccessible(mChoice));
216 #endif
217 #ifdef __WXGTK__
218  // Combo boxes are taller on Linux, and if we don't do the following, the selection toolbar will
219  // be three units high.
220  wxSize sz = mChoice->GetBestSize();
221  sz.SetHeight( sz.y-4);
222  mChoice->SetMinSize( sz );
223 #endif
224  mainSizer->Add(mChoice, 0, wxALIGN_TOP | wxEXPAND | wxRIGHT, 6);
225  }
226 
227  // Botton row, (mostly time controls)
228  mRateBox = safenew wxComboBox(this, RateID,
229  wxT(""),
230  wxDefaultPosition, wxSize(80, -1));
231 #if wxUSE_ACCESSIBILITY
232  // so that name can be set on a standard control
233  mRateBox->SetAccessible(safenew WindowAccessible(mRateBox));
234 #endif
235  mRateBox->SetName(_("Project Rate (Hz)"));
236  //mRateBox->SetForegroundColour( clrText2 );
237  wxTextValidator vld(wxFILTER_INCLUDE_CHAR_LIST);
238  vld.SetIncludes(wxArrayString(10, numbers));
239  mRateBox->SetValidator(vld);
240  mRateBox->SetValue(wxString::Format(wxT("%d"), (int)mRate));
241  UpdateRates(); // Must be done _after_ setting value on mRateBox!
242 
243  // We need to capture the SetFocus and KillFocus events to set up
244  // for keyboard capture. On Windows and GTK it's easy since the
245  // combobox is presented as one control to hook into.
247 
248 #if defined(__WXMAC__)
249  // The Mac uses a standard wxTextCtrl for the edit portion and that's
250  // the control that gets the focus events. So we have to find the
251  // textctrl.
252  wxWindowList kids = mRateBox->GetChildren();
253  for (unsigned int i = 0; i < kids.GetCount(); i++) {
254  wxClassInfo *ci = kids[i]->GetClassInfo();
255  if (ci->IsKindOf(CLASSINFO(wxTextCtrl))) {
256  mRateText = kids[i];
257  break;
258  }
259  }
260 #endif
261 
262  mRateText->Bind(wxEVT_SET_FOCUS,
264  this);
265  mRateText->Bind(wxEVT_KILL_FOCUS,
267  this);
268 
269 #ifdef __WXGTK__
270  // Combo boxes are taller on Linux, and if we don't do the following, the selection toolbar will
271  // be three units high.
272  wxSize sz = mRateBox->GetBestSize();
273  sz.SetHeight( sz.y-4);
274  mRateBox->SetMinSize( sz );
275 #endif
276 
277  mainSizer->Add(mRateBox, 0, wxALIGN_TOP | wxRIGHT, 5);
278  AddVLine( mainSizer );
279 
280  mSnapTo = safenew wxChoice(this, SnapToID,
281  wxDefaultPosition, wxDefaultSize,
283 
284 #ifdef __WXGTK__
285  // Combo boxes are taller on Linux, and if we don't do the following, the selection toolbar will
286  // be three units high.
287  sz = mSnapTo->GetBestSize();
288  sz.SetHeight( sz.y-4);
289  mSnapTo->SetMinSize( sz );
290 #endif
291 
292  mainSizer->Add(mSnapTo,
293  0, wxALIGN_TOP | wxRIGHT, 5);
294 #if wxUSE_ACCESSIBILITY
295  // so that name can be set on a standard control
296  mSnapTo->SetAccessible(safenew WindowAccessible(mSnapTo));
297 #endif
298  mSnapTo->SetName(_("Snap To"));
299  //mSnapTo->SetForegroundColour( clrText2 );
300  mSnapTo->SetSelection(mListener ? mListener->AS_GetSnapTo() : SNAP_OFF);
301 
302  mSnapTo->Bind(wxEVT_SET_FOCUS,
304  this);
305  mSnapTo->Bind(wxEVT_KILL_FOCUS,
307  this);
308 
309  AddVLine( mainSizer );
310 
311  mAudioTime = AddTime(_("Audio Position"), AudioTimeID, mainSizer );
312  // This vertical line is NOT just for decoration!
313  // It works around a wxWidgets-on-Windows RadioButton bug, where tabbing
314  // into the radiobutton group jumps to selecting the first item in the
315  // group even if some other item had been selected.
316  // It is an important bug to work around for sceen reader users, who use TAB
317  // a lot in navigation.
318  // More about the bug here:
319  // https://forums.wxwidgets.org/viewtopic.php?t=41120
320  AddVLine( mainSizer );
321 
322  {
323  auto hSizer = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
324 
325  mStartTime = AddTime(_("Start"), StartTimeID, hSizer.get() );
326  mLengthTime = AddTime(_("Length"), LengthTimeID, hSizer.get() );
327  mCenterTime = AddTime(_("Center"), CenterTimeID, hSizer.get() );
328  mEndTime = AddTime(_("End"), EndTimeID, hSizer.get() );
329  mainSizer->Add(hSizer.release(), 0, wxALIGN_TOP | wxRIGHT, 0);
330  }
331 
332  mChoice->MoveBeforeInTabOrder( mStartTime );
333  // This shows/hides controls.
334  // Do this before layout so that we are sized right.
336  mainSizer->Layout();
338  Layout();
339 
340  SetMinSize( GetSizer()->GetMinSize() );
341 }
Definition: Snap.h:54
static const wxChar * numbers[]
void RegenerateTooltips() override
NumericTextCtrl * AddTime(const wxString Name, int id, wxSizer *pSizer)
wxWindow * mRateText
Definition: SelectionBar.h:108
AUDACITY_DLL_API Theme theTheme
Definition: Theme.cpp:209
wxComboBox * mRateBox
Definition: SelectionBar.h:106
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
wxBoxSizer * GetSizer()
Definition: ToolBar.cpp:623
virtual int AS_GetSnapTo()=0
SelectionBarListener * mListener
Definition: SelectionBar.h:88
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
#define safenew
Definition: Audacity.h:230
An alternative to using wxWindowAccessible, which in wxWidgets 3.1.1 contained GetParent() which was ...
void UpdateRates()
void OnFocus(wxFocusEvent &event)
wxChoice * mSnapTo
Definition: SelectionBar.h:107
wxChoice * mChoice
Definition: SelectionBar.h:104
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:631
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:103
int mSelectionMode
Definition: SelectionBar.h:97
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
static wxArrayString GetSnapLabels()
Definition: Snap.cpp:356
#define SIZER_COLS
Definition: SelectionBar.h:27
wxColour & Colour(int iIndex)
Definition: Theme.cpp:1225
void AddVLine(wxSizer *pSizer)
void SetSelectionMode(int mode)
double mRate
Definition: SelectionBar.h:89
auStaticText * AddTitle(const wxString &Title, wxSizer *pSizer)
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102
void SelectionBar::RegenerateTooltips ( )
overridevirtual

Implements ToolBar.

Definition at line 372 of file SelectionBar.cpp.

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

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

373 {
374 #if wxUSE_TOOLTIPS
375  auto formatName =
376  mListener
378  : NumericFormatId{};
379  mSnapTo->SetToolTip(
380  wxString::Format(
381  _("Snap Clicks/Selections to %s"), formatName.Translation() ));
382 #endif
383 }
SelectionBarListener * mListener
Definition: SelectionBar.h:88
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
wxChoice * mSnapTo
Definition: SelectionBar.h:107
virtual const NumericFormatId & AS_GetSelectionFormat()=0
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
void SelectionBar::Repaint ( wxDC *  WXUNUSEDdc)
inlineoverride

Definition at line 53 of file SelectionBar.h.

53 {};
void SelectionBar::SelectionModeUpdated ( )
private

Definition at line 565 of file SelectionBar.cpp.

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

Referenced by OnChoice().

566 {
567  // We just changed the mode. Remember it.
568  gPrefs->Write(wxT("/SelectionToolbarMode"), mSelectionMode);
569  gPrefs->Flush();
570 
571  wxSize sz = GetMinSize();
572  sz.SetWidth( 10 );
573  SetMinSize( sz );
574  Fit();
575  Layout();
576  Updated();
577 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
void Updated()
Definition: ToolBar.cpp:612
int mSelectionMode
Definition: SelectionBar.h:97
void SelectionBar::SetDrivers ( int  driver1,
int  driver2 
)
private

Definition at line 534 of file SelectionBar.cpp.

References _(), mCenterTime, mDrive1, mDrive2, mEndTime, mLengthTime, mStartTime, and StartTimeID.

Referenced by ModifySelection(), and SetSelectionMode().

535 {
536  mDrive1 = driver1;
537  mDrive2 = driver2;
538 
540  wxString Text[4] = { _("Start"), _("Center"), _("Length"), _("End") };
541 
542  for(int i=0;i<4;i++){
543  int id = i + StartTimeID;
544  int fixed = (( id == mDrive2 )?mDrive1:mDrive2)-StartTimeID;
545 
546  wxString Temp = Text[i];
547  // i18n-hint: %s is replaced e.g by 'Length', to indicate that it will be calculated from other parameters.
548  wxString Format = ( (id!=mDrive1) && (id!=mDrive2 ) ) ? _("%s - driven") : "%s";
549  wxString Title= wxString::Format( Format, Temp );
550  // i18n-hint: %s1 is replaced e.g by 'Length', %s2 e.g by 'Center'.
551  wxString VoiceOverText = wxString::Format(_("Selection %s. %s won't change."), Temp, Text[fixed]);
552  if( *Ctrls[i] ){
553  (*Ctrls[i])->SetName( Temp );
554  }
555  }
556 }
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
Abstract base class used in importing a file.
Definition: Import.h:32
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102
void SelectionBar::SetListener ( SelectionBarListener l)

Definition at line 364 of file SelectionBar.cpp.

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

365 {
366  mListener = l;
370 };
void SetRate(double rate)
virtual int AS_GetSnapTo()=0
SelectionBarListener * mListener
Definition: SelectionBar.h:88
void SetSelectionFormat(const NumericFormatId &format)
void SetSnapTo(int)
virtual const NumericFormatId & AS_GetSelectionFormat()=0
virtual double AS_GetRate()=0
void SelectionBar::SetRate ( double  rate)

Definition at line 661 of file SelectionBar.cpp.

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

Referenced by AudacityProject::AddImportedTracks(), SetProjectCommand::Apply(), AudacityProject::HandleXMLTag(), and SetListener().

662 {
663  if (rate != mRate) {
664  // if the rate is actually being changed
665  mRate = rate; // update the stored rate
666  mRateBox->SetValue(wxString::Format(wxT("%d"), (int)rate));
667 
668  // update the TimeTextCtrls if they exist
670  int i;
671  for(i=0;i<5;i++)
672  if( *Ctrls[i] )
673  (*Ctrls[i])->SetSampleRate( rate );
674  }
675 }
wxComboBox * mRateBox
Definition: SelectionBar.h:106
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:103
double mRate
Definition: SelectionBar.h:89
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102
void SelectionBar::SetSelectionFormat ( const NumericFormatId format)

Definition at line 652 of file SelectionBar.cpp.

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

Referenced by SetListener(), and AudacityProject::SetSelectionFormat().

653 {
655 
656  wxCommandEvent e;
657  e.SetInt(mStartTime->GetFormatIndex());
658  OnUpdate(e);
659 }
void SetFormatString(const wxString &formatString)
wxString GetBuiltinFormat(const int index)
void OnUpdate(wxCommandEvent &evt)
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
void SelectionBar::SetSelectionMode ( int  mode)
private

Definition at line 582 of file SelectionBar.cpp.

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

Referenced by OnChoice(), and Populate().

583 {
584  // Only modes 0 to 3 are now supported,
585  // so fix up a mode that could have come from the config.
586  const int maxMode = 3;
587 
588  if( mode > maxMode )
589  mode = 0;
590  if( mode < 0 )
591  mode = 0;
592  mSelectionMode = mode;
593  mChoice->SetSelection( mode );
594 
595  // First decide which two controls drive the others...
596  // For example the last option is with all controls shown, and in that mode we
597  // initially have start and end driving.
598  int Drive2[] = { StartTimeID, StartTimeID, LengthTimeID, LengthTimeID,
599  StartTimeID, StartTimeID, StartTimeID, StartTimeID};
600  int Drive1[] = { EndTimeID, LengthTimeID, EndTimeID, CenterTimeID,
601  EndTimeID, LengthTimeID, EndTimeID, EndTimeID};
602 
603  SetDrivers( Drive1[mode], Drive2[mode] );
604  // Then show/hide the relevant controls.
605  ShowHideControls( mode );
606 }
void SetDrivers(int driver1, int driver2)
wxChoice * mChoice
Definition: SelectionBar.h:104
void ShowHideControls(int mode)
int mSelectionMode
Definition: SelectionBar.h:97
void SelectionBar::SetSnapTo ( int  snap)

Definition at line 647 of file SelectionBar.cpp.

References mSnapTo.

Referenced by SetListener(), and AudacityProject::SetSnapTo().

648 {
649  mSnapTo->SetSelection(snap);
650 }
wxChoice * mSnapTo
Definition: SelectionBar.h:107
void SelectionBar::SetTimes ( double  start,
double  end,
double  audio 
)

Definition at line 636 of file SelectionBar.cpp.

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

Referenced by AudacityProject::TP_DisplaySelection().

637 {
638  mStart = start;
639  mEnd = end;
640  mLength = end-start;
641  mCenter = (end+start)/2.0;
642  mAudio = audio;
643 
645 }
double mAudio
Definition: SelectionBar.h:90
double mLength
Definition: SelectionBar.h:90
double mCenter
Definition: SelectionBar.h:90
double mStart
Definition: SelectionBar.h:90
void ValuesToControls()
void SelectionBar::ShowHideControls ( int  mode)
private

Definition at line 609 of file SelectionBar.cpp.

References mCenterTime, mEndTime, mLengthTime, and mStartTime.

Referenced by SetSelectionMode().

610 {
611  // The bits in these say which controls are visible.
612  int masks[8]= {
613  9, 5, 12, 6, // 2 items shown
614  13, 7, 11,// 3 items shown
615  15};
616  int mask = masks[mode];
617 
619  for(int i=0;i<4;i++){
620  if( *Ctrls[i])
621  (*Ctrls[i])->Show( (mask & (1<<i))!=0 );
622  }
623 }
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102
void SelectionBar::UpdatePrefs ( )
overridevirtual

Reimplemented from ToolBar.

Definition at line 343 of file SelectionBar.cpp.

References _(), NumericConverter::GetFormatIndex(), mStartTime, OnUpdate(), RegenerateTooltips(), ToolBar::SetLabel(), and ToolBar::UpdatePrefs().

344 {
345  // The project rate is no longer driven from here.
346  // When preferences change, the Project learns about it too.
347  // If necessary we can drive the SelectionBar mRate via the Project
348  // calling our SetRate().
349  // As of 13-Sep-2018, changes to the sample rate pref will only affect
350  // creation of new projects, not the smaple rate in existing ones.
351 
352  wxCommandEvent e;
353  e.SetInt(mStartTime->GetFormatIndex());
354  OnUpdate(e);
355 
356  // Set label to pull in language change
357  SetLabel(_("Selection"));
358 
360  // Give base class a chance
362 }
void RegenerateTooltips() override
virtual void UpdatePrefs()
Definition: ToolBar.cpp:556
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:381
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
void OnUpdate(wxCommandEvent &evt)
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
void SelectionBar::UpdateRates ( )
private

Definition at line 691 of file SelectionBar.cpp.

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

Referenced by Populate().

692 {
693  wxString oldValue = mRateBox->GetValue();
694  mRateBox->Clear();
695  for (int i = 0; i < AudioIO::NumStandardRates; i++) {
696  mRateBox->Append(wxString::Format(wxT("%d"), AudioIO::StandardRates[i]));
697  }
698  mRateBox->SetValue(oldValue);
699 }
wxComboBox * mRateBox
Definition: SelectionBar.h:106
static const int NumStandardRates
How many standard sample rates there are.
Definition: AudioIO.h:1039
static const int StandardRates[]
Array of common audio sample rates.
Definition: AudioIO.h:1037
void SelectionBar::ValuesToControls ( )
private

Definition at line 625 of file SelectionBar.cpp.

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

Referenced by OnUpdate(), and SetTimes().

626 {
628  double Values[5] = {mStart, mEnd, mLength, mCenter, mAudio };
629  int i;
630  for(i=0;i<5;i++)
631  if( *Ctrls[i] )
632  (*Ctrls[i])->SetValue( Values[i] );
633 }
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:101
double mAudio
Definition: SelectionBar.h:90
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:100
double mLength
Definition: SelectionBar.h:90
double mCenter
Definition: SelectionBar.h:90
double mStart
Definition: SelectionBar.h:90
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:103
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:99
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:102

Member Data Documentation

double SelectionBar::mAudio
private

Definition at line 90 of file SelectionBar.h.

Referenced by SetTimes(), and ValuesToControls().

NumericTextCtrl* SelectionBar::mAudioTime
private

Definition at line 103 of file SelectionBar.h.

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

double SelectionBar::mCenter
private

Definition at line 90 of file SelectionBar.h.

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

NumericTextCtrl* SelectionBar::mCenterTime
private
wxChoice* SelectionBar::mChoice
private

Definition at line 104 of file SelectionBar.h.

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

int SelectionBar::mDrive1
private

Definition at line 94 of file SelectionBar.h.

Referenced by ModifySelection(), and SetDrivers().

int SelectionBar::mDrive2
private

Definition at line 95 of file SelectionBar.h.

Referenced by ModifySelection(), and SetDrivers().

double SelectionBar::mEnd
private

Definition at line 90 of file SelectionBar.h.

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

NumericTextCtrl* SelectionBar::mEndTime
private
double SelectionBar::mLength
private

Definition at line 90 of file SelectionBar.h.

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

NumericTextCtrl* SelectionBar::mLengthTime
private
SelectionBarListener* SelectionBar::mListener
private
wxStaticText* SelectionBar::mProxy
private

Definition at line 105 of file SelectionBar.h.

double SelectionBar::mRate
private

Definition at line 89 of file SelectionBar.h.

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

wxComboBox* SelectionBar::mRateBox
private

Definition at line 106 of file SelectionBar.h.

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

wxWindow* SelectionBar::mRateText
private

Definition at line 108 of file SelectionBar.h.

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

int SelectionBar::mSelectionMode
private

Definition at line 97 of file SelectionBar.h.

Referenced by Populate(), SelectionModeUpdated(), and SetSelectionMode().

wxChoice* SelectionBar::mSnapTo
private

Definition at line 107 of file SelectionBar.h.

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

double SelectionBar::mStart
private

Definition at line 90 of file SelectionBar.h.

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

NumericTextCtrl* SelectionBar::mStartTime
private

The documentation for this class was generated from the following files: