Audacity  2.2.2
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
 
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 42 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  mRate = (double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"),
121 
122  // Selection mode of 0 means showing 'start' and 'end' only.
123  mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
124 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:99
SelectionBarListener * mListener
Definition: SelectionBar.h:86
double mAudio
Definition: SelectionBar.h:88
static int GetOptimalSupportedSampleRate()
Get a supported sample rate which can be used a an optimal default.
Definition: AudioIO.cpp:3189
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:98
double mLength
Definition: SelectionBar.h:88
double mCenter
Definition: SelectionBar.h:88
wxChoice * mChoice
Definition: SelectionBar.h:102
double mStart
Definition: SelectionBar.h:88
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:101
int mSelectionMode
Definition: SelectionBar.h:95
_("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:311
double mRate
Definition: SelectionBar.h:87
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:97
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:100
SelectionBar::~SelectionBar ( )
virtual

Definition at line 126 of file SelectionBar.cpp.

127 {
128 }

Member Function Documentation

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

Definition at line 145 of file SelectionBar.cpp.

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

Referenced by Populate().

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

Definition at line 136 of file SelectionBar.cpp.

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

Referenced by Populate().

136  {
137  auStaticText * pTitle = safenew auStaticText(this, Title );
138  pTitle->SetBackgroundColour( theTheme.Colour( clrMedium ));
139  pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
140  pSizer->Add( pTitle,0, wxALIGN_CENTER_VERTICAL | wxRIGHT, (Title.Length() == 1 ) ? 0:5);
141  return pTitle;
142 }
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 155 of file SelectionBar.cpp.

References safenew, and toolbarSingle.

Referenced by Populate().

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

Reimplemented from ToolBar.

Definition at line 130 of file SelectionBar.cpp.

References ToolBar::Create().

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

Implements ToolBar.

Definition at line 52 of file SelectionBar.h.

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

Definition at line 388 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().

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

Definition at line 707 of file SelectionBar.cpp.

References mRateText.

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

Definition at line 478 of file SelectionBar.cpp.

References ModifySelection().

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

Definition at line 552 of file SelectionBar.cpp.

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

553 {
554  int mode = mChoice->GetSelection();
555  SetSelectionMode( mode );
557 }
void SelectionModeUpdated()
wxChoice * mChoice
Definition: SelectionBar.h:102
void SetSelectionMode(int mode)
void SelectionBar::OnFocus ( wxFocusEvent &  event)
private

Definition at line 694 of file SelectionBar.cpp.

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

Referenced by Populate().

695 {
696  if (event.GetEventType() == wxEVT_KILL_FOCUS) {
698  }
699  else {
701  }
702 
703  Refresh(false);
704  event.Skip();
705 }
static void CaptureKeyboard(wxWindow *handler)
Definition: Project.cpp:5985
static void ReleaseKeyboard(wxWindow *handler)
Definition: Project.cpp:5996
void SelectionBar::OnRate ( wxCommandEvent &  event)
private

Definition at line 670 of file SelectionBar.cpp.

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

671 {
672  if (mRateBox->GetValue().ToDouble(&mRate) && // is a numeric value
673  (mRate != 0.0))
674  {
676  int i;
677  for(i=0;i<5;i++)
678  if( *Ctrls[i] )
679  (*Ctrls[i])->SetSampleRate( mRate );
681  }
682 }
wxComboBox * mRateBox
Definition: SelectionBar.h:104
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:99
SelectionBarListener * mListener
Definition: SelectionBar.h:86
virtual void AS_SetRate(double rate)=0
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:98
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:101
double mRate
Definition: SelectionBar.h:87
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:97
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:100
void SelectionBar::OnSize ( wxSizeEvent &  evt)
private

Definition at line 379 of file SelectionBar.cpp.

380 {
381  Refresh( true );
382 
383  evt.Skip();
384 }
void SelectionBar::OnSnapTo ( wxCommandEvent &  event)
private

Definition at line 739 of file SelectionBar.cpp.

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

740 {
741  mListener->AS_SetSnapTo(mSnapTo->GetSelection());
742 }
virtual void AS_SetSnapTo(int snap)=0
SelectionBarListener * mListener
Definition: SelectionBar.h:86
wxChoice * mSnapTo
Definition: SelectionBar.h:105
void SelectionBar::OnUpdate ( wxCommandEvent &  evt)
private

Definition at line 484 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().

485 {
486  int index = evt.GetInt();
487  wxWindow *w = FindFocus();
489  int i;
490  int iFocus = -1;
491  for(i=0;i<5;i++)
492  if( w == *Ctrls[i] )
493  iFocus = i;
494 
495  evt.Skip(false);
496 
497  // Save format name before recreating the controls so they resize properly
498  {
499  auto format = mStartTime->GetBuiltinName(index);
501  }
502 
504 
505  // ToolBar::ReCreateButtons() will get rid of our sizers and controls
506  // so reset pointers first.
507  for( i=0;i<5;i++)
508  *Ctrls[i]=NULL;
509 
510  mRateBox = NULL;
511  mRateText = NULL;
512 
514 
516 
517  auto format = mStartTime->GetBuiltinFormat(index);
518  for( i=0;i<5;i++)
519  (*Ctrls[i])->SetFormatString( format );
520 
521  if( iFocus >=0 )
522  (*Ctrls[iFocus])->SetFocus();
523  Updated();
524 }
void RegenerateTooltips() override
wxWindow * mRateText
Definition: SelectionBar.h:106
wxComboBox * mRateBox
Definition: SelectionBar.h:104
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:99
SelectionBarListener * mListener
Definition: SelectionBar.h:86
virtual void ReCreateButtons()
Definition: ToolBar.cpp:462
virtual void AS_SetSelectionFormat(const NumericFormatId &format)=0
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:98
int format
Definition: ExportPCM.cpp:56
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:101
wxString GetBuiltinFormat(const int index)
void Updated()
Definition: ToolBar.cpp:595
NumericFormatId GetBuiltinName(const int index)
void ValuesToControls()
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:97
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:100
void SelectionBar::Populate ( )
overridevirtual

Implements ToolBar.

Definition at line 162 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().

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

Implements ToolBar.

Definition at line 366 of file SelectionBar.cpp.

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

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

367 {
368 #if wxUSE_TOOLTIPS
369  auto formatName =
370  mListener
372  : NumericFormatId{};
373  mSnapTo->SetToolTip(
374  wxString::Format(
375  _("Snap Clicks/Selections to %s"), formatName.Translation() ));
376 #endif
377 }
SelectionBarListener * mListener
Definition: SelectionBar.h:86
wxChoice * mSnapTo
Definition: SelectionBar.h:105
virtual const NumericFormatId & AS_GetSelectionFormat()=0
IdentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
_("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 51 of file SelectionBar.h.

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

Definition at line 559 of file SelectionBar.cpp.

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

Referenced by OnChoice().

560 {
561  // We just changed the mode. Remember it.
562  gPrefs->Write(wxT("/SelectionToolbarMode"), mSelectionMode);
563  gPrefs->Flush();
564 
565  wxSize sz = GetMinSize();
566  sz.SetWidth( 10 );
567  SetMinSize( sz );
568  Fit();
569  Layout();
570  Updated();
571 }
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
void Updated()
Definition: ToolBar.cpp:595
int mSelectionMode
Definition: SelectionBar.h:95
void SelectionBar::SetDrivers ( int  driver1,
int  driver2 
)
private

Definition at line 528 of file SelectionBar.cpp.

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

Referenced by ModifySelection(), and SetSelectionMode().

529 {
530  mDrive1 = driver1;
531  mDrive2 = driver2;
532 
534  wxString Text[4] = { _("Start"), _("Center"), _("Length"), _("End") };
535 
536  for(int i=0;i<4;i++){
537  int id = i + StartTimeID;
538  int fixed = (( id == mDrive2 )?mDrive1:mDrive2)-StartTimeID;
539 
540  wxString Temp = Text[i];
541  // i18n-hint: %s is replaced e.g by 'Length', to indicate that it will be calculated from other parameters.
542  wxString Format = ( (id!=mDrive1) && (id!=mDrive2 ) ) ? _("%s - driven") : "%s";
543  wxString Title= wxString::Format( Format, Temp );
544  // i18n-hint: %s1 is replaced e.g by 'Length', %s2 e.g by 'Center'.
545  wxString VoiceOverText = wxString::Format(_("Selection %s. %s won't change."), Temp, Text[fixed]);
546  if( *Ctrls[i] ){
547  (*Ctrls[i])->SetName( Temp );
548  }
549  }
550 }
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:99
Abstract base class used in importing a file.
Definition: Import.h:32
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:98
_("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:97
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:100
void SelectionBar::SetListener ( SelectionBarListener l)

Definition at line 358 of file SelectionBar.cpp.

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

359 {
360  mListener = l;
364 };
void SetRate(double rate)
virtual int AS_GetSnapTo()=0
SelectionBarListener * mListener
Definition: SelectionBar.h:86
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 655 of file SelectionBar.cpp.

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

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

656 {
657  if (rate != mRate) {
658  // if the rate is actually being changed
659  mRate = rate; // update the stored rate
660  mRateBox->SetValue(wxString::Format(wxT("%d"), (int)rate));
661  // update the TimeTextCtrls if they exist
663  int i;
664  for(i=0;i<5;i++)
665  if( *Ctrls[i] )
666  (*Ctrls[i])->SetSampleRate( rate );
667  }
668 }
wxComboBox * mRateBox
Definition: SelectionBar.h:104
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:99
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:98
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:101
double mRate
Definition: SelectionBar.h:87
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:97
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:100
void SelectionBar::SetSelectionFormat ( const NumericFormatId format)

Definition at line 646 of file SelectionBar.cpp.

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

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

647 {
649 
650  wxCommandEvent e;
651  e.SetInt(mStartTime->GetFormatIndex());
652  OnUpdate(e);
653 }
void SetFormatString(const wxString &formatString)
wxString GetBuiltinFormat(const int index)
void OnUpdate(wxCommandEvent &evt)
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:97
void SelectionBar::SetSelectionMode ( int  mode)
private

Definition at line 576 of file SelectionBar.cpp.

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

Referenced by OnChoice(), and Populate().

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

Definition at line 641 of file SelectionBar.cpp.

References mSnapTo.

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

642 {
643  mSnapTo->SetSelection(snap);
644 }
wxChoice * mSnapTo
Definition: SelectionBar.h:105
void SelectionBar::SetTimes ( double  start,
double  end,
double  audio 
)

Definition at line 630 of file SelectionBar.cpp.

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

Referenced by AudacityProject::TP_DisplaySelection().

631 {
632  mStart = start;
633  mEnd = end;
634  mLength = end-start;
635  mCenter = (end+start)/2.0;
636  mAudio = audio;
637 
639 }
double mAudio
Definition: SelectionBar.h:88
double mLength
Definition: SelectionBar.h:88
double mCenter
Definition: SelectionBar.h:88
double mStart
Definition: SelectionBar.h:88
void ValuesToControls()
void SelectionBar::ShowHideControls ( int  mode)
private

Definition at line 603 of file SelectionBar.cpp.

References mCenterTime, mEndTime, mLengthTime, and mStartTime.

Referenced by SetSelectionMode().

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

Reimplemented from ToolBar.

Definition at line 342 of file SelectionBar.cpp.

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

343 {
344  mRate = (double) gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), AudioIO::GetOptimalSupportedSampleRate());
345 
346  wxCommandEvent e;
347  e.SetInt(mStartTime->GetFormatIndex());
348  OnUpdate(e);
349 
350  // Set label to pull in language change
351  SetLabel(_("Selection"));
352 
354  // Give base class a chance
356 }
void RegenerateTooltips() override
AudacityPrefs * gPrefs
Definition: Prefs.cpp:73
virtual void UpdatePrefs()
Definition: ToolBar.cpp:539
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:377
static int GetOptimalSupportedSampleRate()
Get a supported sample rate which can be used a an optimal default.
Definition: AudioIO.cpp:3189
_("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)
double mRate
Definition: SelectionBar.h:87
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:97
void SelectionBar::UpdateRates ( )
private

Definition at line 684 of file SelectionBar.cpp.

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

Referenced by Populate().

685 {
686  wxString oldValue = mRateBox->GetValue();
687  mRateBox->Clear();
688  for (int i = 0; i < AudioIO::NumStandardRates; i++) {
689  mRateBox->Append(wxString::Format(wxT("%d"), AudioIO::StandardRates[i]));
690  }
691  mRateBox->SetValue(oldValue);
692 }
wxComboBox * mRateBox
Definition: SelectionBar.h:104
static const int NumStandardRates
How many standard sample rates there are.
Definition: AudioIO.h:453
static const int StandardRates[]
Array of common audio sample rates.
Definition: AudioIO.h:451
void SelectionBar::ValuesToControls ( )
private

Definition at line 619 of file SelectionBar.cpp.

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

Referenced by OnUpdate(), and SetTimes().

620 {
622  double Values[5] = {mStart, mEnd, mLength, mCenter, mAudio };
623  int i;
624  for(i=0;i<5;i++)
625  if( *Ctrls[i] )
626  (*Ctrls[i])->SetValue( Values[i] );
627 }
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:99
double mAudio
Definition: SelectionBar.h:88
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:98
double mLength
Definition: SelectionBar.h:88
double mCenter
Definition: SelectionBar.h:88
double mStart
Definition: SelectionBar.h:88
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:101
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:97
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:100

Member Data Documentation

double SelectionBar::mAudio
private

Definition at line 88 of file SelectionBar.h.

Referenced by SetTimes(), and ValuesToControls().

NumericTextCtrl* SelectionBar::mAudioTime
private

Definition at line 101 of file SelectionBar.h.

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

double SelectionBar::mCenter
private

Definition at line 88 of file SelectionBar.h.

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

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

Definition at line 102 of file SelectionBar.h.

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

int SelectionBar::mDrive1
private

Definition at line 92 of file SelectionBar.h.

Referenced by ModifySelection(), and SetDrivers().

int SelectionBar::mDrive2
private

Definition at line 93 of file SelectionBar.h.

Referenced by ModifySelection(), and SetDrivers().

double SelectionBar::mEnd
private

Definition at line 88 of file SelectionBar.h.

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

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

Definition at line 88 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 103 of file SelectionBar.h.

double SelectionBar::mRate
private

Definition at line 87 of file SelectionBar.h.

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

wxComboBox* SelectionBar::mRateBox
private

Definition at line 104 of file SelectionBar.h.

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

wxWindow* SelectionBar::mRateText
private

Definition at line 106 of file SelectionBar.h.

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

int SelectionBar::mSelectionMode
private

Definition at line 95 of file SelectionBar.h.

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

wxChoice* SelectionBar::mSnapTo
private

Definition at line 105 of file SelectionBar.h.

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

double SelectionBar::mStart
private

Definition at line 88 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: