![]() |
Audacity 3.2.0
|
(not quite a Toolbar) at foot of screen for setting and viewing the selection range. More...
#include <SelectionBar.h>
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 |
![]() | |
ToolBar (AudacityProject &project, const TranslatableString &label, const Identifier §ion, 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 () |
ToolDock * | GetDock () |
void | SetPreferredNeighbors (Identifier left, Identifier top={}) |
void | SetLabel (const TranslatableString &label) |
virtual void | SetDocked (ToolDock *dock, bool pushed) |
std::pair< Identifier, Identifier > | PreferredNeighbors () 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 () |
![]() | |
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 () |
![]() | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
Static Public Member Functions | |
static Identifier | ID () |
static SelectionBar & | Get (AudacityProject &project) |
static const SelectionBar & | Get (const AudacityProject &project) |
![]() | |
static AButton * | MakeButton (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 AButton * | MakeButton (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 | |
auStaticText * | AddTitle (const TranslatableString &Title, wxSizer *pSizer) |
NumericTextCtrl * | AddTime (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 | |
SelectionBarListener * | mListener |
double | mRate |
double | mStart |
double | mEnd |
double | mLength |
double | mCenter |
double | mAudio |
int | mDrive1 |
int | mDrive2 |
int | mSelectionMode { 0 } |
int | mLastSelectionMode { 0 } |
NumericTextCtrl * | mStartTime |
NumericTextCtrl * | mCenterTime |
NumericTextCtrl * | mLengthTime |
NumericTextCtrl * | mEndTime |
NumericTextCtrl * | mAudioTime |
wxChoice * | mChoice |
wxStaticText * | mProxy |
wxComboBox * | mRateBox |
wxChoice * | mSnapTo |
wxWindow * | mRateText |
wxString | mLastValidText |
Additional Inherited Members | |
![]() | |
enum | DockID { TopDockID = 1 , BotDockID = 2 } |
Identifies one of the docking areas for toolbars. More... | |
using | Holder = wxWindowPtr< 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) |
![]() | |
virtual void | UpdateSelectedPrefs (int id) |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
![]() | |
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 void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
![]() | |
AudacityProject & | mProject |
TranslatableString | mLabel |
Identifier | mSection |
int | mIndex {0} |
(not quite a Toolbar) at foot of screen for setting and viewing the selection range.
Definition at line 46 of file SelectionBar.h.
SelectionBar::SelectionBar | ( | AudacityProject & | project | ) |
Definition at line 113 of file SelectionBar.cpp.
References QualitySettings::DefaultSampleRate, gPrefs, mRate, mSelectionMode, Read(), and wxT().
|
virtual |
Definition at line 136 of file SelectionBar.cpp.
|
private |
Definition at line 186 of file SelectionBar.cpp.
References SelectionBarListener::AS_GetSelectionFormat(), mListener, mRate, safenew, and NumericConverter::TIME.
Referenced by Populate().
|
private |
Definition at line 174 of file SelectionBar.cpp.
References ThemeBase::Colour(), safenew, theTheme, and TranslatableString::Translation().
Referenced by Populate().
|
private |
Definition at line 197 of file SelectionBar.cpp.
References safenew, and toolbarSingle.
Referenced by Populate().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 167 of file SelectionBar.cpp.
References ToolBar::Create(), and UpdatePrefs().
|
overridevirtual |
Which dock the toolbar defaults into. Default implementation chooses the top dock.
Reimplemented from ToolBar.
Definition at line 151 of file SelectionBar.cpp.
References ToolBar::BotDockID.
|
inlineoverridevirtual |
|
static |
Definition at line 156 of file SelectionBar.cpp.
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().
|
static |
Definition at line 162 of file SelectionBar.cpp.
References Get().
|
static |
Definition at line 108 of file SelectionBar.cpp.
References wxT().
Referenced by Get().
|
private |
Definition at line 431 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(), StartTimeID, and ValuesToControls().
Referenced by OnChangedTime().
|
private |
Definition at line 794 of file SelectionBar.cpp.
References BasicUI::FindFocus(), and mRateText.
|
private |
Definition at line 512 of file SelectionBar.cpp.
References ModifySelection().
|
private |
Definition at line 604 of file SelectionBar.cpp.
References mChoice, SelectionModeUpdated(), and SetSelectionMode().
|
private |
Definition at line 789 of file SelectionBar.cpp.
References KeyboardCapture::OnFocus().
Referenced by Populate().
|
private |
Definition at line 611 of file SelectionBar.cpp.
References AudioIO::Get(), ProjectAudioIO::Get(), ViewInfo::Get(), PlayRegion::GetStart(), ToolBar::mProject, ViewInfo::playRegion, ViewInfo::selectedRegion, and SetTimes().
|
private |
Definition at line 755 of file SelectionBar.cpp.
References SelectionBarListener::AS_SetRate(), mAudioTime, mCenterTime, mEndTime, mLastValidText, mLengthTime, mListener, mRate, mRateBox, and mStartTime.
|
private |
Definition at line 422 of file SelectionBar.cpp.
|
private |
Definition at line 826 of file SelectionBar.cpp.
References SelectionBarListener::AS_SetSnapTo(), mListener, and mSnapTo.
|
private |
Definition at line 518 of file SelectionBar.cpp.
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().
|
overridevirtual |
Implements ToolBar.
Definition at line 204 of file SelectionBar.cpp.
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().
|
overridevirtual |
Implements ToolBar.
Definition at line 409 of file SelectionBar.cpp.
References _, SelectionBarListener::AS_GetSelectionFormat(), mListener, and mSnapTo.
Referenced by OnUpdate(), Populate(), and UpdatePrefs().
|
inlineoverride |
Definition at line 63 of file SelectionBar.h.
|
private |
Definition at line 632 of file SelectionBar.cpp.
References FileConfig::Flush(), gPrefs, mSelectionMode, ToolBar::Updated(), and wxT().
Referenced by OnChoice().
|
private |
Definition at line 568 of file SelectionBar.cpp.
References fast_float::fixed, mCenterTime, mDrive1, mDrive2, mEndTime, mLengthTime, mStartTime, wxPanelWrapper::SetName(), StartTimeID, and XO().
Referenced by ModifySelection(), and SetSelectionMode().
void SelectionBar::SetListener | ( | SelectionBarListener * | l | ) |
Definition at line 401 of file SelectionBar.cpp.
References SelectionBarListener::AS_GetRate(), SelectionBarListener::AS_GetSelectionFormat(), SelectionBarListener::AS_GetSnapTo(), mListener, SetRate(), SetSelectionFormat(), and SetSnapTo().
Referenced by ProjectManager::New().
void SelectionBar::SetRate | ( | double | rate | ) |
Definition at line 739 of file SelectionBar.cpp.
References mAudioTime, mCenterTime, mEndTime, mLengthTime, mRate, mRateBox, mStartTime, and wxT().
Referenced by ProjectFileManager::AddImportedTracks(), ProjectSelectionManager::AS_SetRate(), ProjectFileManager::OpenProjectFile(), and SetListener().
void SelectionBar::SetSelectionFormat | ( | const NumericFormatSymbol & | format | ) |
Definition at line 726 of file SelectionBar.cpp.
References format, NumericConverter::GetBuiltinFormat(), mStartTime, OnUpdate(), and NumericTextCtrl::SetFormatString().
Referenced by ProjectSelectionManager::AS_SetSelectionFormat(), and SetListener().
|
private |
Definition at line 649 of file SelectionBar.cpp.
References CenterTimeID, EndTimeID, LengthTimeID, mChoice, mSelectionMode, SetDrivers(), ShowHideControls(), and StartTimeID.
Referenced by OnChoice(), and Populate().
void SelectionBar::SetSnapTo | ( | int | snap | ) |
Definition at line 721 of file SelectionBar.cpp.
References mSnapTo.
Referenced by ProjectSelectionManager::AS_SetSnapTo(), and SetListener().
void SelectionBar::SetTimes | ( | double | start, |
double | end, | ||
double | audio | ||
) |
Definition at line 705 of file SelectionBar.cpp.
References PackedArray::end(), mAudio, mCenter, mEnd, mLastSelectionMode, mLength, mSelectionMode, mStart, and ValuesToControls().
Referenced by OnIdle().
|
private |
Definition at line 676 of file SelectionBar.cpp.
References mCenterTime, mEndTime, mLengthTime, and mStartTime.
Referenced by SetSelectionMode().
|
overridevirtual |
Whether the toolbar should be shown by default. Default implementation returns true.
Reimplemented from ToolBar.
Definition at line 140 of file SelectionBar.cpp.
|
overridevirtual |
Implements PrefsListener.
Definition at line 370 of file SelectionBar.cpp.
References gPrefs, Internal, NumericConverter::LookupFormat(), mSelectionMode, OnUpdate(), RegenerateTooltips(), ToolBar::SetLabel(), NumericConverter::TIME, ToolBar::UpdatePrefs(), wxT(), and XO().
Referenced by Create().
|
private |
Definition at line 778 of file SelectionBar.cpp.
References mRateBox, AudioIOBase::NumStandardRates, AudioIOBase::StandardRates, and wxT().
Referenced by Populate().
|
private |
Definition at line 694 of file SelectionBar.cpp.
References mAudio, mAudioTime, mCenter, mCenterTime, mEnd, mEndTime, mLength, mLengthTime, mStart, and mStartTime.
Referenced by ModifySelection(), OnUpdate(), and SetTimes().
|
private |
Definition at line 101 of file SelectionBar.h.
Referenced by SetTimes(), and ValuesToControls().
|
private |
Definition at line 115 of file SelectionBar.h.
Referenced by OnRate(), OnUpdate(), Populate(), SetRate(), and ValuesToControls().
|
private |
Definition at line 101 of file SelectionBar.h.
Referenced by ModifySelection(), SetTimes(), and ValuesToControls().
|
private |
Definition at line 112 of file SelectionBar.h.
Referenced by ModifySelection(), OnRate(), OnUpdate(), Populate(), SetDrivers(), SetRate(), ShowHideControls(), and ValuesToControls().
|
private |
Definition at line 116 of file SelectionBar.h.
Referenced by OnChoice(), OnUpdate(), Populate(), and SetSelectionMode().
|
private |
Definition at line 105 of file SelectionBar.h.
Referenced by ModifySelection(), and SetDrivers().
|
private |
Definition at line 106 of file SelectionBar.h.
Referenced by ModifySelection(), and SetDrivers().
|
private |
Definition at line 101 of file SelectionBar.h.
Referenced by ModifySelection(), SetTimes(), and ValuesToControls().
|
private |
Definition at line 114 of file SelectionBar.h.
Referenced by ModifySelection(), OnRate(), OnUpdate(), Populate(), SetDrivers(), SetRate(), ShowHideControls(), and ValuesToControls().
|
private |
Definition at line 109 of file SelectionBar.h.
Referenced by SetTimes().
|
private |
Definition at line 122 of file SelectionBar.h.
Referenced by OnRate().
|
private |
Definition at line 101 of file SelectionBar.h.
Referenced by ModifySelection(), SetTimes(), and ValuesToControls().
|
private |
Definition at line 113 of file SelectionBar.h.
Referenced by ModifySelection(), OnRate(), OnUpdate(), Populate(), SetDrivers(), SetRate(), ShowHideControls(), and ValuesToControls().
|
private |
Definition at line 99 of file SelectionBar.h.
Referenced by AddTime(), ModifySelection(), OnRate(), OnSnapTo(), OnUpdate(), Populate(), RegenerateTooltips(), and SetListener().
|
private |
Definition at line 117 of file SelectionBar.h.
|
private |
Definition at line 100 of file SelectionBar.h.
Referenced by AddTime(), OnRate(), Populate(), SelectionBar(), and SetRate().
|
private |
Definition at line 118 of file SelectionBar.h.
Referenced by OnRate(), OnUpdate(), Populate(), SetRate(), and UpdateRates().
|
private |
Definition at line 120 of file SelectionBar.h.
Referenced by OnCaptureKey(), OnUpdate(), and Populate().
|
private |
Definition at line 108 of file SelectionBar.h.
Referenced by Populate(), SelectionBar(), SelectionModeUpdated(), SetSelectionMode(), SetTimes(), and UpdatePrefs().
|
private |
Definition at line 119 of file SelectionBar.h.
Referenced by OnSnapTo(), OnUpdate(), Populate(), RegenerateTooltips(), and SetSnapTo().
|
private |
Definition at line 101 of file SelectionBar.h.
Referenced by ModifySelection(), SetTimes(), and ValuesToControls().
|
private |
Definition at line 111 of file SelectionBar.h.
Referenced by ModifySelection(), OnRate(), OnUpdate(), Populate(), SetDrivers(), SetRate(), SetSelectionFormat(), ShowHideControls(), and ValuesToControls().