![]() |
Audacity 3.2.0
|
A toolbar to allow easier changing of input and output devices . More...
#include <AudioSetupToolBar.h>
Classes | |
| class | Choices |
Public Member Functions | |
| AudioSetupToolBar (AudacityProject &project) | |
| 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) |
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 () |
| Methods for AudioSetupToolBar. More... | |
| static AudioSetupToolBar & | Get (AudacityProject &project) |
| static const AudioSetupToolBar & | 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 Types | |
| enum | { ID_AUDIO_SETUP_BUTTON = 12000 , BUTTON_COUNT } |
| using | Callback = void(AudioSetupToolBar::*)(int id) |
Private Member Functions | |
| void | OnRescannedDevices (DeviceChangeMessage) |
| void | OnHost (int id) |
| void | OnInput (int id) |
| void | OnChannels (int id) |
| void | OnOutput (int id) |
| void | OnAudioDeviceRescan (wxCommandEvent &) |
| void | OnSettings (wxCommandEvent &event) |
| void | CommonMenuItemSteps (bool audioSettingsChosen) |
| bool | ChangeHost (int hostId) |
| void | ChangeDeviceLabel (int deviceId, Choices &choices, 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 () |
Static Private Member Functions | |
| static void | AppendSubMenu (AudioSetupToolBar &toolbar, wxMenu &menu, const wxArrayString &labels, int checkedItem, Callback callback, const wxString &title) |
Private Attributes | |
| AButton * | mAudioSetup {} |
| Choices | mInput |
| Choices | mOutput |
| Choices | mInputChannels |
| Choices | mHost |
| Observer::Subscription | mSubscription |
Static Private Attributes | |
| static constexpr int | kAudioSettings = 15800 |
| static constexpr int | kAudioDeviceRescan = 15801 |
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) |
| 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} |
A toolbar to allow easier changing of input and output devices .
Definition at line 26 of file AudioSetupToolBar.h.
|
private |
Definition at line 75 of file AudioSetupToolBar.h.
|
private |
| Enumerator | |
|---|---|
| ID_AUDIO_SETUP_BUTTON | |
| BUTTON_COUNT | |
Definition at line 84 of file AudioSetupToolBar.h.
|
explicit |
Definition at line 81 of file AudioSetupToolBar.cpp.
References DeviceManager::Instance(), mSubscription, OnRescannedDevices(), and Observer::Publisher< Message, NotifyAll >::Subscribe().
|
virtual |
Definition at line 88 of file AudioSetupToolBar.cpp.
|
staticprivate |
Definition at line 551 of file AudioSetupToolBar.cpp.
Referenced by AudioSetupToolBar::Choices::AppendSubMenu().
|
private |
Definition at line 165 of file AudioSetupToolBar.cpp.
References ToolBar::Add(), ToolBar::GetSizer(), mAudioSetup, and toolbarSpacing.
Referenced by Populate().
|
private |
Definition at line 637 of file AudioSetupToolBar.cpp.
References AudioIOHost, AudioSetupToolBar::Choices::Get(), DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), MakeDeviceSourceString(), name, Setting< T >::Read(), AudioSetupToolBar::Choices::Set(), SetDevices(), and wxT().
Referenced by OnInput(), and OnOutput().
|
private |
Definition at line 587 of file AudioSetupToolBar.cpp.
References AudioIOHost, FillHostDevices(), audacity::BasicSettings::Flush(), AudioSetupToolBar::Choices::Get(), gPrefs, mHost, name, Setting< T >::Read(), AudioSetupToolBar::Choices::Set(), and Setting< T >::Write().
Referenced by OnHost().
|
private |
Definition at line 704 of file AudioSetupToolBar.cpp.
References PrefsListener::Broadcast(), DevicePrefsFactory(), DeviceToolbarPrefsID(), AudioIOBase::Get(), GetProjectFrame(), and ToolBar::mProject.
Referenced by OnChannels(), OnHost(), OnInput(), OnOutput(), and OnSettings().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 103 of file AudioSetupToolBar.cpp.
References ToolBar::Create().
| void AudioSetupToolBar::DeinitChildren | ( | ) |
Definition at line 113 of file AudioSetupToolBar.cpp.
References AudioSetupToolBar::Choices::Clear(), mHost, mInput, mInputChannels, and mOutput.
Referenced by Populate().
|
overridevirtual |
Implements ToolBar.
Definition at line 343 of file AudioSetupToolBar.cpp.
References AButton::Disable(), AButton::Enable(), AudioIOBase::Get(), and mAudioSetup.
Referenced by ReCreateButtons().
|
private |
Definition at line 420 of file AudioSetupToolBar.cpp.
References AudioIOHost, AudioSetupToolBar::Choices::Clear(), AudioSetupToolBar::Choices::Find(), audacity::BasicSettings::Flush(), DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), gPrefs, DeviceManager::Instance(), MakeDeviceSourceString(), mHost, mInput, mOutput, Setting< T >::Read(), AudioSetupToolBar::Choices::Set(), Setting< T >::Write(), and wxT().
Referenced by ChangeHost(), RepopulateMenus(), and UpdatePrefs().
|
private |
Definition at line 396 of file AudioSetupToolBar.cpp.
References DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), make_iterator_range(), mHost, and AudioSetupToolBar::Choices::Set().
Referenced by RepopulateMenus().
|
private |
Definition at line 505 of file AudioSetupToolBar.cpp.
References _, AudioIOHost, AudioIORecordChannels, AudioIORecordingDevice, AudioIORecordingSource, AudioSetupToolBar::Choices::Clear(), DeviceManager::GetInputDeviceMaps(), DeviceManager::Instance(), mInputChannels, name, names, Setting< T >::Read(), AudioSetupToolBar::Choices::Set(), Setting< T >::Write(), and wxT().
Referenced by RepopulateMenus(), SetDevices(), and UpdatePrefs().
|
static |
Definition at line 92 of file AudioSetupToolBar.cpp.
References ToolManager::Get(), ID(), and project.
Referenced by Get().
|
static |
Definition at line 98 of file AudioSetupToolBar.cpp.
References Get(), and project.
|
static |
Methods for AudioSetupToolBar.
Definition at line 75 of file AudioSetupToolBar.cpp.
References wxT().
Referenced by Get().
|
private |
Definition at line 146 of file AudioSetupToolBar.cpp.
References ThemeBase::Colour(), AButton::FrameTextVButton, ID_AUDIO_SETUP_BUTTON, ThemeBase::Image(), mAudioSetup, safenew, AButton::SetButtonType(), AButton::SetIcon(), AButton::SetImages(), AButton::SetLabel(), size, theTheme, toolbarMargin, toolbarSingle, and XO().
Referenced by Populate().
|
private |
Definition at line 691 of file AudioSetupToolBar.cpp.
References BasicUI::CallAfter(), DeviceManager::Instance(), and DeviceManager::Rescan().
Referenced by OnAudioSetup().
| void AudioSetupToolBar::OnAudioSetup | ( | wxCommandEvent & | event | ) |
Definition at line 196 of file AudioSetupToolBar.cpp.
References _, AudioSetupToolBar::Choices::AppendSubMenu(), ID_AUDIO_SETUP_BUTTON, kAudioDeviceRescan, kAudioSettings, mAudioSetup, mHost, mInput, mInputChannels, mOutput, OnAudioDeviceRescan(), OnChannels(), OnHost(), OnInput(), OnOutput(), OnSettings(), AButton::PopUp(), and BasicMenu::Handle::Popup().
|
private |
Definition at line 671 of file AudioSetupToolBar.cpp.
References AudioIORecordChannels, CommonMenuItemSteps(), mInputChannels, AudioSetupToolBar::Choices::Set(), and Setting< T >::Write().
Referenced by OnAudioSetup().
| void AudioSetupToolBar::OnFocus | ( | wxFocusEvent & | event | ) |
Definition at line 191 of file AudioSetupToolBar.cpp.
References KeyboardCapture::OnFocus().
|
private |
Definition at line 665 of file AudioSetupToolBar.cpp.
References ChangeHost(), and CommonMenuItemSteps().
Referenced by OnAudioSetup().
|
private |
Definition at line 679 of file AudioSetupToolBar.cpp.
References ChangeDeviceLabel(), CommonMenuItemSteps(), and mInput.
Referenced by OnAudioSetup().
|
private |
Definition at line 685 of file AudioSetupToolBar.cpp.
References ChangeDeviceLabel(), CommonMenuItemSteps(), and mOutput.
Referenced by OnAudioSetup().
|
private |
Definition at line 579 of file AudioSetupToolBar.cpp.
References RepopulateMenus(), and Rescan.
Referenced by AudioSetupToolBar().
|
private |
Definition at line 699 of file AudioSetupToolBar.cpp.
References CommonMenuItemSteps().
Referenced by OnAudioSetup().
|
overridevirtual |
Implements ToolBar.
Definition at line 121 of file AudioSetupToolBar.cpp.
References ArrangeButtons(), ThemeBase::Colour(), DeinitChildren(), MakeAudioSetupButton(), ToolBar::MakeButtonBackgroundsSmall(), RegenerateTooltips(), RepopulateMenus(), and theTheme.
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 173 of file AudioSetupToolBar.cpp.
References EnableDisableButtons(), AButton::IsDown(), mAudioSetup, AButton::PushDown(), ToolBar::ReCreateButtons(), and RegenerateTooltips().
|
overrideprivatevirtual |
Implements ToolBar.
Definition at line 359 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(), Verbatim(), and wxT().
Referenced by Populate(), ReCreateButtons(), and UpdatePrefs().
|
overridevirtual |
Implements ToolBar.
Definition at line 141 of file AudioSetupToolBar.cpp.
|
private |
Definition at line 387 of file AudioSetupToolBar.cpp.
References FillHostDevices(), FillHosts(), FillInputChannels(), and UpdatePrefs().
Referenced by OnRescannedDevices(), and Populate().
|
private |
Definition at line 611 of file AudioSetupToolBar.cpp.
References AudioIOPlaybackDevice, AudioIOPlaybackSource, AudioIORecordingDevice, AudioIORecordingSource, AudioIORecordingSourceIndex, DeviceSourceMap::deviceString, FillInputChannels(), audacity::BasicSettings::Flush(), gPrefs, Setting< T >::Reset(), DeviceSourceMap::sourceIndex, DeviceSourceMap::sourceString, DeviceSourceMap::totalSources, and Setting< T >::Write().
Referenced by ChangeDeviceLabel(), and UpdatePrefs().
|
overridevirtual |
Implements PrefsListener.
Definition at line 233 of file AudioSetupToolBar.cpp.
References AudioIOHost, AudioIOPlaybackDevice, AudioIOPlaybackSource, AudioIORecordChannels, AudioIORecordingDevice, AudioIORecordingSource, anonymous_namespace{ExportPCM.cpp}::desc, AudioSetupToolBar::Choices::Empty(), FillHostDevices(), FillInputChannels(), AudioSetupToolBar::Choices::Get(), DeviceManager::GetDefaultInputDevice(), AudioSetupToolBar::Choices::GetFirst(), DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), AudioSetupToolBar::Choices::GetSmallIntegerId(), DeviceManager::Instance(), MakeDeviceSourceString(), mHost, mInput, mInputChannels, mOutput, Setting< T >::Read(), Setting< T >::ReadWithDefault(), RegenerateTooltips(), AudioSetupToolBar::Choices::Set(), SetDevices(), ToolBar::SetLabel(), ToolBar::UpdatePrefs(), wxT(), and XO().
Referenced by RepopulateMenus(), and UpdateSelectedPrefs().
|
overridevirtual |
Reimplemented from PrefsListener.
Definition at line 335 of file AudioSetupToolBar.cpp.
References DeviceToolbarPrefsID(), UpdatePrefs(), and PrefsListener::UpdateSelectedPrefs().
|
staticconstexprprivate |
Definition at line 28 of file AudioSetupToolBar.h.
Referenced by OnAudioSetup().
|
staticconstexprprivate |
Definition at line 27 of file AudioSetupToolBar.h.
Referenced by OnAudioSetup().
|
private |
Definition at line 89 of file AudioSetupToolBar.h.
Referenced by ArrangeButtons(), EnableDisableButtons(), MakeAudioSetupButton(), OnAudioSetup(), and ReCreateButtons().
|
private |
Definition at line 142 of file AudioSetupToolBar.h.
Referenced by ChangeHost(), DeinitChildren(), FillHostDevices(), FillHosts(), OnAudioSetup(), and UpdatePrefs().
|
private |
Definition at line 139 of file AudioSetupToolBar.h.
Referenced by DeinitChildren(), FillHostDevices(), OnAudioSetup(), OnInput(), and UpdatePrefs().
|
private |
Definition at line 141 of file AudioSetupToolBar.h.
Referenced by DeinitChildren(), FillInputChannels(), OnAudioSetup(), OnChannels(), and UpdatePrefs().
|
private |
Definition at line 140 of file AudioSetupToolBar.h.
Referenced by DeinitChildren(), FillHostDevices(), OnAudioSetup(), OnOutput(), and UpdatePrefs().
|
private |
Definition at line 144 of file AudioSetupToolBar.h.
Referenced by AudioSetupToolBar().