Audacity 3.2.0
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 ()
 
bool ShownByDefault () const override
 Whether the toolbar should be shown by default. Default implementation returns true. More...
 
DockID DefaultDockID () const override
 Which dock the toolbar defaults into. Default implementation chooses the top dock. More...
 
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, const TranslatableString &label, const Identifier &section, bool resizable=false)
 
virtual ~ToolBar ()
 
virtual bool ShownByDefault () const
 Whether the toolbar should be shown by default. Default implementation returns true. More...
 
virtual bool HideAfterReset () const
 Default implementation returns false. More...
 
virtual DockID DefaultDockID () const
 Which dock the toolbar defaults into. Default implementation chooses the top dock. More...
 
bool AcceptsFocus () const override
 
bool AcceptsFocusFromKeyboard () const override
 
virtual void SetToDefaultSize ()
 
virtual void Create (wxWindow *parent)
 
virtual void EnableDisableButtons ()=0
 
virtual void ReCreateButtons ()
 
void UpdatePrefs () override
 
virtual void RegenerateTooltips ()=0
 
int GetIndex () const
 Get a value used for computing cascading positions of undocked bars. More...
 
void SetIndex (int index)
 Set a value used for computing cascading positions of undocked bars. More...
 
TranslatableString GetTitle ()
 
TranslatableString GetLabel ()
 
Identifier GetSection ()
 
ToolDockGetDock ()
 
void SetPreferredNeighbors (Identifier left, Identifier top={})
 
void SetLabel (const TranslatableString &label)
 
virtual void SetDocked (ToolDock *dock, bool pushed)
 
std::pair< Identifier, IdentifierPreferredNeighbors () const noexcept
 Defaults to (NoBarID, NoBarId) More...
 
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 Identifier ID ()
 
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 AButtonMakeButton (ToolBar *parent, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const TranslatableString &label)
 
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
enum  DockID { TopDockID = 1 , BotDockID = 2 }
 Identifies one of the docking areas for toolbars. More...
 
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 Populate ()=0
 
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 ()
 
virtual void UpdatePrefs ()=0
 
- Static Protected Member Functions inherited from ToolBar
static void MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
static void MakeMacRecoloredImageSize (teBmps eBmpOut, teBmps eBmpIn, const wxSize &size)
 
static void MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
 
static void MakeRecoloredImageSize (teBmps eBmpOut, teBmps eBmpIn, const wxSize &size)
 
- 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
 
Identifier mSection
 
int mIndex {0}
 

Detailed Description

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

Definition at line 46 of file SelectionBar.h.

Constructor & Destructor Documentation

◆ SelectionBar()

SelectionBar::SelectionBar ( AudacityProject project)

Definition at line 113 of file SelectionBar.cpp.

114: ToolBar(project, XO("Selection"), ID()),
115 mListener(NULL), mRate(0.0),
116 mStart(0.0), mEnd(0.0), mLength(0.0), mCenter(0.0), mAudio(0.0),
119 mStartTime(NULL), mCenterTime(NULL), mLengthTime(NULL), mEndTime(NULL),
120 mAudioTime(NULL),
121 mChoice(NULL)
122{
123 // Make sure we have a valid rate as the NumericTextCtrl()s
124 // created in Populate()
125 // depend on it. Otherwise, division-by-zero floating point exceptions
126 // will occur.
127 // Refer to bug #462 for a scenario where the division-by-zero causes
128 // Audacity to fail.
129 // We expect mRate to be set from the project later.
131
132 // Selection mode of 0 means showing 'start' and 'end' only.
133 mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
134}
wxT("CloseDown"))
XO("Cut/Copy/Paste")
gPrefs Read(wxT("/GUI/VerticalZooming"), &bVZoom, false)
FileConfig * gPrefs
Definition: Prefs.cpp:70
@ EndTimeID
@ StartTimeID
NumericTextCtrl * mStartTime
Definition: SelectionBar.h:111
double mLength
Definition: SelectionBar.h:101
static Identifier ID()
NumericTextCtrl * mAudioTime
Definition: SelectionBar.h:115
NumericTextCtrl * mLengthTime
Definition: SelectionBar.h:113
NumericTextCtrl * mEndTime
Definition: SelectionBar.h:114
wxChoice * mChoice
Definition: SelectionBar.h:116
double mCenter
Definition: SelectionBar.h:101
NumericTextCtrl * mCenterTime
Definition: SelectionBar.h:112
SelectionBarListener * mListener
Definition: SelectionBar.h:99
ToolBar(AudacityProject &project, const TranslatableString &label, const Identifier &section, bool resizable=false)
Definition: ToolBar.cpp:328
PROJECT_RATE_API IntSetting DefaultSampleRate

References QualitySettings::DefaultSampleRate, gPrefs, mRate, mSelectionMode, Read(), and wxT().

Here is the call graph for this function:

◆ ~SelectionBar()

SelectionBar::~SelectionBar ( )
virtual

Definition at line 136 of file SelectionBar.cpp.

137{
138}

Member Function Documentation

◆ AddTime()

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

Definition at line 186 of file SelectionBar.cpp.

187 {
188 auto formatName = mListener ? mListener->AS_GetSelectionFormat()
190 auto pCtrl = safenew NumericTextCtrl(
191 this, id, NumericConverter::TIME, formatName, 0.0, mRate);
192 pCtrl->SetName( Name );
193 pSizer->Add(pCtrl, 0, wxALIGN_TOP | wxRIGHT, 5);
194 return pCtrl;
195}
#define safenew
Definition: MemoryX.h:10
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
virtual const NumericFormatSymbol & AS_GetSelectionFormat()=0

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 174 of file SelectionBar.cpp.

175 {
176 const auto translated = Title.Translation();
177 auStaticText * pTitle = safenew auStaticText(this, translated );
178 pTitle->SetBackgroundColour( theTheme.Colour( clrMedium ));
179 pTitle->SetForegroundColour( theTheme.Colour( clrTrackPanelText ) );
180 pSizer->Add( pTitle, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxRIGHT, 5 );
181
182 return pTitle;
183}
THEME_API Theme theTheme
Definition: Theme.cpp:82
wxColour & Colour(int iIndex)
wxString Translation() const
is like wxStaticText, except it can be themed. wxStaticText can't be.
Definition: auStaticText.h:20

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 197 of file SelectionBar.cpp.

197 {
198 pSizer->Add(safenew wxStaticLine(this, -1, wxDefaultPosition,
199 wxSize(1, toolbarSingle-10),
200 wxLI_VERTICAL),
201 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
202}
#define toolbarSingle
Definition: ToolBar.h:59

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 167 of file SelectionBar.cpp.

168{
169 ToolBar::Create(parent);
170 UpdatePrefs();
171}
void UpdatePrefs() override
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:492

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

Here is the call graph for this function:

◆ DefaultDockID()

ToolBar::DockID SelectionBar::DefaultDockID ( ) const
overridevirtual

Which dock the toolbar defaults into. Default implementation chooses the top dock.

Reimplemented from ToolBar.

Definition at line 151 of file SelectionBar.cpp.

152{
153 return BotDockID;
154}
@ BotDockID
Definition: ToolBar.h:94

References ToolBar::BotDockID.

◆ EnableDisableButtons()

void SelectionBar::EnableDisableButtons ( )
inlineoverridevirtual

Implements ToolBar.

Definition at line 64 of file SelectionBar.h.

64{};

◆ Get() [1/2]

SelectionBar & SelectionBar::Get ( AudacityProject project)
static

Definition at line 156 of file SelectionBar.cpp.

157{
158 auto &toolManager = ToolManager::Get( project );
159 return *static_cast<SelectionBar*>(toolManager.GetToolBar(ID()));
160}
(not quite a Toolbar) at foot of screen for setting and viewing the selection range.
Definition: SelectionBar.h:46
static ToolManager & Get(AudacityProject &project)

References ToolManager::Get(), and ID().

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 162 of file SelectionBar.cpp.

163{
164 return Get( const_cast<AudacityProject&>( project )) ;
165}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static SelectionBar & Get(AudacityProject &project)

References Get().

Here is the call graph for this function:

◆ ID()

Identifier SelectionBar::ID ( )
static

Definition at line 108 of file SelectionBar.cpp.

109{
110 return wxT("Selection");
111}

References wxT().

Referenced by Get().

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

◆ ModifySelection()

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

Definition at line 431 of file SelectionBar.cpp.

432{
433 // If the user moved to a different control, then update which
434 // two controls drive the others.
435 if( newDriver != mDrive2 )
436 SetDrivers( mDrive2, newDriver);
437
438 // Only update a value if user typed something in.
439 // The reason is the controls may be less accurate than
440 // the values.
441 if( newDriver == StartTimeID )
443 if( newDriver == EndTimeID )
445 if( newDriver == LengthTimeID )
447 if( newDriver == CenterTimeID )
449
450 // There are four controls, and two constraints, which are:
451 // mid = (start+end)/2
452 // length = (end-start)
453 // Therefore we can select any two controls as 'drivers' of
454 // the other two.
455 // Here we compute 'i' which combines the identity of the two
456 // driving controls, to use it as an index.
457 // The order of the two drivers generally does not matter much,
458 // except that we want:
459 // start < end
460 // and preserve that by adjusting the least dominant driving
461 // control.
462 int i = mDrive1 + 4 * mDrive2;
463 switch(i) {
464 case StartTimeID + 4 * EndTimeID:
465 if( mEnd < mStart )
466 mStart = mEnd;
467 case StartTimeID * 4 + EndTimeID:
468 if( mStart > mEnd )
469 mEnd = mStart;
470 mLength = mEnd - mStart;
471 mCenter = (mStart+mEnd)/2.0;
472 break;
473
474 case StartTimeID + 4 * LengthTimeID:
475 case StartTimeID * 4 + LengthTimeID:
477 mCenter = (mStart+mEnd)/2.0;
478 break;
479
480 case EndTimeID + 4 * LengthTimeID:
481 if( mEnd - mLength < 0 )
482 mEnd += (mLength - mEnd);
483 case EndTimeID * 4 + LengthTimeID:
484 if( mEnd - mLength < 0)
485 mLength -= (mLength - mEnd);
486 mStart = mEnd - mLength;
487 mCenter = (mStart+mEnd)/2.0;
488 break;
489
490 case LengthTimeID + 4 * CenterTimeID:
491 if( mCenter - (mLength / 2) < 0 )
492 mLength = (mCenter * 2);
493 case LengthTimeID * 4 + CenterTimeID:
494 if( mCenter - (mLength / 2) < 0 )
495 mCenter = (mLength / 2);
496 mStart = mCenter - mLength/2.0;
497 mEnd = mCenter + mLength/2.0;
498 break;
499
500 default:
501 // The above should cover all legal combinations of two distinct controls.
502 wxFAIL_MSG( "Illegal sequence of selection changes");
503 }
504
505 // Refresh the controls now
507
508 // Places the start-end markers on the track panel.
510}
@ CenterTimeID
@ LengthTimeID
void SetDrivers(int driver1, int driver2)
void ValuesToControls()
virtual void AS_ModifySelection(double &start, double &end, bool done)=0

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 794 of file SelectionBar.cpp.

795{
796 wxKeyEvent *kevent = (wxKeyEvent *)event.GetEventObject();
797 wxWindow *w = FindFocus();
798 int keyCode = kevent->GetKeyCode();
799
800 // Convert numeric keypad entries.
801 if ((keyCode >= WXK_NUMPAD0) && (keyCode <= WXK_NUMPAD9)) {
802 keyCode -= WXK_NUMPAD0 - '0';
803 }
804
805 if (keyCode >= '0' && keyCode <= '9') {
806 return;
807 }
808
809 // UP/DOWN/LEFT/RIGHT for mRateText
810 if (w == mRateText) {
811 switch (keyCode)
812 {
813 case WXK_LEFT:
814 case WXK_RIGHT:
815 case WXK_UP:
816 case WXK_DOWN:
817 case WXK_DELETE:
818 case WXK_BACK:
819 return;
820 }
821 }
822
823 event.Skip();
824}
wxWindow * mRateText
Definition: SelectionBar.h:120
std::unique_ptr< WindowPlacement > FindFocus()
Find the window that is accepting keyboard input, if any.
Definition: BasicUI.h:343

References BasicUI::FindFocus(), and mRateText.

Here is the call graph for this function:

◆ OnChangedTime()

void SelectionBar::OnChangedTime ( wxCommandEvent &  evt)
private

Definition at line 512 of file SelectionBar.cpp.

513{
514 ModifySelection(event.GetId(), event.GetInt() != 0);
515}
void ModifySelection(int newDriver, bool done=false)

References ModifySelection().

Here is the call graph for this function:

◆ OnChoice()

void SelectionBar::OnChoice ( wxCommandEvent &  event)
private

Definition at line 604 of file SelectionBar.cpp.

605{
606 int mode = mChoice->GetSelection();
607 SetSelectionMode( mode );
609}
void SelectionModeUpdated()
void SetSelectionMode(int mode)

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

Here is the call graph for this function:

◆ OnFocus()

void SelectionBar::OnFocus ( wxFocusEvent &  event)
private

Definition at line 789 of file SelectionBar.cpp.

790{
791 KeyboardCapture::OnFocus( *this, event );
792}
void OnFocus(wxWindow &window, wxFocusEvent &event)
a function useful to implement a focus event handler The window releases the keyboard if the event is...

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 611 of file SelectionBar.cpp.

612{
613 evt.Skip();
614 auto &project = mProject;
615 const auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
616
617 double audioTime;
618
619 auto &projectAudioIO = ProjectAudioIO::Get( project );
620 if ( projectAudioIO.IsAudioActive() ){
621 auto gAudioIO = AudioIO::Get();
622 audioTime = gAudioIO->GetStreamTime();
623 }
624 else {
625 const auto &playRegion = ViewInfo::Get( project ).playRegion;
626 audioTime = playRegion.GetStart();
627 }
628
629 SetTimes(selectedRegion.t0(), selectedRegion.t1(), audioTime);
630}
static AudioIO * Get()
Definition: AudioIO.cpp:147
double GetStart() const
Definition: ViewInfo.h:128
static ProjectAudioIO & Get(AudacityProject &project)
void SetTimes(double start, double end, double audio)
AudacityProject & mProject
Definition: ToolBar.h:248
PlayRegion playRegion
Definition: ViewInfo.h:220
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:219
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References AudioIO::Get(), ProjectAudioIO::Get(), ViewInfo::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 755 of file SelectionBar.cpp.

756{
757 auto value = mRateBox->GetValue();
758
759 if (value.ToDouble(&mRate) && // is a numeric value
760 (mRate != 0.0))
761 {
763 int i;
764 for(i=0;i<5;i++)
765 if( *Ctrls[i] )
766 (*Ctrls[i])->SetSampleRate( mRate );
768
769 mLastValidText = value;
770 }
771 else
772 {
773 // Bug 2497 - Undo paste into text box if it's not numeric
774 mRateBox->SetValue(mLastValidText);
775 }
776}
wxString mLastValidText
Definition: SelectionBar.h:122
wxComboBox * mRateBox
Definition: SelectionBar.h:118
virtual void AS_SetRate(double rate)=0

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 422 of file SelectionBar.cpp.

423{
424 Refresh( true );
425
426 evt.Skip();
427}

◆ OnSnapTo()

void SelectionBar::OnSnapTo ( wxCommandEvent &  event)
private

Definition at line 826 of file SelectionBar.cpp.

827{
828 mListener->AS_SetSnapTo(mSnapTo->GetSelection());
829}
wxChoice * mSnapTo
Definition: SelectionBar.h:119
virtual void AS_SetSnapTo(int snap)=0

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 518 of file SelectionBar.cpp.

519{
520 wxWindow *w = FindFocus();
522 int i;
523 int iFocus = -1;
524 for(i=0;i<5;i++)
525 if( w == *Ctrls[i] )
526 iFocus = i;
527
528 evt.Skip(false);
529
531
532 // Save format name before recreating the controls so they resize properly
533 if (mStartTime)
534 {
535 if (mListener)
537 }
538
539 // ReCreateButtons() will get rid of our sizers and controls
540 // so reset pointers first.
541 for( i=0;i<5;i++)
542 *Ctrls[i]=NULL;
543
544 mChoice = NULL;
545 mRateBox = NULL;
546 mRateText = NULL;
547 mSnapTo = NULL;
548
550
552
553 for( i=0;i<5;i++)
554 if( *Ctrls[i] )
555 (*Ctrls[i])->SetFormatName( format );
556
557 if( iFocus >=0 )
558 if( *Ctrls[iFocus] )
559 (*Ctrls[iFocus])->SetFocus();
560
562
563 Updated();
564}
int format
Definition: ExportPCM.cpp:53
static NumericFormatSymbol LookupFormat(Type type, const wxString &id)
void RegenerateTooltips() override
virtual void AS_SetSelectionFormat(const NumericFormatSymbol &format)=0
virtual void ReCreateButtons()
Definition: ToolBar.cpp:533
void Updated()
Definition: ToolBar.cpp:684
void SetFocus(const WindowPlacement &focus)
Set the window that accepts keyboard input.
Definition: BasicUI.h:352

References SelectionBarListener::AS_SetSelectionFormat(), BasicUI::FindFocus(), format, NumericConverter::LookupFormat(), mAudioTime, mCenterTime, mChoice, mEndTime, mLengthTime, mListener, mRateBox, mRateText, mSnapTo, mStartTime, ToolBar::ReCreateButtons(), RegenerateTooltips(), BasicUI::SetFocus(), 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 204 of file SelectionBar.cpp.

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

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(), wxT(), and XO().

Here is the call graph for this function:

◆ RegenerateTooltips()

void SelectionBar::RegenerateTooltips ( )
overridevirtual

Implements ToolBar.

Definition at line 409 of file SelectionBar.cpp.

410{
411#if wxUSE_TOOLTIPS
412 auto formatName =
416 mSnapTo->SetToolTip(
417 wxString::Format(
418 _("Snap Clicks/Selections to %s"), formatName.Translation() ));
419#endif
420}

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 63 of file SelectionBar.h.

63{};

◆ SelectionModeUpdated()

void SelectionBar::SelectionModeUpdated ( )
private

Definition at line 632 of file SelectionBar.cpp.

633{
634 // We just changed the mode. Remember it.
635 gPrefs->Write(wxT("/SelectionToolbarMode"), mSelectionMode);
636 gPrefs->Flush();
637
638 wxSize sz = GetMinSize();
639 sz.SetWidth( 10 );
640 SetMinSize( sz );
641 Fit();
642 Layout();
643 Updated();
644}
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143

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

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 568 of file SelectionBar.cpp.

569{
570 mDrive1 = driver1;
571 mDrive2 = driver2;
572
574 static TranslatableString Text[4] = {
575 /* i18n-hint noun */
576 XO("Start"),
577 XO("Center"),
578 XO("Length"),
579 /* i18n-hint noun */
580 XO("End")
581 };
582
583 for(int i=0;i<4;i++){
584 int id = i + StartTimeID;
585 int fixed = (( id == mDrive2 )?mDrive1:mDrive2)-StartTimeID;
586
587 const auto &Temp = Text[i];
588 auto Title = ( (id!=mDrive1) && (id!=mDrive2 ) )
589 /* i18n-hint: %s is replaced e.g by one of 'Length', 'Center',
590 'Start', or 'End' (translated), to indicate that it will be
591 calculated from other parameters. */
592 ? XO("%s - driven").Format( Temp )
593 : Temp ;
594 auto VoiceOverText =
595 /* i18n-hint: each string is replaced by one of 'Length', 'Center',
596 'Start', or 'End' (translated) */
597 XO("Selection %s. %s won't change.").Format( Temp, Text[fixed] );
598 if( *Ctrls[i] ){
599 (*Ctrls[i])->SetName( Temp );
600 }
601 }
602}
Holds a msgid for the translation catalog; may also bind format arguments.

References fast_float::fixed, 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 401 of file SelectionBar.cpp.

402{
403 mListener = l;
407};
void SetSelectionFormat(const NumericFormatSymbol &format)
void SetRate(double rate)
void SetSnapTo(int)
virtual double AS_GetRate()=0

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 739 of file SelectionBar.cpp.

740{
741 if (rate != mRate) {
742 // if the rate is actually being changed
743 mRate = rate; // update the stored rate
744 mRateBox->SetValue(wxString::Format(wxT("%d"), (int)rate));
745
746 // update the TimeTextCtrls if they exist
748 int i;
749 for(i=0;i<5;i++)
750 if( *Ctrls[i] )
751 (*Ctrls[i])->SetSampleRate( rate );
752 }
753}

References mAudioTime, mCenterTime, mEndTime, mLengthTime, mRate, mRateBox, mStartTime, and wxT().

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

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

◆ SetSelectionFormat()

void SelectionBar::SetSelectionFormat ( const NumericFormatSymbol format)

Definition at line 726 of file SelectionBar.cpp.

727{
728 bool changed =
730
731 // Test first whether changed, to avoid infinite recursion from OnUpdate
732 if ( changed ) {
733 wxCommandEvent e;
734 e.SetString(format.Internal());
735 OnUpdate(e);
736 }
737}
FormatStrings GetBuiltinFormat(const int index)
bool SetFormatString(const FormatStrings &formatString)
void OnUpdate(wxCommandEvent &evt)

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 649 of file SelectionBar.cpp.

650{
651 // Only modes 0 to 3 are now supported,
652 // so fix up a mode that could have come from the config.
653 const int maxMode = 3;
654
655 if( mode > maxMode )
656 mode = 0;
657 if( mode < 0 )
658 mode = 0;
659 mSelectionMode = mode;
660 mChoice->SetSelection( mode );
661
662 // First decide which two controls drive the others...
663 // For example the last option is with all controls shown, and in that mode we
664 // initially have start and end driving.
667 int Drive1[] = { EndTimeID, LengthTimeID, EndTimeID, CenterTimeID,
669
670 SetDrivers( Drive1[mode], Drive2[mode] );
671 // Then show/hide the relevant controls.
672 ShowHideControls( mode );
673}
void ShowHideControls(int mode)

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 721 of file SelectionBar.cpp.

722{
723 mSnapTo->SetSelection(snap);
724}

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 705 of file SelectionBar.cpp.

706{
707 if ( start != mStart || end != mEnd || audio != mAudio
709 ) {
710 mStart = start;
711 mEnd = end;
712 mLength = end-start;
713 mCenter = (end+start)/2.0;
714 mAudio = audio;
716
718 }
719}
int mLastSelectionMode
Definition: SelectionBar.h:109
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159

References PackedArray::end(), 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 676 of file SelectionBar.cpp.

677{
678 // The bits in these say which controls are visible.
679 int masks[8]= {
680 9, 5, 12, 6, // 2 items shown
681 13, 7, 11,// 3 items shown
682 15};
683 int mask = masks[mode];
684
686 for(int i=0;i<4;i++){
687 if( *Ctrls[i]){
688 (*Ctrls[i])->Show( (mask & (1<<i))!=0 );
689 (*Ctrls[i])->Refresh();
690 }
691 }
692}

References mCenterTime, mEndTime, mLengthTime, and mStartTime.

Referenced by SetSelectionMode().

Here is the caller graph for this function:

◆ ShownByDefault()

bool SelectionBar::ShownByDefault ( ) const
overridevirtual

Whether the toolbar should be shown by default. Default implementation returns true.

Reimplemented from ToolBar.

Definition at line 140 of file SelectionBar.cpp.

141{
142 return
143#ifdef EXPERIMENTAL_DA
144 false
145#else
146 true
147#endif
148 ;
149}

◆ UpdatePrefs()

void SelectionBar::UpdatePrefs ( )
overridevirtual

Implements PrefsListener.

Definition at line 370 of file SelectionBar.cpp.

371{
372 // The project rate is no longer driven from here.
373 // When preferences change, the Project learns about it too.
374 // If necessary we can drive the SelectionBar mRate via the Project
375 // calling our SetRate().
376 // As of 13-Sep-2018, changes to the sample rate pref will only affect
377 // creation of new projects, not the sample rate in existing ones.
378
379 // This will only change the selection mode during a "Reset Configuration"
380 // action since the read value will be the same during a normal preferences
381 // update.
382 mSelectionMode = gPrefs->ReadLong(wxT("/SelectionToolbarMode"), 0);
383
384 // This will only change the time format during a "Reset Configuration"
385 // action since the read value will be the same during a normal preferences
386 // update.
387 wxCommandEvent e;
390 gPrefs->Read(wxT("/SelectionFormat"), wxT(""))).Internal());
391 OnUpdate(e);
392
393 // Set label to pull in language change
394 SetLabel(XO("Selection"));
395
397 // Give base class a chance
399}
@ Internal
Indicates internal failure from Audacity.
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:408
void UpdatePrefs() override
Definition: ToolBar.cpp:622

References gPrefs, Internal, NumericConverter::LookupFormat(), mSelectionMode, OnUpdate(), RegenerateTooltips(), ToolBar::SetLabel(), NumericConverter::TIME, ToolBar::UpdatePrefs(), wxT(), 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 778 of file SelectionBar.cpp.

779{
780 wxString oldValue = mRateBox->GetValue();
781 mRateBox->Clear();
782 for (int i = 0; i < AudioIOBase::NumStandardRates; i++) {
783 mRateBox->Append(
784 wxString::Format(wxT("%d"), AudioIOBase::StandardRates[i]));
785 }
786 mRateBox->SetValue(oldValue);
787}
static const int StandardRates[]
Array of common audio sample rates.
Definition: AudioIOBase.h:189
static const int NumStandardRates
How many standard sample rates there are.
Definition: AudioIOBase.h:191

References mRateBox, AudioIOBase::NumStandardRates, AudioIOBase::StandardRates, and wxT().

Referenced by Populate().

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

◆ ValuesToControls()

void SelectionBar::ValuesToControls ( )
private

Definition at line 694 of file SelectionBar.cpp.

695{
697 double Values[5] = {mStart, mEnd, mLength, mCenter, mAudio };
698 int i;
699 for(i=0;i<5;i++)
700 if( *Ctrls[i] )
701 (*Ctrls[i])->SetValue( Values[i] );
702}

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 101 of file SelectionBar.h.

Referenced by SetTimes(), and ValuesToControls().

◆ mAudioTime

NumericTextCtrl* SelectionBar::mAudioTime
private

Definition at line 115 of file SelectionBar.h.

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

◆ mCenter

double SelectionBar::mCenter
private

Definition at line 101 of file SelectionBar.h.

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

◆ mCenterTime

NumericTextCtrl* SelectionBar::mCenterTime
private

◆ mChoice

wxChoice* SelectionBar::mChoice
private

Definition at line 116 of file SelectionBar.h.

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

◆ mDrive1

int SelectionBar::mDrive1
private

Definition at line 105 of file SelectionBar.h.

Referenced by ModifySelection(), and SetDrivers().

◆ mDrive2

int SelectionBar::mDrive2
private

Definition at line 106 of file SelectionBar.h.

Referenced by ModifySelection(), and SetDrivers().

◆ mEnd

double SelectionBar::mEnd
private

Definition at line 101 of file SelectionBar.h.

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

◆ mEndTime

NumericTextCtrl* SelectionBar::mEndTime
private

◆ mLastSelectionMode

int SelectionBar::mLastSelectionMode { 0 }
private

Definition at line 109 of file SelectionBar.h.

Referenced by SetTimes().

◆ mLastValidText

wxString SelectionBar::mLastValidText
private

Definition at line 122 of file SelectionBar.h.

Referenced by OnRate().

◆ mLength

double SelectionBar::mLength
private

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

◆ mRate

double SelectionBar::mRate
private

Definition at line 100 of file SelectionBar.h.

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

◆ mRateBox

wxComboBox* SelectionBar::mRateBox
private

Definition at line 118 of file SelectionBar.h.

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

◆ mRateText

wxWindow* SelectionBar::mRateText
private

Definition at line 120 of file SelectionBar.h.

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

◆ mSelectionMode

int SelectionBar::mSelectionMode { 0 }
private

◆ mSnapTo

wxChoice* SelectionBar::mSnapTo
private

Definition at line 119 of file SelectionBar.h.

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

◆ mStart

double SelectionBar::mStart
private

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