Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | 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]

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)
 
- Public Member Functions inherited from ToolBar
 ToolBar (AudacityProject &project, int type, const TranslatableString &label, const wxString &section, 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 ()
 
ToolDockGetDock ()
 
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 ()
 
- 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 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 }
 

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

AButtonmAudioSetup {}
 
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

- Public Types inherited from ToolBar
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
 
wxString mSection
 
int mType
 

Detailed Description

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

Definition at line 25 of file AudioSetupToolBar.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_AUDIO_SETUP_BUTTON 
BUTTON_COUNT 

Definition at line 69 of file AudioSetupToolBar.h.

Constructor & Destructor Documentation

◆ AudioSetupToolBar()

AudioSetupToolBar::AudioSetupToolBar ( AudacityProject project)
explicit

Methods for AudioSetupToolBar.

Definition at line 84 of file AudioSetupToolBar.cpp.

85: ToolBar( project, AudioSetupBarID, XO("Audio Setup"), wxT("Audio Setup") )
86{
89}
#define XO(s)
Definition: Internat.h:31
@ AudioSetupBarID
Definition: ToolBar.h:85
void OnRescannedDevices(DeviceChangeMessage)
Observer::Subscription mSubscription
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, int type, const TranslatableString &label, const wxString &section, bool resizable=false)
Definition: ToolBar.cpp:330

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

Here is the call graph for this function:

◆ ~AudioSetupToolBar()

AudioSetupToolBar::~AudioSetupToolBar ( )
virtual

Definition at line 91 of file AudioSetupToolBar.cpp.

92{
93}

Member Function Documentation

◆ AppendSubMenu()

void AudioSetupToolBar::AppendSubMenu ( wxMenu &  menu,
const std::unique_ptr< wxMenu > &  submenu,
const wxString &  title 
)
private

Definition at line 660 of file AudioSetupToolBar.cpp.

661{
662 auto clone = CloneMenu(*submenu);
663 auto menuItem = menu.AppendSubMenu(clone.release(), title);
664
665 const auto selected = GetSelectedRadioItemLabel(*submenu);
666 if (!selected) {
667 menuItem->Enable(false);
668 }
669}
static const auto title
std::optional< wxString > GetSelectedRadioItemLabel(const wxMenu &menu) const
std::unique_ptr< wxMenu > CloneMenu(const wxMenu &menu) const

References CloneMenu(), GetSelectedRadioItemLabel(), and title.

Referenced by OnAudioSetup().

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

◆ ArrangeButtons()

void AudioSetupToolBar::ArrangeButtons ( )
private

Definition at line 193 of file AudioSetupToolBar.cpp.

194{
195 int flags = wxALIGN_CENTER | wxRIGHT;
196
197 // (Re)allocate the button sizer
198 if (mSizer)
199 {
200 Detach(mSizer);
201 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
202 }
203
204 Add((mSizer = safenew wxBoxSizer(wxHORIZONTAL)), 1, wxEXPAND);
205
206 auto text = safenew wxStaticText(this, wxID_ANY, "Audio Setup");
207 text->SetBackgroundColour(theTheme.Colour(clrMedium));
208 text->SetForegroundColour(theTheme.Colour(clrTrackPanelText));
209
210 auto vSizer = safenew wxBoxSizer(wxVERTICAL);
211 vSizer->AddSpacer(4);
212 vSizer->Add(mAudioSetup, 0, flags, 2);
213 vSizer->AddSpacer(4);
214 vSizer->Add(text, 0, flags, 2);
215
216 // Start with a little extra space
217 mSizer->Add(5, 55);
218 mSizer->Add(vSizer, 1, wxEXPAND);
219 mSizer->Add(5, 55);
220
221 // Layout the sizer
222 mSizer->Layout();
223
224 // Layout the toolbar
225 Layout();
226
227 SetMinSize(GetSizer()->GetMinSize());
228}
#define safenew
Definition: MemoryX.h:10
THEME_API Theme theTheme
Definition: Theme.cpp:82
wxColour & Colour(int iIndex)
void Add(wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL)
Definition: ToolBar.cpp:686
wxBoxSizer * GetSizer()
Definition: ToolBar.cpp:678
void Detach(wxWindow *window)
Definition: ToolBar.cpp:752

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

Referenced by Populate().

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

◆ ChangeDevice()

void AudioSetupToolBar::ChangeDevice ( int  deviceId,
bool  isInput 
)
private

Definition at line 741 of file AudioSetupToolBar.cpp.

742{
743 int newIndex = -1;
744 auto& device = isInput ? mInput : mOutput;
745
746 auto host = AudioIOHost.Read();
747 const std::vector<DeviceSourceMap>& maps = isInput ? DeviceManager::Instance()->GetInputDeviceMaps()
749
750 auto item = device->FindChildItem(deviceId);
751 if (item) {
752 // Update cache with the chosen device
753 item->Check();
754 wxString newDevice = item->GetItemLabelText();
755
756 for (size_t i = 0; i < maps.size(); ++i) {
757 wxString name = MakeDeviceSourceString(&maps[i]);
758 if (name == newDevice && maps[i].hostString == host) {
759 newIndex = i;
760 }
761 }
762 }
763
764 if (newIndex < 0) {
765 wxLogDebug(wxT("AudioSetupToolBar::OnMenu(): couldn't find device indices"));
766 return;
767 }
768
769 SetDevices(isInput ? &maps[newIndex] : nullptr,
770 isInput ? nullptr : &maps[newIndex]);
771}
StringSetting AudioIOHost
wxString MakeDeviceSourceString(const DeviceSourceMap *map)
const TranslatableString name
Definition: Distortion.cpp:82
void SetDevices(const DeviceSourceMap *in, const DeviceSourceMap *out)
std::unique_ptr< wxMenu > mInput
std::unique_ptr< wxMenu > mOutput
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:200

References AudioIOHost, DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), MakeDeviceSourceString(), mInput, mOutput, name, Setting< T >::Read(), and SetDevices().

Referenced by OnMenu().

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 691 of file AudioSetupToolBar.cpp.

692{
693 auto item = mHost->FindChildItem(hostId);
694 if (!item)
695 return false;
696
697 // Update cache with selected host
698 item->Check();
699
700 auto oldHost = AudioIOHost.Read();
701 wxString newHost = item->GetItemLabelText();
702
703 if (oldHost == newHost)
704 return false;
705
706 //change the host and switch to correct devices.
707 AudioIOHost.Write(newHost);
708 gPrefs->Flush();
709
710 // populate the devices
712
713 return true;
714}
FileConfig * gPrefs
Definition: Prefs.cpp:71
std::unique_ptr< wxMenu > mHost
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
bool Write(const T &value)
Write value to config and return true if successful.
Definition: Prefs.h:252

References AudioIOHost, FillHostDevices(), FileConfig::Flush(), gPrefs, mHost, Setting< T >::Read(), and Setting< T >::Write().

Referenced by OnMenu().

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

◆ CloneMenu()

std::unique_ptr< wxMenu > AudioSetupToolBar::CloneMenu ( const wxMenu &  menu) const
private

Definition at line 646 of file AudioSetupToolBar.cpp.

647{
648 auto clonedMenu = std::make_unique<wxMenu>();
649
650 for (const auto& item : menu.GetMenuItems()) {
651 auto cloneMenuItem = clonedMenu->AppendRadioItem(item->GetId(), item->GetItemLabelText());
652
653 if (item->IsChecked())
654 cloneMenuItem->Check();
655 }
656
657 return clonedMenu;
658}

Referenced by AppendSubMenu().

Here is the caller graph for this function:

◆ Create()

void AudioSetupToolBar::Create ( wxWindow *  parent)
overridevirtual

Reimplemented from ToolBar.

Definition at line 106 of file AudioSetupToolBar.cpp.

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

References ToolBar::Create().

Here is the call graph for this function:

◆ DeinitChildren()

void AudioSetupToolBar::DeinitChildren ( )

Definition at line 116 of file AudioSetupToolBar.cpp.

117{
118 mInput.reset();
119 mOutput.reset();
120 mInputChannels.reset();
121 mHost.reset();
122}
std::unique_ptr< wxMenu > mInputChannels

References mHost, mInput, mInputChannels, and mOutput.

Referenced by Populate().

Here is the caller graph for this function:

◆ EnableDisableButtons()

void AudioSetupToolBar::EnableDisableButtons ( )
overridevirtual

Implements ToolBar.

Definition at line 429 of file AudioSetupToolBar.cpp.

430{
431 auto gAudioIO = AudioIOBase::Get();
432 if (gAudioIO) {
433 // we allow changes when monitoring, but not when recording
434 bool audioStreamActive = gAudioIO->IsStreamActive() && !gAudioIO->IsMonitoring();
435
436 if (audioStreamActive) {
438 }
439 else {
441 }
442 }
443}
void Disable()
Definition: AButton.cpp:580
void Enable()
Definition: AButton.cpp:571
static AudioIOBase * Get()
Definition: AudioIOBase.cpp:91

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 509 of file AudioSetupToolBar.cpp.

510{
511 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
512 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
513
514 //read what is in the prefs
515 auto host = AudioIOHost.Read();
516 int foundHostIndex = -1;
517
518 // if the host is not in the hosts combo then we rescanned.
519 // set it to blank so we search for another host.
520 if (mHost->FindItem(host) == wxNOT_FOUND) {
521 host = wxT("");
522 }
523
524 for (auto & device : outMaps) {
525 if (device.hostString == host) {
526 foundHostIndex = device.hostIndex;
527 break;
528 }
529 }
530
531 if (foundHostIndex == -1) {
532 for (auto & device : inMaps) {
533 if (device.hostString == host) {
534 foundHostIndex = device.hostIndex;
535 break;
536 }
537 }
538 }
539
540 // If no host was found based on the prefs device host, load the first available one
541 if (foundHostIndex == -1) {
542 if (outMaps.size()) {
543 foundHostIndex = outMaps[0].hostIndex;
544 }
545 else if (inMaps.size()) {
546 foundHostIndex = inMaps[0].hostIndex;
547 }
548 }
549
550 // Make sure in/out are clear in case no host was found
551 mInput = std::make_unique<wxMenu>();
552 mOutput = std::make_unique<wxMenu>();
553
554 // If we still have no host it means no devices, in which case do nothing.
555 if (foundHostIndex == -1) {
556 return;
557 }
558
559 // Repopulate the Input/Output device list available to the user
560 for (int nextMenuId = kInput, i = 0; i < inMaps.size(); ++i) {
561 auto& device = inMaps[i];
562
563 if (foundHostIndex == device.hostIndex) {
564 mInput->AppendRadioItem(nextMenuId, MakeDeviceSourceString(&device));
565 nextMenuId++;
566
567 if (host.empty()) {
568 host = device.hostString;
569 AudioIOHost.Write(host);
570
571 const auto id = mHost->FindItem(host);
572 if (id != wxNOT_FOUND) {
573 mHost->FindChildItem(id)->Check();
574 }
575 }
576 }
577 }
578
579 for (int nextMenuId = kOutput, i = 0; i < outMaps.size(); ++i) {
580 auto& device = outMaps[i];
581
582 if (foundHostIndex == device.hostIndex) {
583 mOutput->AppendRadioItem(nextMenuId, MakeDeviceSourceString(&device));
584 nextMenuId++;
585
586 if (host.empty()) {
587 host = device.hostString;
588 AudioIOHost.Write(host);
589 gPrefs->Flush();
590
591 const auto id = mHost->FindItem(host);
592 if (id != wxNOT_FOUND) {
593 mHost->FindChildItem(id)->Check();
594 }
595 }
596 }
597 }
598
599 // The setting of the Device is left up to OnMenu
600}

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

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

◆ FillHosts()

void AudioSetupToolBar::FillHosts ( )
private

Definition at line 482 of file AudioSetupToolBar.cpp.

483{
484 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
485 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
486
487 wxArrayString hosts;
488
489 // go over our lists add the host to the list if it isn't there yet
490
491 for (auto & device : inMaps) {
492 if (!make_iterator_range(hosts).contains(device.hostString)) {
493 hosts.push_back(device.hostString);
494 }
495 }
496
497 for (auto & device : outMaps) {
498 if (!make_iterator_range(hosts).contains(device.hostString)) {
499 hosts.push_back(device.hostString);
500 }
501 }
502
503 mHost = std::make_unique<wxMenu>();
504
505 for (int i = 0; i < hosts.size(); ++i)
506 mHost->AppendRadioItem(kHost + i, hosts[i]);
507}
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:423

References DeviceManager::GetInputDeviceMaps(), DeviceManager::GetOutputDeviceMaps(), DeviceManager::Instance(), anonymous_namespace{AudioSetupToolBar.cpp}::kHost, make_iterator_range(), and mHost.

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 602 of file AudioSetupToolBar.cpp.

603{
604 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
605 auto host = AudioIOHost.Read();
606 auto device = AudioIORecordingDevice.Read();
607 auto source = AudioIORecordingSource.Read();
608 long newChannels;
609
610 auto oldChannels = AudioIORecordChannels.Read();
611 mInputChannels = std::make_unique<wxMenu>();
612
613 for (auto & dev: inMaps) {
614 if (source == dev.sourceString &&
615 device == dev.deviceString &&
616 host == dev.hostString) {
617
618 // add one selection for each channel of this source
619 for (size_t j = 0; j < (unsigned int)dev.numChannels; j++) {
620 wxString name;
621
622 if (j == 0) {
623 name = _("1 (Mono) Recording Channel");
624 }
625 else if (j == 1) {
626 name = _("2 (Stereo) Recording Channels");
627 }
628 else {
629 name = wxString::Format(wxT("%d"), (int)j + 1);
630 }
631 mInputChannels->AppendRadioItem(kInputChannels + j, name);
632 }
633 newChannels = dev.numChannels;
634 if (oldChannels <= newChannels && oldChannels >= 1) {
635 newChannels = oldChannels;
636 }
637 if (newChannels >= 1) {
638 mInputChannels->FindItem(kInputChannels + newChannels - 1)->Check();
639 }
640 AudioIORecordChannels.Write(newChannels);
641 break;
642 }
643 }
644}
StringSetting AudioIORecordingSource
StringSetting AudioIORecordingDevice
IntSetting AudioIORecordChannels
#define _(s)
Definition: Internat.h:75

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

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 95 of file AudioSetupToolBar.cpp.

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

References AudioSetupBarID, and ToolManager::Get().

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 101 of file AudioSetupToolBar.cpp.

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

References Get().

Here is the call graph for this function:

◆ GetSelectedRadioItemLabel()

std::optional< wxString > AudioSetupToolBar::GetSelectedRadioItemLabel ( const wxMenu &  menu) const
private

Definition at line 671 of file AudioSetupToolBar.cpp.

672{
673 const auto& items = menu.GetMenuItems();
674
675 for (const auto& item : items) {
676 if (item->IsChecked())
677 return item->GetItemLabelText();
678 }
679
680 return std::nullopt;
681}

Referenced by AppendSubMenu(), and UpdatePrefs().

Here is the caller graph for this function:

◆ MakeAudioSetupButton()

void AudioSetupToolBar::MakeAudioSetupButton ( )
private

Definition at line 154 of file AudioSetupToolBar.cpp.

155{
156 bool bUseAqua = false;
157
158#ifdef EXPERIMENTAL_THEME_PREFS
159 gPrefs->Read(wxT("/GUI/ShowMac"), &bUseAqua, false);
160#endif
161
162#ifdef USE_AQUA_THEME
163 bUseAqua = !bUseAqua;
164#endif
165
166 const auto size = theTheme.ImageSize(bmpRecoloredSetupUpSmall);
167
168 if (bUseAqua) {
169 MakeMacRecoloredImageSize(bmpRecoloredSetupUpSmall, bmpMacUpButtonSmall, size);
170 MakeMacRecoloredImageSize(bmpRecoloredSetupDownSmall, bmpMacDownButtonSmall, size);
171 MakeMacRecoloredImageSize(bmpRecoloredSetupUpHiliteSmall, bmpMacHiliteUpButtonSmall, size);
172 MakeMacRecoloredImageSize(bmpRecoloredSetupHiliteSmall, bmpMacHiliteButtonSmall, size);
173 }
174 else {
175 MakeRecoloredImageSize(bmpRecoloredSetupUpSmall, bmpUpButtonSmall, size);
176 MakeRecoloredImageSize(bmpRecoloredSetupDownSmall, bmpDownButtonSmall, size);
177 MakeRecoloredImageSize(bmpRecoloredSetupUpHiliteSmall, bmpHiliteUpButtonSmall, size);
178 MakeRecoloredImageSize(bmpRecoloredSetupHiliteSmall, bmpHiliteButtonSmall, size);
179 }
180
181 mAudioSetup = MakeButton(this,
182 bmpRecoloredSetupUpSmall, bmpRecoloredSetupDownSmall,
183 bmpRecoloredSetupUpHiliteSmall, bmpRecoloredSetupHiliteSmall,
184 bmpSetup, bmpSetup, bmpSetup,
186 wxDefaultPosition,
187 true,
188 theTheme.ImageSize(bmpRecoloredSetupUpSmall));
189
190 mAudioSetup->SetLabel(XO("Audio Setup"));
191}
void SetLabel(const TranslatableString &label)
Definition: AButton.cpp:274
wxSize ImageSize(int iIndex)
static void MakeRecoloredImageSize(teBmps eBmpOut, teBmps eBmpIn, const wxSize &size)
Definition: ToolBar.cpp:782
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)
Definition: ToolBar.cpp:852
static void MakeMacRecoloredImageSize(teBmps eBmpOut, teBmps eBmpIn, const wxSize &size)
Definition: ToolBar.cpp:770

References gPrefs, ID_AUDIO_SETUP_BUTTON, ThemeBase::ImageSize(), ToolBar::MakeButton(), ToolBar::MakeMacRecoloredImageSize(), ToolBar::MakeRecoloredImageSize(), mAudioSetup, AButton::SetLabel(), size, theTheme, and XO.

Referenced by Populate().

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 263 of file AudioSetupToolBar.cpp.

264{
265 // Be sure the pop-up happens even if there are exceptions, except for buttons which toggle.
266 auto cleanup = finally([&] { mAudioSetup->InteractionOver(); });
267
268 wxMenu menu;
269
270 AppendSubMenu(menu, mHost, "&Host");
271 menu.AppendSeparator();
272
273 AppendSubMenu(menu, mOutput, "&Playback Device");
274 menu.AppendSeparator();
275
276 AppendSubMenu(menu, mInput, "&Recording Device");
277 menu.AppendSeparator();
278
279 AppendSubMenu(menu, mInputChannels, "Recording &Channels");
280 menu.AppendSeparator();
281 menu.Append(kAudioSettings, _("&Audio Settings..."));
282
283 menu.Bind(wxEVT_MENU_CLOSE, [this](auto&) { mAudioSetup->PopUp(); });
284 menu.Bind(wxEVT_MENU, &AudioSetupToolBar::OnMenu, this);
285
286 wxWindow* btn = FindWindow(ID_AUDIO_SETUP_BUTTON);
287 wxRect r = btn->GetRect();
288 BasicMenu::Handle{ &menu }.Popup(
290 { r.GetLeft(), r.GetBottom() }
291 );
292}
void InteractionOver()
Definition: AButton.h:122
void PopUp()
Definition: AButton.cpp:605
void OnMenu(wxCommandEvent &event)
void AppendSubMenu(wxMenu &menu, const std::unique_ptr< wxMenu > &submenu, const wxString &title)
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 _, AppendSubMenu(), ID_AUDIO_SETUP_BUTTON, AButton::InteractionOver(), anonymous_namespace{AudioSetupToolBar.cpp}::kAudioSettings, mAudioSetup, mHost, mInput, mInputChannels, mOutput, OnMenu(), AButton::PopUp(), and BasicMenu::Handle::Popup().

Here is the call graph for this function:

◆ OnFocus()

void AudioSetupToolBar::OnFocus ( wxFocusEvent &  event)

Definition at line 258 of file AudioSetupToolBar.cpp.

259{
260 KeyboardCapture::OnFocus( *this, event );
261}
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:

◆ OnMenu()

void AudioSetupToolBar::OnMenu ( wxCommandEvent &  event)
private

Definition at line 773 of file AudioSetupToolBar.cpp.

774{
775 int id = event.GetId();
776 bool audioSettingsChosen = false;
777
778 if ((id >= kHost) && (id < kInput)) {
779 ChangeHost(id);
780 }
781 else if ((id >= kInputChannels) && (id < kOutput)) {
782 if (auto item = mInputChannels->FindChildItem(id)) {
783 // Update cache with selected number of input channels
784 item->Check();
786 }
787 }
788 else if ((id >= kInput) && (id < kInputChannels)) {
789 ChangeDevice(id, true);
790 }
791 else if ((id >= kOutput) && (id < kAudioSettings)) {
792 ChangeDevice(id, false);
793 }
794 else if (id == kAudioSettings) {
795 audioSettingsChosen = true;
796 }
797
798 auto gAudioIO = AudioIOBase::Get();
799 if (gAudioIO) {
800 // We cannot have gotten here if gAudioIO->IsAudioTokenActive(),
801 // per the setting of AudioIONotBusyFlag and AudioIOBusyFlag in
802 // AudacityProject::GetUpdateFlags().
803 // However, we can have an invalid audio token (so IsAudioTokenActive()
804 // is false), but be monitoring.
805 // If monitoring, have to stop the stream, so HandleDeviceChange() can work.
806 // We could disable the Preferences command while monitoring, i.e.,
807 // set AudioIONotBusyFlag/AudioIOBusyFlag according to monitoring, as well.
808 // Instead allow it because unlike recording, for example, monitoring
809 // is not clearly something that should prohibit changing device.
810 // TODO: We *could* be smarter in this method and call HandleDeviceChange()
811 // only when the device choices actually changed. True of lots of prefs!
812 // As is, we always stop monitoring before handling the device change.
813 if (gAudioIO->IsMonitoring())
814 {
815 gAudioIO->StopStream();
816 while (gAudioIO->IsBusy()) {
817 using namespace std::chrono;
818 std::this_thread::sleep_for(100ms);
819 }
820 }
821
822 if (audioSettingsChosen) {
823 PrefsPanel::Factories factories;
824 factories.push_back(PrefsPanel::PrefsNode(DevicePrefsFactory));
825
826 ViewDeviceSettingsDialog dialog(&GetProjectFrame(mProject), mProject, XO("Audio Settings:"), factories, 0);
827 dialog.SetSize(600, 420);
828 dialog.Center();
829
830 if (0 != dialog.ShowModal()) {
832 }
833 }
834 else {
835 gAudioIO->HandleDeviceChange();
837 }
838 }
839}
PrefsPanel * DevicePrefsFactory(wxWindow *parent, wxWindowID winid, AudacityProject *)
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 ...
void ChangeDevice(int deviceId, bool isInput)
bool ChangeHost(int hostId)
static void Broadcast(int id=0)
Call this static function to notify all PrefsListener objects.
Definition: Prefs.cpp:98
std::vector< PrefsPanel::PrefsNode > Factories
Definition: PrefsPanel.h:69
AudacityProject & mProject
Definition: ToolBar.h:247

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

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 683 of file AudioSetupToolBar.cpp.

684{
685 // Hosts may have disappeared or appeared so a complete repopulate is needed.
688}

References RepopulateMenus(), and Rescan.

Referenced by AudioSetupToolBar().

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 124 of file AudioSetupToolBar.cpp.

125{
126 SetBackgroundColour( theTheme.Colour( clrMedium ) );
128
130
131#if wxUSE_TOOLTIPS
133 wxToolTip::Enable(true);
134 wxToolTip::SetDelay(1000);
135#endif
136
137 // Set default order and mode
139
141}
void RegenerateTooltips() override

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

Here is the call graph for this function:

◆ ReCreateButtons()

void AudioSetupToolBar::ReCreateButtons ( )
overridevirtual

Reimplemented from ToolBar.

Definition at line 230 of file AudioSetupToolBar.cpp.

231{
232 bool isAudioSetupDown = false;
233
234 // ToolBar::ReCreateButtons() will get rid of its sizer and
235 // since we've attached our sizer to it, ours will get deleted too
236 // so clean ours up first.
237 if (mSizer)
238 {
239 isAudioSetupDown = mAudioSetup->IsDown();
240 Detach(mSizer);
241
242 std::unique_ptr < wxSizer > {mSizer}; // DELETE it
243 mSizer = nullptr;
244 }
245
247
248 if (isAudioSetupDown)
249 {
251 }
252
254
256}
void PushDown()
Definition: AButton.cpp:597
bool IsDown()
Definition: AButton.h:113
void EnableDisableButtons() override
virtual void ReCreateButtons()
Definition: ToolBar.cpp:516

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 445 of file AudioSetupToolBar.cpp.

446{
447#if wxUSE_TOOLTIPS
448 for (long iWinID = ID_AUDIO_SETUP_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
449 {
450 auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
452 switch (iWinID)
453 {
455 name = wxT("Open Audio Setup");
456 break;
457 }
458 std::vector<ComponentInterfaceSymbol> commands(
459 1u, { name, Verbatim(pCtrl->GetLabel()) });
460
461 // Some have a second
462 switch (iWinID)
463 {
465 break;
466 }
468 mProject, *pCtrl, commands.data(), commands.size());
469 }
470#endif
471}
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
A wxButton with mouse-over behaviour.
Definition: AButton.h:25
size_t size() const
How many attachment pointers are in the Site.
Definition: ClientData.h:251
static void SetButtonToolTip(AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands)
Definition: ToolBar.cpp:947

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

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 143 of file AudioSetupToolBar.cpp.

144{
145#ifndef USE_AQUA_THEME
146 wxSize s = mSizer->GetSize();
147 wxPoint p = mSizer->GetPosition();
148
149 wxRect bevelRect(p.x, p.y, s.GetWidth() - 1, s.GetHeight() - 1);
150 AColor::Bevel(*dc, true, bevelRect);
151#endif
152}
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 473 of file AudioSetupToolBar.cpp.

474{
475 FillHosts();
478 // make the device display selection reflect the prefs if they exist
479 UpdatePrefs();
480}
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 716 of file AudioSetupToolBar.cpp.

717{
718 if (in) {
721 if (in->totalSources >= 1)
723 else
725 gPrefs->Flush();
726
728 }
729
730 if (out) {
732 if (out->totalSources >= 1) {
734 } else {
736 }
737 gPrefs->Flush();
738 }
739}
StringSetting AudioIOPlaybackSource
StringSetting AudioIOPlaybackDevice
IntSetting AudioIORecordingSourceIndex
bool Reset()
Reset to the default value.
Definition: Prefs.h:277
wxString sourceString
Definition: DeviceManager.h:34
wxString deviceString
Definition: DeviceManager.h:35

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

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 294 of file AudioSetupToolBar.cpp.

295{
296 wxString desc;
297 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
298 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
299
300 auto selectedHost = GetSelectedRadioItemLabel(*mHost);
301 wxString oldHost = selectedHost ? *selectedHost : wxString{};
302
303 auto hostName = AudioIOHost.Read();
304
305 // if the prefs host name doesn't match the one displayed, it changed
306 // in another project's AudioSetupToolBar, so we need to repopulate everything.
307 if (oldHost != hostName)
309
310 auto devName = AudioIORecordingDevice.Read();
311 auto sourceName = AudioIORecordingSource.Read();
312 if (sourceName.empty())
313 desc = devName;
314 else
315 desc = devName + wxT(": ") + sourceName;
316
317 auto selectedInput = GetSelectedRadioItemLabel(*mInput);
318 if (selectedInput && *selectedInput != desc) {
319 if (auto item = mInput->FindItem(desc); item != wxNOT_FOUND) {
320 mInput->FindChildItem(item)->Check();
322 }
323 else if (mInput->GetMenuItemCount()) {
324 for (size_t i = 0; i < inMaps.size(); i++) {
325 if (inMaps[i].hostString == hostName &&
326 MakeDeviceSourceString(&inMaps[i]) == mInput->FindItem(kInput)->GetItemLabelText()) {
327 // use the default. It should exist but check just in case, falling back on the 0 index.
328 DeviceSourceMap* defaultMap = DeviceManager::Instance()->GetDefaultInputDevice(inMaps[i].hostIndex);
329 if (defaultMap) {
330 const auto menuId = mInput->FindItem(MakeDeviceSourceString(defaultMap));
331 auto item = mInput->FindChildItem(menuId);
332 if (item)
333 item->Check();
334
335 SetDevices(defaultMap, nullptr);
336 }
337 else {
338 //use the first item (0th index) if we have no familiar devices
339 auto item = mInput->FindChildItem(kInput);
340 if (item)
341 item->Check();
342
343 SetDevices(&inMaps[i], nullptr);
344 }
345 break;
346 }
347 }
348 }
349 }
350
351 devName = AudioIOPlaybackDevice.Read();
352 sourceName = AudioIOPlaybackSource.Read();
353 if (sourceName.empty())
354 desc = devName;
355 else
356 desc = devName + wxT(": ") + sourceName;
357
358 auto selectedOutput = GetSelectedRadioItemLabel(*mOutput);
359 if (selectedOutput && *selectedOutput != desc) {
360 if (auto item = mOutput->FindItem(desc); item != wxNOT_FOUND) {
361 mOutput->FindChildItem(item)->Check();
362 }
363 else if (mOutput->GetMenuItemCount()) {
364 for (size_t i = 0; i < outMaps.size(); i++) {
365 if (outMaps[i].hostString == hostName &&
366 MakeDeviceSourceString(&outMaps[i]) == mOutput->FindItem(kOutput)->GetItemLabelText()) {
367 // use the default. It should exist but check just in case, falling back on the 0 index.
368 DeviceSourceMap* defaultMap = DeviceManager::Instance()->GetDefaultInputDevice(outMaps[i].hostIndex);
369 if (defaultMap) {
370 const auto menuId = mOutput->FindItem(MakeDeviceSourceString(defaultMap));
371 auto item = mOutput->FindChildItem(menuId);
372 if (item)
373 item->Check();
374
375 SetDevices(nullptr, defaultMap);
376 }
377 else {
378 //use the first item (0th index) if we have no familiar devices
379 auto item = mOutput->FindChildItem(kOutput);
380 if (item)
381 item->Check();
382
383 SetDevices(nullptr, &outMaps[i]);
384 }
385 break;
386 }
387 }
388 }
389 }
390
391 long oldChannels;
392 for (const auto & item : mInputChannels->GetMenuItems()) {
393 if (item->IsChecked())
394 oldChannels = item->GetId() - kInputChannels + 1;
395 }
396
397 auto newChannels = AudioIORecordChannels.ReadWithDefault(0);
398 if (newChannels > 0 && oldChannels != newChannels)
399 mInputChannels->FindChildItem(kInputChannels + newChannels - 1)->Check();
400
401 selectedHost = GetSelectedRadioItemLabel(*mHost);
402 if (!hostName.empty() && selectedHost && selectedHost != hostName) {
403 const auto id = mHost->FindItem(hostName);
404 if (id != wxNOT_FOUND) {
405 mHost->FindChildItem(id)->Check();
406 }
407 }
408
410
411 // Set label to pull in language change
412 SetLabel(XO("Audio Setup"));
413
414 // Give base class a chance
416
417 Layout();
418 Refresh();
419}
const TranslatableString desc
Definition: ExportPCM.cpp:58
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:206
void SetLabel(const wxString &label) override
Definition: ToolBar.cpp:398
void UpdatePrefs() override
Definition: ToolBar.cpp:605

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

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 421 of file AudioSetupToolBar.cpp.

422{
423 if (id == DeviceToolbarPrefsID())
424 UpdatePrefs();
426}
virtual void UpdateSelectedPrefs(int id)
Definition: Prefs.cpp:128

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

Here is the call graph for this function:

Member Data Documentation

◆ mAudioSetup

AButton* AudioSetupToolBar::mAudioSetup {}
private

◆ mHost

std::unique_ptr<wxMenu> AudioSetupToolBar::mHost
private

◆ mInput

std::unique_ptr<wxMenu> AudioSetupToolBar::mInput
private

◆ mInputChannels

std::unique_ptr<wxMenu> AudioSetupToolBar::mInputChannels
private

◆ mOutput

std::unique_ptr<wxMenu> AudioSetupToolBar::mOutput
private

◆ mSizer

wxBoxSizer* AudioSetupToolBar::mSizer {}
private

Definition at line 75 of file AudioSetupToolBar.h.

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

◆ mSubscription

Observer::Subscription AudioSetupToolBar::mSubscription
private

Definition at line 82 of file AudioSetupToolBar.h.


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