Audacity 3.2.0
|
(not quite a Toolbar) at foot of screen for setting and viewing the frequency selection range. More...
#include <SpectralSelectionBar.h>
Public Member Functions | |
SpectralSelectionBar (AudacityProject &project) | |
virtual | ~SpectralSelectionBar () |
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 | SetFrequencies (double bottom, double top) |
void | SetFrequencySelectionFormatName (const NumericFormatID &formatName) |
void | SetBandwidthSelectionFormatName (const NumericFormatID &formatName) |
void | RegenerateTooltips () override |
Public Member Functions inherited from ToolBar | |
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 () |
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 | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
Static Public Member Functions | |
static Identifier | ID () |
static SpectralSelectionBar & | Get (AudacityProject &project) |
static const SpectralSelectionBar & | Get (const AudacityProject &project) |
Static Public Member Functions inherited from ToolBar | |
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 | |
void | ValuesToControls () |
void | SetBounds () |
void | OnFormatsChanged (ProjectNumericFormatsEvent) |
void | OnUpdate (wxCommandEvent &evt) |
void | OnCtrl (wxCommandEvent &evt) |
void | OnChoice (wxCommandEvent &evt) |
void | OnIdle (wxIdleEvent &evt) |
void | OnSize (wxSizeEvent &evt) |
void | ModifySpectralSelection (bool done=false) |
Private Attributes | |
Observer::Subscription | mFormatsSubscription |
bool | mbCenterAndWidth |
double | mCenter |
double | mWidth |
double | mLow |
double | mHigh |
NumericTextCtrl * | mCenterCtrl |
NumericTextCtrl * | mWidthCtrl |
NumericTextCtrl * | mLowCtrl |
NumericTextCtrl * | mHighCtrl |
wxChoice * | mChoice |
int | mHeight |
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 | |
AudacityProject & | mProject |
TranslatableString | mLabel |
Identifier | mSection |
int | mIndex {0} |
(not quite a Toolbar) at foot of screen for setting and viewing the frequency selection range.
Definition at line 29 of file SpectralSelectionBar.h.
SpectralSelectionBar::SpectralSelectionBar | ( | AudacityProject & | project | ) |
Definition at line 93 of file SpectralSelectionBar.cpp.
References ProjectNumericFormats::Get(), mFormatsSubscription, OnFormatsChanged(), project, and Observer::Publisher< Message, NotifyAll >::Subscribe().
|
virtual |
Definition at line 104 of file SpectralSelectionBar.cpp.
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 130 of file SpectralSelectionBar.cpp.
References ToolBar::Create(), mHeight, and UpdatePrefs().
|
overridevirtual |
Which dock the toolbar defaults into. Default implementation chooses the top dock.
Reimplemented from ToolBar.
Definition at line 114 of file SpectralSelectionBar.cpp.
References ToolBar::BotDockID.
|
inlineoverridevirtual |
|
static |
Definition at line 119 of file SpectralSelectionBar.cpp.
References ToolManager::Get(), ID(), and project.
Referenced by Get().
|
static |
Definition at line 125 of file SpectralSelectionBar.cpp.
References Get(), and project.
|
static |
|
private |
Definition at line 268 of file SpectralSelectionBar.cpp.
References ProjectSelectionManager::Get(), TrackList::Get(), NumericConverter::GetValue(), manager, mbCenterAndWidth, mCenter, mCenterCtrl, mHigh, mHighCtrl, min(), mLow, mLowCtrl, ToolBar::mProject, mWidth, mWidthCtrl, WaveTrack::ProjectNyquistFrequency(), staffpad::audio::simd::sqrt(), tracks, and SelectedRegion::UndefinedFrequency.
Referenced by OnCtrl().
|
private |
Definition at line 344 of file SpectralSelectionBar.cpp.
References audacity::BasicSettings::Flush(), gPrefs, mbCenterAndWidth, mCenterCtrl, mChoice, mHighCtrl, mLowCtrl, mWidthCtrl, preferencePath(), ToolBar::Updated(), ValuesToControls(), and audacity::BasicSettings::Write().
|
private |
Definition at line 339 of file SpectralSelectionBar.cpp.
References ModifySpectralSelection().
|
private |
Definition at line 373 of file SpectralSelectionBar.cpp.
References ProjectNumericFormatsEvent::ChangedBandwidthFormat, ProjectNumericFormatsEvent::ChangedFrequencyFormat, ProjectNumericFormats::Get(), ToolBar::mProject, SetBandwidthSelectionFormatName(), SetFrequencySelectionFormatName(), and ProjectNumericFormatsEvent::type.
Referenced by SpectralSelectionBar().
|
private |
Definition at line 365 of file SpectralSelectionBar.cpp.
References ViewInfo::Get(), ToolBar::mProject, project, ViewInfo::selectedRegion, and SetFrequencies().
|
private |
Definition at line 261 of file SpectralSelectionBar.cpp.
|
private |
Definition at line 388 of file SpectralSelectionBar.cpp.
References BasicUI::FindFocus(), ProjectNumericFormats::Get(), mbCenterAndWidth, mCenterCtrl, mHighCtrl, mLowCtrl, ToolBar::mProject, mWidthCtrl, ToolBar::ReCreateButtons(), ToolBar::Updated(), and ValuesToControls().
Referenced by SetBandwidthSelectionFormatName(), SetFrequencySelectionFormatName(), and UpdatePrefs().
|
overridevirtual |
Implements ToolBar.
Definition at line 137 of file SpectralSelectionBar.cpp.
References _, ToolBar::Add(), BasicUI::CallAfter(), ThemeBase::Colour(), ProjectNumericFormats::Get(), gPrefs, NumericTextCtrl::Options::InvalidValue(), NumericTextCtrl::Layout(), mbCenterAndWidth, mCenterCtrl, mChoice, mHighCtrl, mLowCtrl, ToolBar::mProject, mWidthCtrl, NumericConverterType_BANDWIDTH(), NumericConverterType_FREQUENCY(), OnCenterID, OnChoiceID, OnHighID, OnLowID, OnWidthID, preferencePath(), FormatterContext::ProjectContext(), audacity::BasicSettings::Read(), safenew, SetBandwidthSelectionFormatName(), SetFrequencySelectionFormatName(), NumericTextCtrl::SetName(), theTheme, toolbarSingle, SelectedRegion::UndefinedFrequency, and XO().
|
inlineoverridevirtual |
Implements ToolBar.
Definition at line 55 of file SpectralSelectionBar.h.
Referenced by UpdatePrefs().
|
inlineoverride |
Definition at line 47 of file SpectralSelectionBar.h.
void SpectralSelectionBar::SetBandwidthSelectionFormatName | ( | const NumericFormatID & | formatName | ) |
Definition at line 497 of file SpectralSelectionBar.cpp.
References Identifier::GET(), NumericConverter::GetFormatName(), mbCenterAndWidth, mWidthCtrl, OnUpdate(), and NumericTextCtrl::SetFormatName().
Referenced by OnFormatsChanged(), and Populate().
|
private |
Definition at line 455 of file SpectralSelectionBar.cpp.
References mHigh, mHighCtrl, mLow, mLowCtrl, NumericConverter::ResetMaxValue(), NumericConverter::ResetMinValue(), NumericConverter::SetMaxValue(), and NumericConverter::SetMinValue().
void SpectralSelectionBar::SetFrequencies | ( | double | bottom, |
double | top | ||
) |
Definition at line 468 of file SpectralSelectionBar.cpp.
References mCenter, mHigh, mLow, mWidth, staffpad::audio::simd::sqrt(), and ValuesToControls().
Referenced by OnIdle().
void SpectralSelectionBar::SetFrequencySelectionFormatName | ( | const NumericFormatID & | formatName | ) |
Definition at line 483 of file SpectralSelectionBar.cpp.
References Identifier::GET(), NumericConverter::GetFormatName(), mbCenterAndWidth, mCenterCtrl, mLowCtrl, OnUpdate(), and NumericTextCtrl::SetFormatName().
Referenced by OnFormatsChanged(), and Populate().
|
overridevirtual |
Whether the toolbar should be shown by default. Default implementation returns true.
Reimplemented from ToolBar.
Definition at line 109 of file SpectralSelectionBar.cpp.
|
overridevirtual |
Implements PrefsListener.
Definition at line 235 of file SpectralSelectionBar.cpp.
References Identifier::GET(), NumericConverter::GetFormatName(), mbCenterAndWidth, mCenterCtrl, mLowCtrl, mWidthCtrl, OnUpdate(), RegenerateTooltips(), ToolBar::SetLabel(), ToolBar::UpdatePrefs(), and XO().
Referenced by Create().
|
private |
Definition at line 436 of file SpectralSelectionBar.cpp.
References mbCenterAndWidth, mCenter, mCenterCtrl, mHigh, mHighCtrl, mLow, mLowCtrl, mWidth, mWidthCtrl, and NumericTextCtrl::SetValue().
Referenced by OnChoice(), OnUpdate(), and SetFrequencies().
|
private |
Definition at line 73 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), OnChoice(), OnUpdate(), Populate(), SetBandwidthSelectionFormatName(), SetFrequencySelectionFormatName(), UpdatePrefs(), and ValuesToControls().
|
private |
Definition at line 75 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), SetFrequencies(), and ValuesToControls().
|
private |
Definition at line 80 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), OnChoice(), OnUpdate(), Populate(), SetFrequencySelectionFormatName(), UpdatePrefs(), and ValuesToControls().
|
private |
Definition at line 81 of file SpectralSelectionBar.h.
Referenced by OnChoice(), and Populate().
|
private |
Definition at line 71 of file SpectralSelectionBar.h.
Referenced by SpectralSelectionBar().
|
private |
Definition at line 83 of file SpectralSelectionBar.h.
Referenced by Create().
|
private |
Definition at line 78 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), SetBounds(), SetFrequencies(), and ValuesToControls().
|
private |
Definition at line 80 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), OnChoice(), OnUpdate(), Populate(), SetBounds(), and ValuesToControls().
|
private |
Definition at line 77 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), SetBounds(), SetFrequencies(), and ValuesToControls().
|
private |
Definition at line 80 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), OnChoice(), OnUpdate(), Populate(), SetBounds(), SetFrequencySelectionFormatName(), UpdatePrefs(), and ValuesToControls().
|
private |
Definition at line 76 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), SetFrequencies(), and ValuesToControls().
|
private |
Definition at line 80 of file SpectralSelectionBar.h.
Referenced by ModifySpectralSelection(), OnChoice(), OnUpdate(), Populate(), SetBandwidthSelectionFormatName(), UpdatePrefs(), and ValuesToControls().