Audacity 3.2.0
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AudioSetupToolBar Class Referencefinal

A toolbar to allow easier changing of input and output devices . More...

#include <AudioSetupToolBar.h>

Inheritance diagram for AudioSetupToolBar:
[legend]
Collaboration diagram for AudioSetupToolBar:
[legend]

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 &section, 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 ()
 
ToolDockGetDock ()
 
void SetPreferredNeighbors (Identifier left, Identifier top={})
 
void SetLabel (const TranslatableString &label)
 
virtual void SetDocked (ToolDock *dock, bool pushed)
 
std::pair< Identifier, IdentifierPreferredNeighbors () 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
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Member Functions

static Identifier ID ()
 Methods for AudioSetupToolBar. More...
 
static AudioSetupToolBarGet (AudacityProject &project)
 
static const AudioSetupToolBarGet (const AudacityProject &project)
 
- Static Public Member Functions inherited from ToolBar
static AButtonMakeButton (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 AButtonMakeButton (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

AButtonmAudioSetup {}
 
wxBoxSizer * mSizer {}
 
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
AudacityProjectmProject
 
TranslatableString mLabel
 
Identifier mSection
 
int mIndex {0}
 

Detailed Description

A toolbar to allow easier changing of input and output devices .

Definition at line 26 of file AudioSetupToolBar.h.

Member Typedef Documentation

◆ Callback

using AudioSetupToolBar::Callback = void (AudioSetupToolBar::*)(int id)
private

Definition at line 75 of file AudioSetupToolBar.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_AUDIO_SETUP_BUTTON 
BUTTON_COUNT 

Definition at line 84 of file AudioSetupToolBar.h.

Constructor & Destructor Documentation

◆ AudioSetupToolBar()

AudioSetupToolBar::AudioSetupToolBar ( AudacityProject project)
explicit

Definition at line 81 of file AudioSetupToolBar.cpp.

82: ToolBar( project, XO("Audio Setup"), ID() )
83{
86}
XO("Cut/Copy/Paste")
const auto project
void OnRescannedDevices(DeviceChangeMessage)
Observer::Subscription mSubscription
static Identifier ID()
Methods for AudioSetupToolBar.
static DeviceManager * Instance()
Gets the singleton instance.
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
Definition: Observer.h:199
ToolBar(AudacityProject &project, const TranslatableString &label, const Identifier &section, bool resizable=false)
Definition: ToolBar.cpp:328

References DeviceManager::Instance(), mSubscription, OnRescannedDevices(), and Observer::Publisher< Message, NotifyAll >::Subscribe().

Here is the call graph for this function:

◆ ~AudioSetupToolBar()

AudioSetupToolBar::~AudioSetupToolBar ( )
virtual

Definition at line 88 of file AudioSetupToolBar.cpp.

89{
90}

Member Function Documentation

◆ AppendSubMenu()

void AudioSetupToolBar::AppendSubMenu ( AudioSetupToolBar toolbar,
wxMenu &  menu,
const wxArrayString &  labels,
int  checkedItem,
Callback  callback,
const wxString &  title 
)
staticprivate

Definition at line 579 of file AudioSetupToolBar.cpp.

582{
583 auto subMenu = std::make_unique<wxMenu>();
584 int ii = 0;
585 for (const auto &label : labels) {
586 // Assign fresh ID with wxID_ANY
587 auto subMenuItem = subMenu->AppendRadioItem(wxID_ANY, label);
588 if (ii == checkedItem)
589 subMenuItem->Check();
590 subMenu->Bind(wxEVT_MENU,
591 [&toolbar, callback, ii](wxCommandEvent &){ (toolbar.*callback)(ii); },
592 subMenuItem->GetId());
593 ++ii;
594 }
595 auto menuItem = menu.AppendSubMenu(subMenu.release(), title);
596 if (checkedItem < 0)
597 menuItem->Enable(false);
598}
static const auto title
TranslatableString label
Definition: TagsEditor.cpp:165

References label, and title.

Referenced by AudioSetupToolBar::Choices::AppendSubMenu().

Here is the caller graph for this function:

◆ ArrangeButtons()

void AudioSetupToolBar::ArrangeButtons ( )
private

Definition at line 168 of file AudioSetupToolBar.cpp.

169{
170 int flags = wxALIGN_CENTER | wxRIGHT;
171
172 // (Re)allocate the button sizer
173 if (mSizer)
174 {
175 Detach(mSizer);
176 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
177 }
178
179 Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
180 mSizer->Add(mAudioSetup, 1, wxEXPAND);
181
182 // Layout the sizer
183 mSizer->Layout();
184
185 // Layout the toolbar
186 Layout();
187
188 SetMinSize(GetSizer()->GetMinSize());
189}
#define safenew
Definition: MemoryX.h:9
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:709
wxBoxSizer * GetSizer()
Definition: ToolBar.cpp:701
void Detach(wxWindow *window)
Definition: ToolBar.cpp:775

References ToolBar::Add(), ToolBar::Detach(), ToolBar::GetSizer(), mAudioSetup, mSizer, and safenew.

Referenced by Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChangeDeviceLabel()

void AudioSetupToolBar::ChangeDeviceLabel ( int  deviceId,
Choices choices,
bool  isInput 
)
private

Definition at line 665 of file AudioSetupToolBar.cpp.

667{
668 int newIndex = -1;
669
670 auto host = AudioIOHost.Read();
671 const std::vector<DeviceSourceMap>& maps = isInput ? DeviceManager::Instance()->GetInputDeviceMaps()
673
674 if (choices.Set(deviceId)) {
675 // Update cache with the chosen device
676 wxString newDevice = *choices.Get();
677 for (size_t i = 0; i < maps.size(); ++i) {
678 const auto name = MakeDeviceSourceString(&maps[i]);
679 if (name == newDevice && maps[i].hostString == host)
680 newIndex = i;
681 }
682 }
683
684 if (newIndex < 0) {
685 wxLogDebug(wxT("AudioSetupToolBar::ChangeDeviceLabel(): couldn't find device indices"));
686 return;
687 }
688
689 SetDevices(isInput ? &maps[newIndex] : nullptr,
690 isInput ? nullptr : &maps[newIndex]);
691}
wxT("CloseDown"))
StringSetting AudioIOHost
wxString MakeDeviceSourceString(const DeviceSourceMap *map)
const TranslatableString name
Definition: Distortion.cpp:76
void SetDevices(const DeviceSourceMap *in, const DeviceSourceMap *out)
const std::vector< DeviceSourceMap > & GetInputDeviceMaps()
const std::vector< DeviceSourceMap > & GetOutputDeviceMaps()
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChangeHost()

bool AudioSetupToolBar::ChangeHost ( int  hostId)
private

Definition at line 615 of file AudioSetupToolBar.cpp.

616{
617 // Update cache with selected host
618 if (!mHost.Set(hostId))
619 return false;
620 auto name = mHost.Get();
621 assert(name); // should not be nullopt if Set succeeded
622
623 auto oldHost = AudioIOHost.Read();
624 const auto newHost = *name;
625
626 if (oldHost == newHost)
627 return false;
628
629 //change the host and switch to correct devices.
630 AudioIOHost.Write(newHost);
631 gPrefs->Flush();
632
633 // populate the devices and reassign mHost
635
636 return true;
637}
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
bool Set(const wxString &name)
std::optional< wxString > Get() const
bool Write(const T &value)
Write value to config and return true if successful.
Definition: Prefs.h:259
virtual bool Flush() noexcept=0

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CommonMenuItemSteps()

void AudioSetupToolBar::CommonMenuItemSteps ( bool  audioSettingsChosen)
private

Definition at line 732 of file AudioSetupToolBar.cpp.

733{
734 auto gAudioIO = AudioIOBase::Get();
735 if (gAudioIO) {
736 // We cannot have gotten here if gAudioIO->IsAudioTokenActive(),
737 // per the setting of AudioIONotBusyFlag and AudioIOBusyFlag in
738 // AudacityProject::GetUpdateFlags().
739 // However, we can have an invalid audio token (so IsAudioTokenActive()
740 // is false), but be monitoring.
741 // If monitoring, have to stop the stream, so HandleDeviceChange() can work.
742 // We could disable the Preferences command while monitoring, i.e.,
743 // set AudioIONotBusyFlag/AudioIOBusyFlag according to monitoring, as well.
744 // Instead allow it because unlike recording, for example, monitoring
745 // is not clearly something that should prohibit changing device.
746 // TODO: We *could* be smarter in this method and call HandleDeviceChange()
747 // only when the device choices actually changed. True of lots of prefs!
748 // As is, we always stop monitoring before handling the device change.
749 if (gAudioIO->IsMonitoring())
750 {
751 gAudioIO->StopStream();
752 while (gAudioIO->IsBusy()) {
753 using namespace std::chrono;
754 std::this_thread::sleep_for(100ms);
755 }
756 }
757
758 if (audioSettingsChosen) {
759 PrefsPanel::Factories factories;
760 factories.push_back(PrefsPanel::PrefsNode(DevicePrefsFactory));
761
762 ViewDeviceSettingsDialog dialog(
763 &GetProjectFrame(mProject), mProject, {}, factories, 0);
764 dialog.SetSize(600, 420);
765 dialog.Center();
766
767 if (0 != dialog.ShowModal()) {
769 }
770 }
771 else {
772 gAudioIO->HandleDeviceChange();
774 }
775 }
776}
PrefsPanel * DevicePrefsFactory(wxWindow *parent, wxWindowID winid, AudacityProject *project)
int DeviceToolbarPrefsID()
Methods for DeviceToolBar.
AUDACITY_DLL_API wxFrame & GetProjectFrame(AudacityProject &project)
Get the top-level window associated with the project (as a wxFrame only, when you do not need to use ...
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:94
static void Broadcast(int id=0)
Call this static function to notify all PrefsListener objects.
Definition: Prefs.cpp:128
std::vector< PrefsPanel::PrefsNode > Factories
Definition: PrefsPanel.h:72
AudacityProject & mProject
Definition: ToolBar.h:248

References PrefsListener::Broadcast(), DevicePrefsFactory(), DeviceToolbarPrefsID(), AudioIOBase::Get(), GetProjectFrame(), and ToolBar::mProject.

Referenced by OnChannels(), OnHost(), OnInput(), OnOutput(), and OnSettings().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Create()

void AudioSetupToolBar::Create ( wxWindow *  parent)
overridevirtual

Reimplemented from ToolBar.

Definition at line 103 of file AudioSetupToolBar.cpp.

104{
105 ToolBar::Create(parent);
106
107 // Simulate a size event to set initial meter placement/size
108 wxSizeEvent event(GetSize(), GetId());
109 event.SetEventObject(this);
110 GetEventHandler()->ProcessEvent(event);
111}
virtual void Create(wxWindow *parent)
Definition: ToolBar.cpp:492

References ToolBar::Create().

Here is the call graph for this function:

◆ DeinitChildren()

void AudioSetupToolBar::DeinitChildren ( )

Definition at line 113 of file AudioSetupToolBar.cpp.

References AudioSetupToolBar::Choices::Clear(), mHost, mInput, mInputChannels, and mOutput.

Referenced by Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnableDisableButtons()

void AudioSetupToolBar::EnableDisableButtons ( )
overridevirtual

Implements ToolBar.

Definition at line 371 of file AudioSetupToolBar.cpp.

372{
373 auto gAudioIO = AudioIOBase::Get();
374 if (gAudioIO) {
375 // we allow changes when monitoring, but not when recording
376 bool audioStreamActive = gAudioIO->IsStreamActive() && !gAudioIO->IsMonitoring();
377
378 if (audioStreamActive) {
380 }
381 else {
383 }
384 }
385}
void Disable()
Definition: AButton.cpp:560
void Enable()
Definition: AButton.cpp:551

References AButton::Disable(), AButton::Enable(), AudioIOBase::Get(), and mAudioSetup.

Referenced by ReCreateButtons().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillHostDevices()

void AudioSetupToolBar::FillHostDevices ( )
private

Definition at line 448 of file AudioSetupToolBar.cpp.

449{
450 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
451 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
452
453 //read what is in the prefs
454 auto host = AudioIOHost.Read();
455 int foundHostIndex = -1;
456
457 // if the host is not in the hosts combo then we rescanned.
458 // set it to blank so we search for another host.
459 if (mHost.Find(host) < 0)
460 host = wxT("");
461
462 // Try to find a hostIndex, among either inputs or outputs, assumed to be
463 // unique among the union of the set of input and output devices
464 for (auto & device : outMaps) {
465 if (device.hostString == host) {
466 foundHostIndex = device.hostIndex;
467 break;
468 }
469 }
470
471 if (foundHostIndex == -1) {
472 for (auto & device : inMaps) {
473 if (device.hostString == host) {
474 foundHostIndex = device.hostIndex;
475 break;
476 }
477 }
478 }
479
480 // If no host was found based on the prefs device host, load the first available one
481 if (foundHostIndex == -1) {
482 if (outMaps.size()) {
483 foundHostIndex = outMaps[0].hostIndex;
484 }
485 else if (inMaps.size()) {
486 foundHostIndex = inMaps[0].hostIndex;
487 }
488 }
489
490 // Make sure in/out are clear in case no host was found
491 mInput.Clear();
492 mOutput.Clear();
493
494 // If we still have no host it means no devices, in which case do nothing.
495 if (foundHostIndex == -1) {
496 return;
497 }
498
499 // Repopulate the Input/Output device list available to the user
500 wxArrayStringEx mInputDeviceNames;
501 for (size_t i = 0; i < inMaps.size(); ++i) {
502 auto& device = inMaps[i];
503 if (foundHostIndex == device.hostIndex) {
504 mInputDeviceNames.push_back(MakeDeviceSourceString(&device));
505 if (host.empty()) {
506 host = device.hostString;
507 AudioIOHost.Write(host);
508 mHost.Set(host);
509 }
510 }
511 }
512 mInput.Set(std::move(mInputDeviceNames));
513
514 wxArrayStringEx mOutputDeviceNames;
515 for (size_t i = 0; i < outMaps.size(); ++i) {
516 auto& device = outMaps[i];
517 if (foundHostIndex == device.hostIndex) {
518 mOutputDeviceNames.push_back(MakeDeviceSourceString(&device));
519 if (host.empty()) {
520 host = device.hostString;
521 AudioIOHost.Write(host);
522 mHost.Set(host);
523 }
524 }
525 }
526 mOutput.Set(std::move(mOutputDeviceNames));
527
528 gPrefs->Flush();
529
530 // The setting of the Device is left up to menu handlers
531}
int Find(const wxString &name) const
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillHosts()

void AudioSetupToolBar::FillHosts ( )
private

Definition at line 424 of file AudioSetupToolBar.cpp.

425{
426 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
427 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
428
429 wxArrayString hosts;
430
431 // go over our lists add the host to the list if it isn't there yet
432
433 for (auto & device : inMaps) {
434 if (!make_iterator_range(hosts).contains(device.hostString)) {
435 hosts.push_back(device.hostString);
436 }
437 }
438
439 for (auto & device : outMaps) {
440 if (!make_iterator_range(hosts).contains(device.hostString)) {
441 hosts.push_back(device.hostString);
442 }
443 }
444
445 mHost.Set(std::move(hosts));
446}
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: IteratorX.h:210

References DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), make_iterator_range(), mHost, and AudioSetupToolBar::Choices::Set().

Referenced by RepopulateMenus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillInputChannels()

void AudioSetupToolBar::FillInputChannels ( )
private

Definition at line 533 of file AudioSetupToolBar.cpp.

534{
535 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
536 auto host = AudioIOHost.Read();
537 auto device = AudioIORecordingDevice.Read();
538 auto source = AudioIORecordingSource.Read();
539 long newChannels = 0;
540
541 auto oldChannels = AudioIORecordChannels.Read();
543
545 for (auto & dev: inMaps) {
546 if (source == dev.sourceString &&
547 device == dev.deviceString &&
548 host == dev.hostString) {
549
550 // add one selection for each channel of this source
551 for (size_t j = 0; j < (unsigned int)dev.numChannels; j++) {
552 wxString name;
553
554 if (j == 0) {
555 name = _("1 (Mono) Recording Channel");
556 }
557 else if (j == 1) {
558 name = _("2 (Stereo) Recording Channels");
559 }
560 else {
561 name = wxString::Format(wxT("%d"), (int)j + 1);
562 }
563 names.push_back(name);
564 }
565 newChannels = dev.numChannels;
566 if (oldChannels <= newChannels && oldChannels >= 1) {
567 newChannels = oldChannels;
568 }
569 AudioIORecordChannels.Write(newChannels);
570 break;
571 }
572 }
573 mInputChannels.Set(std::move(names));
574 if (newChannels >= 1)
575 // Correct to 0-based index in choice
576 mInputChannels.Set(newChannels - 1);
577}
StringSetting AudioIORecordingSource
StringSetting AudioIORecordingDevice
IntSetting AudioIORecordChannels
#define _(s)
Definition: Internat.h:73
static TranslatableStrings names
Definition: TagsEditor.cpp:153

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [1/2]

AudioSetupToolBar & AudioSetupToolBar::Get ( AudacityProject project)
static

Definition at line 92 of file AudioSetupToolBar.cpp.

93{
94 auto &toolManager = ToolManager::Get( project );
95 return *static_cast<AudioSetupToolBar*>(toolManager.GetToolBar(ID()));
96}
A toolbar to allow easier changing of input and output devices .
static ToolManager & Get(AudacityProject &project)

References ToolManager::Get(), ID(), and project.

Referenced by Get().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get() [2/2]

const AudioSetupToolBar & AudioSetupToolBar::Get ( const AudacityProject project)
static

Definition at line 98 of file AudioSetupToolBar.cpp.

99{
100 return Get( const_cast<AudacityProject&>( project )) ;
101}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static AudioSetupToolBar & Get(AudacityProject &project)

References Get(), and project.

Here is the call graph for this function:

◆ ID()

Identifier AudioSetupToolBar::ID ( )
static

Methods for AudioSetupToolBar.

Definition at line 75 of file AudioSetupToolBar.cpp.

76{
77 return wxT("Audio Setup");
78}

References wxT().

Referenced by Get().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MakeAudioSetupButton()

void AudioSetupToolBar::MakeAudioSetupButton ( )
private

Definition at line 152 of file AudioSetupToolBar.cpp.

153{
155 //i18n-hint: Audio setup button text, keep as short as possible
156 mAudioSetup->SetLabel(XO("Audio Setup"));
159 theTheme.Image(bmpRecoloredUpSmall),
160 theTheme.Image(bmpRecoloredUpHiliteSmall),
161 theTheme.Image(bmpRecoloredDownSmall),
162 theTheme.Image(bmpRecoloredHiliteSmall),
163 theTheme.Image(bmpRecoloredUpSmall));
164 mAudioSetup->SetIcon(theTheme.Image(bmpSetup));
165 mAudioSetup->SetForegroundColour(theTheme.Colour(clrTrackPanelText));
166}
THEME_API Theme theTheme
Definition: Theme.cpp:82
A wxButton with mouse-over behaviour.
Definition: AButton.h:104
void SetButtonType(Type type)
Definition: AButton.cpp:147
void SetImages(const wxImage &up, const wxImage &over, const wxImage &down, const wxImage &overDown, const wxImage &dis)
Definition: AButton.cpp:205
@ FrameButton
Definition: AButton.h:114
void SetIcon(const wxImage &icon)
Definition: AButton.cpp:226
void SetLabel(const TranslatableString &label)
Definition: AButton.cpp:189
wxColour & Colour(int iIndex)
wxImage & Image(int iIndex)

References ThemeBase::Colour(), AButton::FrameButton, ID_AUDIO_SETUP_BUTTON, ThemeBase::Image(), mAudioSetup, safenew, AButton::SetButtonType(), AButton::SetIcon(), AButton::SetImages(), AButton::SetLabel(), theTheme, and XO().

Referenced by Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnAudioDeviceRescan()

void AudioSetupToolBar::OnAudioDeviceRescan ( wxCommandEvent &  )
private

Definition at line 719 of file AudioSetupToolBar.cpp.

720{
722 {
724 });
725}
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:208

References BasicUI::CallAfter(), DeviceManager::Instance(), and DeviceManager::Rescan().

Referenced by OnAudioSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnAudioSetup()

void AudioSetupToolBar::OnAudioSetup ( wxCommandEvent &  event)

Definition at line 224 of file AudioSetupToolBar.cpp.

225{
226 wxMenu menu;
227
228 //i18n-hint: Audio setup menu
229 mHost.AppendSubMenu(*this, menu, &AudioSetupToolBar::OnHost, _("&Host"));
230 menu.AppendSeparator();
231
232 //i18n-hint: Audio setup menu
233 mOutput.AppendSubMenu(*this, menu,
234 &AudioSetupToolBar::OnOutput, _("&Playback Device"));
235 menu.AppendSeparator();
236
237 //i18n-hint: Audio setup menu
238 mInput.AppendSubMenu(*this, menu,
239 &AudioSetupToolBar::OnInput, _("&Recording Device"));
240 menu.AppendSeparator();
241
242 //i18n-hint: Audio setup menu
244 menu, &AudioSetupToolBar::OnChannels, _("Recording &Channels"));
245 menu.AppendSeparator();
246 menu.Append(kAudioDeviceRescan, _("R&escan Audio Devices"));
247 menu.Append(kAudioSettings, _("&Audio Settings..."));
248
249 menu.Bind(wxEVT_MENU_CLOSE, [this](auto&) { mAudioSetup->PopUp(); });
250 menu.Bind(wxEVT_MENU, &AudioSetupToolBar::OnAudioDeviceRescan, this, kAudioDeviceRescan);
251 menu.Bind(wxEVT_MENU, &AudioSetupToolBar::OnSettings, this, kAudioSettings);
252
253 wxWindow* btn = FindWindow(ID_AUDIO_SETUP_BUTTON);
254 wxRect r = btn->GetRect();
255 BasicMenu::Handle{ &menu }.Popup(
257 { r.GetLeft(), r.GetBottom() }
258 );
259}
void PopUp()
Definition: AButton.cpp:585
void AppendSubMenu(AudioSetupToolBar &toolBar, wxMenu &menu, Callback callback, const wxString &title)
void OnAudioDeviceRescan(wxCommandEvent &)
static constexpr int kAudioDeviceRescan
static constexpr int kAudioSettings
void OnSettings(wxCommandEvent &event)
void Popup(const BasicUI::WindowPlacement &window, const Point &pos={})
Display the menu at pos, invoke at most one action, then hide it.
Definition: BasicMenu.cpp:209
Window placement information for wxWidgetsBasicUI can be constructed from a wxWindow pointer.

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().

Here is the call graph for this function:

◆ OnChannels()

void AudioSetupToolBar::OnChannels ( int  id)
private

Definition at line 699 of file AudioSetupToolBar.cpp.

700{
702 // Remember 1-based value in preferences
704 CommonMenuItemSteps(false);
705}
void CommonMenuItemSteps(bool audioSettingsChosen)

References AudioIORecordChannels, CommonMenuItemSteps(), mInputChannels, AudioSetupToolBar::Choices::Set(), and Setting< T >::Write().

Referenced by OnAudioSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnFocus()

void AudioSetupToolBar::OnFocus ( wxFocusEvent &  event)

Definition at line 219 of file AudioSetupToolBar.cpp.

220{
221 KeyboardCapture::OnFocus( *this, event );
222}
void OnFocus(wxWindow &window, wxFocusEvent &event)
a function useful to implement a focus event handler The window releases the keyboard if the event is...

References KeyboardCapture::OnFocus().

Here is the call graph for this function:

◆ OnHost()

void AudioSetupToolBar::OnHost ( int  id)
private

Definition at line 693 of file AudioSetupToolBar.cpp.

694{
695 ChangeHost(id);
696 CommonMenuItemSteps(false);
697}
bool ChangeHost(int hostId)

References ChangeHost(), and CommonMenuItemSteps().

Referenced by OnAudioSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnInput()

void AudioSetupToolBar::OnInput ( int  id)
private

Definition at line 707 of file AudioSetupToolBar.cpp.

708{
709 ChangeDeviceLabel(id, mInput, true);
710 CommonMenuItemSteps(false);
711}
void ChangeDeviceLabel(int deviceId, Choices &choices, bool isInput)

References ChangeDeviceLabel(), CommonMenuItemSteps(), and mInput.

Referenced by OnAudioSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnOutput()

void AudioSetupToolBar::OnOutput ( int  id)
private

Definition at line 713 of file AudioSetupToolBar.cpp.

714{
715 ChangeDeviceLabel(id, mOutput, false);
716 CommonMenuItemSteps(false);
717}

References ChangeDeviceLabel(), CommonMenuItemSteps(), and mOutput.

Referenced by OnAudioSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRescannedDevices()

void AudioSetupToolBar::OnRescannedDevices ( DeviceChangeMessage  m)
private

Definition at line 607 of file AudioSetupToolBar.cpp.

608{
609 // Hosts may have disappeared or appeared so a complete repopulate is needed.
612}

References RepopulateMenus(), and Rescan.

Referenced by AudioSetupToolBar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSettings()

void AudioSetupToolBar::OnSettings ( wxCommandEvent &  event)
private

Definition at line 727 of file AudioSetupToolBar.cpp.

728{
730}

References CommonMenuItemSteps().

Referenced by OnAudioSetup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Populate()

void AudioSetupToolBar::Populate ( )
overridevirtual

Implements ToolBar.

Definition at line 121 of file AudioSetupToolBar.cpp.

122{
124 SetBackgroundColour( theTheme.Colour( clrMedium ) );
126
128
129#if wxUSE_TOOLTIPS
131 wxToolTip::Enable(true);
132 wxToolTip::SetDelay(1000);
133#endif
134
135 // Set default order and mode
137
139}
void RegenerateTooltips() override
static void MakeButtonBackgroundsSmall()
Definition: ToolBar.cpp:837

References ArrangeButtons(), ThemeBase::Colour(), DeinitChildren(), MakeAudioSetupButton(), ToolBar::MakeButtonBackgroundsSmall(), RegenerateTooltips(), RepopulateMenus(), and theTheme.

Here is the call graph for this function:

◆ ReCreateButtons()

void AudioSetupToolBar::ReCreateButtons ( )
overridevirtual

Reimplemented from ToolBar.

Definition at line 191 of file AudioSetupToolBar.cpp.

192{
193 bool isAudioSetupDown = false;
194
195 // ToolBar::ReCreateButtons() will get rid of its sizer and
196 // since we've attached our sizer to it, ours will get deleted too
197 // so clean ours up first.
198 if (mSizer)
199 {
200 isAudioSetupDown = mAudioSetup->IsDown();
201 Detach(mSizer);
202
203 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
204 mSizer = nullptr;
205 }
206
208
209 if (isAudioSetupDown)
210 {
212 }
213
215
217}
void PushDown()
Definition: AButton.cpp:577
bool IsDown()
Definition: AButton.h:208
void EnableDisableButtons() override
virtual void ReCreateButtons()
Definition: ToolBar.cpp:533

References ToolBar::Detach(), EnableDisableButtons(), AButton::IsDown(), mAudioSetup, mSizer, AButton::PushDown(), ToolBar::ReCreateButtons(), and RegenerateTooltips().

Here is the call graph for this function:

◆ RegenerateTooltips()

void AudioSetupToolBar::RegenerateTooltips ( )
overrideprivatevirtual

Implements ToolBar.

Definition at line 387 of file AudioSetupToolBar.cpp.

388{
389#if wxUSE_TOOLTIPS
390 for (long iWinID = ID_AUDIO_SETUP_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
391 {
392 auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
394 switch (iWinID)
395 {
397 name = wxT("Open Audio Setup");
398 break;
399 }
400 std::vector<ComponentInterfaceSymbol> commands(
401 1u, { name, Verbatim(pCtrl->GetLabel()) });
402
403 // Some have a second
404 switch (iWinID)
405 {
407 break;
408 }
410 mProject, *pCtrl, commands.data(), commands.size());
411 }
412#endif
413}
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
size_t size() const
How many attachment pointers are in the Site.
Definition: ClientData.h:260
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:970

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Repaint()

void AudioSetupToolBar::Repaint ( wxDC *  dc)
overridevirtual

Implements ToolBar.

Definition at line 141 of file AudioSetupToolBar.cpp.

142{
143#ifndef USE_AQUA_THEME
144 wxSize s = mSizer->GetSize();
145 wxPoint p = mSizer->GetPosition();
146
147 wxRect bevelRect(p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1);
148 AColor::Bevel(*dc, true, bevelRect);
149#endif
150}
static void Bevel(wxDC &dc, bool up, const wxRect &r)
Definition: AColor.cpp:266

References AColor::Bevel(), and mSizer.

Here is the call graph for this function:

◆ RepopulateMenus()

void AudioSetupToolBar::RepopulateMenus ( )
private

Definition at line 415 of file AudioSetupToolBar.cpp.

416{
417 FillHosts();
420 // make the device display selection reflect the prefs if they exist
421 UpdatePrefs();
422}
void UpdatePrefs() override

References FillHostDevices(), FillHosts(), FillInputChannels(), and UpdatePrefs().

Referenced by OnRescannedDevices(), and Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDevices()

void AudioSetupToolBar::SetDevices ( const DeviceSourceMap in,
const DeviceSourceMap out 
)
private

Definition at line 639 of file AudioSetupToolBar.cpp.

640{
641 if (in) {
644 if (in->totalSources >= 1)
646 else
648 gPrefs->Flush();
649
650 // updates mInputChannels
652 }
653
654 if (out) {
656 if (out->totalSources >= 1) {
658 } else {
660 }
661 gPrefs->Flush();
662 }
663}
StringSetting AudioIOPlaybackSource
StringSetting AudioIOPlaybackDevice
IntSetting AudioIORecordingSourceIndex
bool Reset()
Reset to the default value.
Definition: Prefs.h:284
wxString sourceString
Definition: DeviceManager.h:34
wxString deviceString
Definition: DeviceManager.h:35

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdatePrefs()

void AudioSetupToolBar::UpdatePrefs ( )
overridevirtual

Implements PrefsListener.

Definition at line 261 of file AudioSetupToolBar.cpp.

262{
263 wxString desc;
264 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
265 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
266
267 auto selectedHost = mHost.Get();
268 wxString oldHost = selectedHost ? *selectedHost : wxString{};
269
270 auto hostName = AudioIOHost.Read();
271
272 // if the prefs host name doesn't match the one displayed, it changed
273 // in another project's AudioSetupToolBar, so we need to repopulate everything.
274 if (oldHost != hostName)
275 // updates mHost and mOutput
277
278 auto devName = AudioIORecordingDevice.Read();
279 auto sourceName = AudioIORecordingSource.Read();
280 if (sourceName.empty())
281 desc = devName;
282 else
283 desc = devName + wxT(": ") + sourceName;
284
285 if (mInput.Get() && *mInput.Get() != desc) {
286 if (mInput.Set(desc))
287 // updates mInputChannels
289 else if (!mInput.Empty()) {
290 for (size_t i = 0; i < inMaps.size(); i++) {
291 if (inMaps[i].hostString == hostName &&
292 MakeDeviceSourceString(&inMaps[i]) == mInput.GetFirst()) {
293 // use the default. It should exist but check just in case, falling back on the 0 index.
294 DeviceSourceMap* defaultMap = DeviceManager::Instance()->GetDefaultInputDevice(inMaps[i].hostIndex);
295 if (defaultMap) {
296 mInput.Set(MakeDeviceSourceString(defaultMap));
297 SetDevices(defaultMap, nullptr);
298 }
299 else {
300 //use the first item (0th index) if we have no familiar devices
301 mInput.Set(0);
302 SetDevices(&inMaps[i], nullptr);
303 }
304 break;
305 }
306 }
307 }
308 }
309
310 devName = AudioIOPlaybackDevice.Read();
311 sourceName = AudioIOPlaybackSource.Read();
312 if (sourceName.empty())
313 desc = devName;
314 else
315 desc = devName + wxT(": ") + sourceName;
316
317 if (mOutput.Get() && *mOutput.Get() != desc) {
318 if (!mOutput.Set(desc) && !mOutput.Empty()) {
319 for (size_t i = 0; i < outMaps.size(); i++) {
320 if (outMaps[i].hostString == hostName &&
321 MakeDeviceSourceString(&outMaps[i]) == mOutput.GetFirst()) {
322 // use the default. It should exist but check just in case, falling back on the 0 index.
323 DeviceSourceMap* defaultMap = DeviceManager::Instance()->GetDefaultInputDevice(outMaps[i].hostIndex);
324 if (defaultMap) {
326 SetDevices(nullptr, defaultMap);
327 }
328 else {
329 //use the first item (0th index) if we have no familiar devices
330 mOutput.Set(0);
331 SetDevices(nullptr, &outMaps[i]);
332 }
333 break;
334 }
335 }
336 }
337 }
338
339 // 0 based choice id is one less than the number of channels
340 long oldChannels = 1 + mInputChannels.GetSmallIntegerId();
341
342 // Preferences store the actual number of channels
343 auto newChannels = AudioIORecordChannels.ReadWithDefault(0);
344 if (newChannels > 0 && oldChannels != newChannels)
345 mInputChannels.Set(newChannels - 1);
346
347 selectedHost = mHost.Get();
348 if (!hostName.empty() && selectedHost && *selectedHost != hostName)
349 mHost.Set(hostName);
350
352
353 // Set label to pull in language change
354 SetLabel(XO("Audio Setup"));
355
356 // Give base class a chance
358
359 Layout();
360 Refresh();
361}
DeviceSourceMap * GetDefaultInputDevice(int hostIndex)
bool ReadWithDefault(T *pVar, const T &defaultValue) const
overload of ReadWithDefault returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:213
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:408
void UpdatePrefs() override
Definition: ToolBar.cpp:622
const TranslatableString desc
Definition: ExportPCM.cpp:51

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateSelectedPrefs()

void AudioSetupToolBar::UpdateSelectedPrefs ( int  id)
overridevirtual

Reimplemented from PrefsListener.

Definition at line 363 of file AudioSetupToolBar.cpp.

364{
365 if (id == DeviceToolbarPrefsID())
366 UpdatePrefs();
368}
virtual void UpdateSelectedPrefs(int id)
Definition: Prefs.cpp:158

References DeviceToolbarPrefsID(), UpdatePrefs(), and PrefsListener::UpdateSelectedPrefs().

Here is the call graph for this function:

Member Data Documentation

◆ kAudioDeviceRescan

constexpr int AudioSetupToolBar::kAudioDeviceRescan = 15801
staticconstexprprivate

Definition at line 28 of file AudioSetupToolBar.h.

Referenced by OnAudioSetup().

◆ kAudioSettings

constexpr int AudioSetupToolBar::kAudioSettings = 15800
staticconstexprprivate

Definition at line 27 of file AudioSetupToolBar.h.

Referenced by OnAudioSetup().

◆ mAudioSetup

AButton* AudioSetupToolBar::mAudioSetup {}
private

◆ mHost

Choices AudioSetupToolBar::mHost
private

◆ mInput

Choices AudioSetupToolBar::mInput
private

◆ mInputChannels

Choices AudioSetupToolBar::mInputChannels
private

◆ mOutput

Choices AudioSetupToolBar::mOutput
private

◆ mSizer

wxBoxSizer* AudioSetupToolBar::mSizer {}
private

Definition at line 90 of file AudioSetupToolBar.h.

Referenced by ArrangeButtons(), ReCreateButtons(), and Repaint().

◆ mSubscription

Observer::Subscription AudioSetupToolBar::mSubscription
private

Definition at line 145 of file AudioSetupToolBar.h.

Referenced by AudioSetupToolBar().


The documentation for this class was generated from the following files: