Audacity 3.2.0
|
A toobar to allow easier changing of input and output devices . More...
#include <DeviceToolBar.h>
Public Member Functions | |
DeviceToolBar (AudacityProject &project) | |
virtual | ~DeviceToolBar () |
bool | ShownByDefault () const override |
Whether the toolbar should be shown by default. Default implementation returns true. More... | |
void | Create (wxWindow *parent) override |
void | UpdatePrefs () override |
void | UpdateSelectedPrefs (int) override |
void | DeinitChildren () |
void | Populate () override |
void | Repaint (wxDC *WXUNUSED(dc)) override |
void | EnableDisableButtons () override |
void | OnFocus (wxFocusEvent &event) |
void | OnCaptureKey (wxCommandEvent &event) |
void | OnChoice (wxCommandEvent &event) |
int | GetInitialWidth () override |
int | GetMinToolbarWidth () override |
void | ShowInputDialog () |
void | ShowOutputDialog () |
void | ShowHostDialog () |
void | ShowChannelsDialog () |
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 DeviceToolBar & | Get (AudacityProject &project) |
static const DeviceToolBar & | 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 | OnRescannedDevices (DeviceChangeMessage) |
int | ChangeHost () |
void | ChangeDevice (bool isInput) |
void | RefillCombos () |
void | FillHosts () |
void | FillHostDevices () |
void | FillInputChannels () |
void | SetDevices (const DeviceSourceMap *in, const DeviceSourceMap *out) |
void | SetNames () |
void | RegenerateTooltips () override |
void | ShowComboDialog (wxChoice *combo, const TranslatableString &title) |
Private Attributes | |
wxChoice * | mInput |
wxChoice * | mOutput |
wxChoice * | mInputChannels |
wxChoice * | mHost |
Observer::Subscription | mSubscription |
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 toobar to allow easier changing of input and output devices .
Definition at line 27 of file DeviceToolBar.h.
DeviceToolBar::DeviceToolBar | ( | AudacityProject & | project | ) |
Definition at line 79 of file DeviceToolBar.cpp.
References DeviceManager::Instance(), mSubscription, OnRescannedDevices(), and Observer::Publisher< Message, NotifyAll >::Subscribe().
|
virtual |
Definition at line 86 of file DeviceToolBar.cpp.
|
private |
Definition at line 620 of file DeviceToolBar.cpp.
References AudioIOHost, DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), MakeDeviceSourceString(), mInput, mOutput, name, Setting< T >::Read(), SetDevices(), and wxT().
Referenced by OnChoice().
|
private |
Definition at line 573 of file DeviceToolBar.cpp.
References AudioIOHost, FillHostDevices(), audacity::BasicSettings::Flush(), gPrefs, mHost, Setting< T >::Read(), and Setting< T >::Write().
Referenced by OnChoice().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 106 of file DeviceToolBar.cpp.
References ToolBar::Create().
void DeviceToolBar::DeinitChildren | ( | ) |
Definition at line 116 of file DeviceToolBar.cpp.
References mHost, mInput, mInputChannels, and mOutput.
Referenced by Populate().
|
overridevirtual |
Implements ToolBar.
Definition at line 354 of file DeviceToolBar.cpp.
References BasicUI::FindFocus(), AudioIOBase::Get(), TrackPanel::Get(), mHost, mInput, mInputChannels, mOutput, and ToolBar::mProject.
|
private |
Definition at line 436 of file DeviceToolBar.cpp.
References AudioIOHost, audacity::BasicSettings::Flush(), DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), gPrefs, DeviceManager::Instance(), MakeDeviceSourceString(), mHost, mInput, mOutput, Setting< T >::Read(), Setting< T >::Write(), and wxT().
Referenced by ChangeHost(), RefillCombos(), and UpdatePrefs().
|
private |
Definition at line 405 of file DeviceToolBar.cpp.
References DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), make_iterator_range(), and mHost.
Referenced by RefillCombos().
|
private |
Definition at line 519 of file DeviceToolBar.cpp.
References _, AudioIOHost, AudioIORecordChannels, AudioIORecordingDevice, AudioIORecordingSource, DeviceManager::GetInputDeviceMaps(), DeviceManager::Instance(), mInputChannels, name, Setting< T >::Read(), Setting< T >::Write(), and wxT().
Referenced by RefillCombos(), SetDevices(), and UpdatePrefs().
|
static |
Definition at line 95 of file DeviceToolBar.cpp.
References ToolManager::Get(), ID(), and project.
Referenced by Get(), anonymous_namespace{DeviceToolBar.cpp}::OnAudioHost(), anonymous_namespace{DeviceToolBar.cpp}::OnInputChannels(), anonymous_namespace{DeviceToolBar.cpp}::OnInputDevice(), and anonymous_namespace{DeviceToolBar.cpp}::OnOutputDevice().
|
static |
Definition at line 101 of file DeviceToolBar.cpp.
References Get(), and project.
|
inlineoverridevirtual |
When the prefs don't exist this value is used. 883 takes a complete row in the default initial size of Audacity.
Reimplemented from ToolBar.
Definition at line 57 of file DeviceToolBar.h.
|
inlineoverridevirtual |
|
static |
Definition at line 73 of file DeviceToolBar.cpp.
References wxT().
Referenced by Get().
void DeviceToolBar::OnCaptureKey | ( | wxCommandEvent & | event | ) |
Definition at line 228 of file DeviceToolBar.cpp.
References BasicUI::FindFocus(), mInput, and mOutput.
void DeviceToolBar::OnChoice | ( | wxCommandEvent & | event | ) |
Definition at line 652 of file DeviceToolBar.cpp.
References AudioIORecordChannels, PrefsListener::Broadcast(), ChangeDevice(), ChangeHost(), DeviceToolbarPrefsID(), AudioIOBase::Get(), mHost, mInput, mInputChannels, mOutput, and Setting< T >::Write().
Referenced by ShowComboDialog().
void DeviceToolBar::OnFocus | ( | wxFocusEvent & | event | ) |
Definition at line 223 of file DeviceToolBar.cpp.
References KeyboardCapture::OnFocus().
Referenced by Populate().
|
private |
Definition at line 565 of file DeviceToolBar.cpp.
References RefillCombos(), and Rescan.
Referenced by DeviceToolBar().
|
overridevirtual |
Implements ToolBar.
Definition at line 124 of file DeviceToolBar.cpp.
References ToolBar::Add(), ThemeBase::Bitmap(), ThemeBase::Colour(), DeinitChildren(), mHost, mInput, mInputChannels, mOutput, OnFocus(), RefillCombos(), safenew, SetNames(), theTheme, and toolbarSingle.
|
private |
Definition at line 396 of file DeviceToolBar.cpp.
References FillHostDevices(), FillHosts(), FillInputChannels(), and UpdatePrefs().
Referenced by OnRescannedDevices(), and Populate().
|
overrideprivatevirtual |
Implements ToolBar.
Definition at line 385 of file DeviceToolBar.cpp.
References mHost, mInput, mInputChannels, mOutput, SetNames(), and wxT().
Referenced by UpdatePrefs().
|
inlineoverride |
Definition at line 48 of file DeviceToolBar.h.
|
private |
Definition at line 595 of file DeviceToolBar.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 ChangeDevice(), and UpdatePrefs().
|
private |
Definition at line 375 of file DeviceToolBar.cpp.
References _, mHost, mInput, mInputChannels, and mOutput.
Referenced by Populate(), and RegenerateTooltips().
void DeviceToolBar::ShowChannelsDialog | ( | ) |
Definition at line 710 of file DeviceToolBar.cpp.
References mInputChannels, ShowComboDialog(), and XO().
|
private |
Definition at line 715 of file DeviceToolBar.cpp.
References AudacityMessageBox(), eIsCreating, OnChoice(), S, wxDialogWrapper::SetName(), title, Verbatim(), and XO().
Referenced by ShowChannelsDialog(), ShowHostDialog(), ShowInputDialog(), and ShowOutputDialog().
void DeviceToolBar::ShowHostDialog | ( | ) |
Definition at line 706 of file DeviceToolBar.cpp.
References mHost, ShowComboDialog(), and XO().
void DeviceToolBar::ShowInputDialog | ( | ) |
Definition at line 698 of file DeviceToolBar.cpp.
References mInput, ShowComboDialog(), and XO().
|
overridevirtual |
Whether the toolbar should be shown by default. Default implementation returns true.
Reimplemented from ToolBar.
Definition at line 90 of file DeviceToolBar.cpp.
void DeviceToolBar::ShowOutputDialog | ( | ) |
Definition at line 702 of file DeviceToolBar.cpp.
References mOutput, ShowComboDialog(), and XO().
|
overridevirtual |
Implements PrefsListener.
Definition at line 248 of file DeviceToolBar.cpp.
References AudioIOHost, AudioIOPlaybackDevice, AudioIOPlaybackSource, AudioIORecordChannels, AudioIORecordingDevice, AudioIORecordingSource, anonymous_namespace{ExportPCM.cpp}::desc, FillHostDevices(), FillInputChannels(), DeviceManager::GetDefaultInputDevice(), DeviceManager::GetDefaultOutputDevice(), DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), MakeDeviceSourceString(), mHost, mInput, mInputChannels, mOutput, Setting< T >::Read(), Setting< T >::ReadWithDefault(), RegenerateTooltips(), SetDevices(), ToolBar::SetLabel(), ToolBar::UpdatePrefs(), wxT(), and XO().
Referenced by RefillCombos(), and UpdateSelectedPrefs().
|
overridevirtual |
Reimplemented from PrefsListener.
Definition at line 346 of file DeviceToolBar.cpp.
References DeviceToolbarPrefsID(), UpdatePrefs(), and PrefsListener::UpdateSelectedPrefs().
|
private |
Definition at line 82 of file DeviceToolBar.h.
Referenced by ChangeHost(), DeinitChildren(), EnableDisableButtons(), FillHostDevices(), FillHosts(), OnChoice(), Populate(), RegenerateTooltips(), SetNames(), ShowHostDialog(), and UpdatePrefs().
|
private |
Definition at line 79 of file DeviceToolBar.h.
Referenced by ChangeDevice(), DeinitChildren(), EnableDisableButtons(), FillHostDevices(), OnCaptureKey(), OnChoice(), Populate(), RegenerateTooltips(), SetNames(), ShowInputDialog(), and UpdatePrefs().
|
private |
Definition at line 81 of file DeviceToolBar.h.
Referenced by DeinitChildren(), EnableDisableButtons(), FillInputChannels(), OnChoice(), Populate(), RegenerateTooltips(), SetNames(), ShowChannelsDialog(), and UpdatePrefs().
|
private |
Definition at line 80 of file DeviceToolBar.h.
Referenced by ChangeDevice(), DeinitChildren(), EnableDisableButtons(), FillHostDevices(), OnCaptureKey(), OnChoice(), Populate(), RegenerateTooltips(), SetNames(), ShowOutputDialog(), and UpdatePrefs().
|
private |
Definition at line 84 of file DeviceToolBar.h.
Referenced by DeviceToolBar().