![]() |
Audacity 3.2.0
|
A toolbar to allow easier changing of input and output devices . More...
#include <AudioSetupToolBar.h>
Public Member Functions | |
AudioSetupToolBar (AudacityProject &project) | |
Methods for AudioSetupToolBar. More... | |
virtual | ~AudioSetupToolBar () |
void | Create (wxWindow *parent) override |
void | UpdatePrefs () override |
void | UpdateSelectedPrefs (int) override |
void | DeinitChildren () |
void | Populate () override |
void | Repaint (wxDC *dc) override |
void | EnableDisableButtons () override |
void | ReCreateButtons () override |
void | OnFocus (wxFocusEvent &event) |
void | OnAudioSetup (wxCommandEvent &event) |
![]() | |
ToolBar (AudacityProject &project, int type, const TranslatableString &label, const wxString §ion, bool resizable=false) | |
virtual | ~ToolBar () |
bool | AcceptsFocus () 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 | GetType () |
TranslatableString | GetTitle () |
TranslatableString | GetLabel () |
wxString | GetSection () |
ToolDock * | GetDock () |
void | SetLabel (const TranslatableString &label) |
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 () |
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 AudioSetupToolBar & | Get (AudacityProject &project) |
static const AudioSetupToolBar & | 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 Types | |
enum | { ID_AUDIO_SETUP_BUTTON = 12000 , BUTTON_COUNT } |
Private Member Functions | |
void | OnRescannedDevices (DeviceChangeMessage) |
void | OnMenu (wxCommandEvent &event) |
bool | ChangeHost (int hostId) |
void | ChangeDevice (int deviceId, bool isInput) |
void | RepopulateMenus () |
void | FillHosts () |
void | FillHostDevices () |
void | FillInputChannels () |
void | SetDevices (const DeviceSourceMap *in, const DeviceSourceMap *out) |
void | RegenerateTooltips () override |
void | MakeAudioSetupButton () |
void | ArrangeButtons () |
std::unique_ptr< wxMenu > | CloneMenu (const wxMenu &menu) const |
void | AppendSubMenu (wxMenu &menu, const std::unique_ptr< wxMenu > &submenu, const wxString &title) |
std::optional< wxString > | GetSelectedRadioItemLabel (const wxMenu &menu) const |
Private Attributes | |
AButton * | mAudioSetup {} |
wxBoxSizer * | mSizer {} |
std::unique_ptr< wxMenu > | mInput |
std::unique_ptr< wxMenu > | mOutput |
std::unique_ptr< wxMenu > | mInputChannels |
std::unique_ptr< wxMenu > | mHost |
Observer::Subscription | mSubscription |
Additional Inherited Members | |
![]() | |
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 |
wxString | mSection |
int | mType |
A toolbar to allow easier changing of input and output devices .
Definition at line 25 of file AudioSetupToolBar.h.
|
private |
Enumerator | |
---|---|
ID_AUDIO_SETUP_BUTTON | |
BUTTON_COUNT |
Definition at line 69 of file AudioSetupToolBar.h.
|
explicit |
Methods for AudioSetupToolBar.
Definition at line 84 of file AudioSetupToolBar.cpp.
References DeviceManager::Instance(), OnRescannedDevices(), and Observer::Publisher< Message, NotifyAll >::Subscribe().
|
virtual |
Definition at line 91 of file AudioSetupToolBar.cpp.
|
private |
Definition at line 660 of file AudioSetupToolBar.cpp.
References CloneMenu(), GetSelectedRadioItemLabel(), and title.
Referenced by OnAudioSetup().
|
private |
Definition at line 193 of file AudioSetupToolBar.cpp.
References ToolBar::Add(), ThemeBase::Colour(), ToolBar::Detach(), ToolBar::GetSizer(), mAudioSetup, mSizer, safenew, and theTheme.
Referenced by Populate().
|
private |
Definition at line 741 of file AudioSetupToolBar.cpp.
References AudioIOHost, DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), MakeDeviceSourceString(), mInput, mOutput, name, Setting< T >::Read(), and SetDevices().
Referenced by OnMenu().
|
private |
Definition at line 691 of file AudioSetupToolBar.cpp.
References AudioIOHost, FillHostDevices(), FileConfig::Flush(), gPrefs, mHost, Setting< T >::Read(), and Setting< T >::Write().
Referenced by OnMenu().
|
private |
Definition at line 646 of file AudioSetupToolBar.cpp.
Referenced by AppendSubMenu().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 106 of file AudioSetupToolBar.cpp.
References ToolBar::Create().
void AudioSetupToolBar::DeinitChildren | ( | ) |
Definition at line 116 of file AudioSetupToolBar.cpp.
References mHost, mInput, mInputChannels, and mOutput.
Referenced by Populate().
|
overridevirtual |
Implements ToolBar.
Definition at line 429 of file AudioSetupToolBar.cpp.
References AButton::Disable(), AButton::Enable(), AudioIOBase::Get(), and mAudioSetup.
Referenced by ReCreateButtons().
|
private |
Definition at line 509 of file AudioSetupToolBar.cpp.
References AudioIOHost, FileConfig::Flush(), DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), gPrefs, DeviceManager::Instance(), anonymous_namespace{AudioSetupToolBar.cpp}::kInput, anonymous_namespace{AudioSetupToolBar.cpp}::kOutput, MakeDeviceSourceString(), mHost, mInput, mOutput, Setting< T >::Read(), and Setting< T >::Write().
Referenced by ChangeHost(), RepopulateMenus(), and UpdatePrefs().
|
private |
Definition at line 482 of file AudioSetupToolBar.cpp.
References DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), anonymous_namespace{AudioSetupToolBar.cpp}::kHost, make_iterator_range(), and mHost.
Referenced by RepopulateMenus().
|
private |
Definition at line 602 of file AudioSetupToolBar.cpp.
References _, AudioIOHost, AudioIORecordChannels, AudioIORecordingDevice, AudioIORecordingSource, DeviceManager::GetInputDeviceMaps(), DeviceManager::Instance(), anonymous_namespace{AudioSetupToolBar.cpp}::kInputChannels, mInputChannels, name, Setting< T >::Read(), and Setting< T >::Write().
Referenced by RepopulateMenus(), SetDevices(), and UpdatePrefs().
|
static |
Definition at line 95 of file AudioSetupToolBar.cpp.
References AudioSetupBarID, and ToolManager::Get().
Referenced by Get().
|
static |
Definition at line 101 of file AudioSetupToolBar.cpp.
References Get().
|
private |
Definition at line 671 of file AudioSetupToolBar.cpp.
Referenced by AppendSubMenu(), and UpdatePrefs().
|
private |
Definition at line 154 of file AudioSetupToolBar.cpp.
References gPrefs, ID_AUDIO_SETUP_BUTTON, ThemeBase::ImageSize(), ToolBar::MakeButton(), ToolBar::MakeMacRecoloredImageSize(), ToolBar::MakeRecoloredImageSize(), mAudioSetup, AButton::SetLabel(), size, theTheme, and XO.
Referenced by Populate().
void AudioSetupToolBar::OnAudioSetup | ( | wxCommandEvent & | event | ) |
Definition at line 263 of file AudioSetupToolBar.cpp.
References _, AppendSubMenu(), ID_AUDIO_SETUP_BUTTON, AButton::InteractionOver(), anonymous_namespace{AudioSetupToolBar.cpp}::kAudioSettings, mAudioSetup, mHost, mInput, mInputChannels, mOutput, OnMenu(), AButton::PopUp(), and BasicMenu::Handle::Popup().
void AudioSetupToolBar::OnFocus | ( | wxFocusEvent & | event | ) |
Definition at line 258 of file AudioSetupToolBar.cpp.
References KeyboardCapture::OnFocus().
|
private |
Definition at line 773 of file AudioSetupToolBar.cpp.
References AudioIORecordChannels, PrefsListener::Broadcast(), ChangeDevice(), ChangeHost(), DevicePrefsFactory(), DeviceToolbarPrefsID(), AudioIOBase::Get(), GetProjectFrame(), anonymous_namespace{AudioSetupToolBar.cpp}::kAudioSettings, anonymous_namespace{AudioSetupToolBar.cpp}::kHost, anonymous_namespace{AudioSetupToolBar.cpp}::kInput, anonymous_namespace{AudioSetupToolBar.cpp}::kInputChannels, anonymous_namespace{AudioSetupToolBar.cpp}::kOutput, mInputChannels, ToolBar::mProject, Setting< T >::Write(), and XO.
Referenced by OnAudioSetup().
|
private |
Definition at line 683 of file AudioSetupToolBar.cpp.
References RepopulateMenus(), and Rescan.
Referenced by AudioSetupToolBar().
|
overridevirtual |
Implements ToolBar.
Definition at line 124 of file AudioSetupToolBar.cpp.
References ArrangeButtons(), ThemeBase::Colour(), DeinitChildren(), MakeAudioSetupButton(), RegenerateTooltips(), RepopulateMenus(), and theTheme.
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 230 of file AudioSetupToolBar.cpp.
References ToolBar::Detach(), EnableDisableButtons(), AButton::IsDown(), mAudioSetup, mSizer, AButton::PushDown(), ToolBar::ReCreateButtons(), and RegenerateTooltips().
|
overrideprivatevirtual |
Implements ToolBar.
Definition at line 445 of file AudioSetupToolBar.cpp.
References BUTTON_COUNT, ID_AUDIO_SETUP_BUTTON, ToolBar::mProject, name, ToolBar::SetButtonToolTip(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::size(), and Verbatim().
Referenced by Populate(), ReCreateButtons(), and UpdatePrefs().
|
overridevirtual |
Implements ToolBar.
Definition at line 143 of file AudioSetupToolBar.cpp.
References AColor::Bevel(), and mSizer.
|
private |
Definition at line 473 of file AudioSetupToolBar.cpp.
References FillHostDevices(), FillHosts(), FillInputChannels(), and UpdatePrefs().
Referenced by OnRescannedDevices(), and Populate().
|
private |
Definition at line 716 of file AudioSetupToolBar.cpp.
References AudioIOPlaybackDevice, AudioIOPlaybackSource, AudioIORecordingDevice, AudioIORecordingSource, AudioIORecordingSourceIndex, DeviceSourceMap::deviceString, FillInputChannels(), FileConfig::Flush(), gPrefs, Setting< T >::Reset(), DeviceSourceMap::sourceIndex, DeviceSourceMap::sourceString, DeviceSourceMap::totalSources, and Setting< T >::Write().
Referenced by ChangeDevice(), and UpdatePrefs().
|
overridevirtual |
Implements PrefsListener.
Definition at line 294 of file AudioSetupToolBar.cpp.
References AudioIOHost, AudioIOPlaybackDevice, AudioIOPlaybackSource, AudioIORecordChannels, AudioIORecordingDevice, AudioIORecordingSource, desc, FillHostDevices(), FillInputChannels(), DeviceManager::GetDefaultInputDevice(), DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), GetSelectedRadioItemLabel(), DeviceManager::Instance(), anonymous_namespace{AudioSetupToolBar.cpp}::kInput, anonymous_namespace{AudioSetupToolBar.cpp}::kInputChannels, anonymous_namespace{AudioSetupToolBar.cpp}::kOutput, MakeDeviceSourceString(), mHost, mInput, mInputChannels, mOutput, Setting< T >::Read(), Setting< T >::ReadWithDefault(), RegenerateTooltips(), SetDevices(), ToolBar::SetLabel(), ToolBar::UpdatePrefs(), and XO.
Referenced by RepopulateMenus(), and UpdateSelectedPrefs().
|
overridevirtual |
Reimplemented from PrefsListener.
Definition at line 421 of file AudioSetupToolBar.cpp.
References DeviceToolbarPrefsID(), UpdatePrefs(), and PrefsListener::UpdateSelectedPrefs().
|
private |
Definition at line 74 of file AudioSetupToolBar.h.
Referenced by ArrangeButtons(), EnableDisableButtons(), MakeAudioSetupButton(), OnAudioSetup(), and ReCreateButtons().
|
private |
Definition at line 80 of file AudioSetupToolBar.h.
Referenced by ChangeHost(), DeinitChildren(), FillHostDevices(), FillHosts(), OnAudioSetup(), and UpdatePrefs().
|
private |
Definition at line 77 of file AudioSetupToolBar.h.
Referenced by ChangeDevice(), DeinitChildren(), FillHostDevices(), OnAudioSetup(), and UpdatePrefs().
|
private |
Definition at line 79 of file AudioSetupToolBar.h.
Referenced by DeinitChildren(), FillInputChannels(), OnAudioSetup(), OnMenu(), and UpdatePrefs().
|
private |
Definition at line 78 of file AudioSetupToolBar.h.
Referenced by ChangeDevice(), DeinitChildren(), FillHostDevices(), OnAudioSetup(), and UpdatePrefs().
|
private |
Definition at line 75 of file AudioSetupToolBar.h.
Referenced by ArrangeButtons(), ReCreateButtons(), and Repaint().
|
private |
Definition at line 82 of file AudioSetupToolBar.h.