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 {}
 
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 551 of file AudioSetupToolBar.cpp.

554{
555 auto subMenu = std::make_unique<wxMenu>();
556 int ii = 0;
557 for (const auto &label : labels) {
558 // Assign fresh ID with wxID_ANY
559 auto subMenuItem = subMenu->AppendRadioItem(wxID_ANY, label);
560 if (ii == checkedItem)
561 subMenuItem->Check();
562 subMenu->Bind(wxEVT_MENU,
563 [&toolbar, callback, ii](wxCommandEvent &){ (toolbar.*callback)(ii); },
564 subMenuItem->GetId());
565 ++ii;
566 }
567 auto menuItem = menu.AppendSubMenu(subMenu.release(), title);
568 if (checkedItem < 0)
569 menuItem->Enable(false);
570}
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 165 of file AudioSetupToolBar.cpp.

166{
167 Add(mAudioSetup, 0, wxALIGN_CENTER | wxALL, toolbarSpacing);
168 // Layout the toolbar
169 Layout();
170 SetMinSize(GetSizer()->GetMinSize());
171}
static constexpr auto toolbarSpacing
Preferred spacing between inner toolbar elements.
Definition: ToolBar.h:57
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

References ToolBar::Add(), ToolBar::GetSizer(), mAudioSetup, and toolbarSpacing.

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

639{
640 int newIndex = -1;
641
642 auto host = AudioIOHost.Read();
643 const std::vector<DeviceSourceMap>& maps = isInput ? DeviceManager::Instance()->GetInputDeviceMaps()
645
646 if (choices.Set(deviceId)) {
647 // Update cache with the chosen device
648 wxString newDevice = *choices.Get();
649 for (size_t i = 0; i < maps.size(); ++i) {
650 const auto name = MakeDeviceSourceString(&maps[i]);
651 if (name == newDevice && maps[i].hostString == host)
652 newIndex = i;
653 }
654 }
655
656 if (newIndex < 0) {
657 wxLogDebug(wxT("AudioSetupToolBar::ChangeDeviceLabel(): couldn't find device indices"));
658 return;
659 }
660
661 SetDevices(isInput ? &maps[newIndex] : nullptr,
662 isInput ? nullptr : &maps[newIndex]);
663}
wxT("CloseDown"))
StringSetting AudioIOHost
wxString MakeDeviceSourceString(const DeviceSourceMap *map)
wxString name
Definition: TagsEditor.cpp:166
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 587 of file AudioSetupToolBar.cpp.

588{
589 // Update cache with selected host
590 if (!mHost.Set(hostId))
591 return false;
592 auto name = mHost.Get();
593 assert(name); // should not be nullopt if Set succeeded
594
595 auto oldHost = AudioIOHost.Read();
596 const auto newHost = *name;
597
598 if (oldHost == newHost)
599 return false;
600
601 //change the host and switch to correct devices.
602 AudioIOHost.Write(newHost);
603 gPrefs->Flush();
604
605 // populate the devices and reassign mHost
607
608 return true;
609}
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 704 of file AudioSetupToolBar.cpp.

705{
706 auto gAudioIO = AudioIOBase::Get();
707 if (gAudioIO) {
708 // We cannot have gotten here if gAudioIO->IsAudioTokenActive(),
709 // per the setting of AudioIONotBusyFlag and AudioIOBusyFlag in
710 // AudacityProject::GetUpdateFlags().
711 // However, we can have an invalid audio token (so IsAudioTokenActive()
712 // is false), but be monitoring.
713 // If monitoring, have to stop the stream, so HandleDeviceChange() can work.
714 // We could disable the Preferences command while monitoring, i.e.,
715 // set AudioIONotBusyFlag/AudioIOBusyFlag according to monitoring, as well.
716 // Instead allow it because unlike recording, for example, monitoring
717 // is not clearly something that should prohibit changing device.
718 // TODO: We *could* be smarter in this method and call HandleDeviceChange()
719 // only when the device choices actually changed. True of lots of prefs!
720 // As is, we always stop monitoring before handling the device change.
721 if (gAudioIO->IsMonitoring())
722 {
723 gAudioIO->StopStream();
724 while (gAudioIO->IsBusy()) {
725 using namespace std::chrono;
726 std::this_thread::sleep_for(100ms);
727 }
728 }
729
730 if (audioSettingsChosen) {
731 PrefsPanel::Factories factories;
732 factories.push_back(PrefsPanel::PrefsNode(DevicePrefsFactory));
733
734 ViewDeviceSettingsDialog dialog(
735 &GetProjectFrame(mProject), mProject, {}, factories, 0);
736 dialog.SetSize(600, 420);
737 dialog.Center();
738
739 if (0 != dialog.ShowModal()) {
741 }
742 }
743 else {
744 gAudioIO->HandleDeviceChange();
746 }
747 }
748}
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:247

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

344{
345 auto gAudioIO = AudioIOBase::Get();
346 if (gAudioIO) {
347 // we allow changes when monitoring, but not when recording
348 bool audioStreamActive = gAudioIO->IsStreamActive() && !gAudioIO->IsMonitoring();
349
350 if (audioStreamActive) {
352 }
353 else {
355 }
356 }
357}
void Disable()
Definition: AButton.cpp:647
void Enable()
Definition: AButton.cpp:638

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

421{
422 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
423 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
424
425 //read what is in the prefs
426 auto host = AudioIOHost.Read();
427 int foundHostIndex = -1;
428
429 // if the host is not in the hosts combo then we rescanned.
430 // set it to blank so we search for another host.
431 if (mHost.Find(host) < 0)
432 host = wxT("");
433
434 // Try to find a hostIndex, among either inputs or outputs, assumed to be
435 // unique among the union of the set of input and output devices
436 for (auto & device : outMaps) {
437 if (device.hostString == host) {
438 foundHostIndex = device.hostIndex;
439 break;
440 }
441 }
442
443 if (foundHostIndex == -1) {
444 for (auto & device : inMaps) {
445 if (device.hostString == host) {
446 foundHostIndex = device.hostIndex;
447 break;
448 }
449 }
450 }
451
452 // If no host was found based on the prefs device host, load the first available one
453 if (foundHostIndex == -1) {
454 if (outMaps.size()) {
455 foundHostIndex = outMaps[0].hostIndex;
456 }
457 else if (inMaps.size()) {
458 foundHostIndex = inMaps[0].hostIndex;
459 }
460 }
461
462 // Make sure in/out are clear in case no host was found
463 mInput.Clear();
464 mOutput.Clear();
465
466 // If we still have no host it means no devices, in which case do nothing.
467 if (foundHostIndex == -1) {
468 return;
469 }
470
471 // Repopulate the Input/Output device list available to the user
472 wxArrayStringEx mInputDeviceNames;
473 for (size_t i = 0; i < inMaps.size(); ++i) {
474 auto& device = inMaps[i];
475 if (foundHostIndex == device.hostIndex) {
476 mInputDeviceNames.push_back(MakeDeviceSourceString(&device));
477 if (host.empty()) {
478 host = device.hostString;
479 AudioIOHost.Write(host);
480 mHost.Set(host);
481 }
482 }
483 }
484 mInput.Set(std::move(mInputDeviceNames));
485
486 wxArrayStringEx mOutputDeviceNames;
487 for (size_t i = 0; i < outMaps.size(); ++i) {
488 auto& device = outMaps[i];
489 if (foundHostIndex == device.hostIndex) {
490 mOutputDeviceNames.push_back(MakeDeviceSourceString(&device));
491 if (host.empty()) {
492 host = device.hostString;
493 AudioIOHost.Write(host);
494 mHost.Set(host);
495 }
496 }
497 }
498 mOutput.Set(std::move(mOutputDeviceNames));
499
500 gPrefs->Flush();
501
502 // The setting of the Device is left up to menu handlers
503}
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 396 of file AudioSetupToolBar.cpp.

397{
398 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
399 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
400
401 wxArrayString hosts;
402
403 // go over our lists add the host to the list if it isn't there yet
404
405 for (auto & device : inMaps) {
406 if (!make_iterator_range(hosts).contains(device.hostString)) {
407 hosts.push_back(device.hostString);
408 }
409 }
410
411 for (auto & device : outMaps) {
412 if (!make_iterator_range(hosts).contains(device.hostString)) {
413 hosts.push_back(device.hostString);
414 }
415 }
416
417 mHost.Set(std::move(hosts));
418}
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 505 of file AudioSetupToolBar.cpp.

506{
507 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
508 auto host = AudioIOHost.Read();
509 auto device = AudioIORecordingDevice.Read();
510 auto source = AudioIORecordingSource.Read();
511 long newChannels = 0;
512
513 auto oldChannels = AudioIORecordChannels.Read();
515
517 for (auto & dev: inMaps) {
518 if (source == dev.sourceString &&
519 device == dev.deviceString &&
520 host == dev.hostString) {
521
522 // add one selection for each channel of this source
523 for (size_t j = 0; j < (unsigned int)dev.numChannels; j++) {
524 wxString name;
525
526 if (j == 0) {
527 name = _("1 (Mono) Recording Channel");
528 }
529 else if (j == 1) {
530 name = _("2 (Stereo) Recording Channels");
531 }
532 else {
533 name = wxString::Format(wxT("%d"), (int)j + 1);
534 }
535 names.push_back(name);
536 }
537 newChannels = dev.numChannels;
538 if (oldChannels <= newChannels && oldChannels >= 1) {
539 newChannels = oldChannels;
540 }
541 AudioIORecordChannels.Write(newChannels);
542 break;
543 }
544 }
545 mInputChannels.Set(std::move(names));
546 if (newChannels >= 1)
547 // Correct to 0-based index in choice
548 mInputChannels.Set(newChannels - 1);
549}
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 146 of file AudioSetupToolBar.cpp.

147{
148 const auto size = wxSize{-1, (toolbarSingle - toolbarMargin ) * 2 };
150 //i18n-hint: Audio setup button text, keep as short as possible
151 mAudioSetup->SetLabel(XO("Audio Setup"));
154 theTheme.Image(bmpRecoloredUpSmall),
155 theTheme.Image(bmpRecoloredUpHiliteSmall),
156 theTheme.Image(bmpRecoloredDownSmall),
157 theTheme.Image(bmpRecoloredHiliteSmall),
158 theTheme.Image(bmpRecoloredUpSmall));
159 mAudioSetup->SetIcon(theTheme.Image(bmpSetup));
160 mAudioSetup->SetForegroundColour(theTheme.Colour(clrTrackPanelText));
161 mAudioSetup->SetMinSize(size);
162 mAudioSetup->SetMaxSize(size);
163}
#define safenew
Definition: MemoryX.h:10
THEME_API Theme theTheme
Definition: Theme.cpp:82
static constexpr auto toolbarSingle
Height of a single line toolbar.
Definition: ToolBar.h:53
static constexpr auto toolbarMargin
Preferred inner toolbar margin.
Definition: ToolBar.h:55
A wxButton with mouse-over behaviour.
Definition: AButton.h:104
void SetButtonType(Type type)
Definition: AButton.cpp:148
void SetImages(const wxImage &up, const wxImage &over, const wxImage &down, const wxImage &overDown, const wxImage &dis)
Definition: AButton.cpp:221
@ FrameTextVButton
Definition: AButton.h:115
void SetIcon(const wxImage &icon)
Definition: AButton.cpp:242
void SetLabel(const TranslatableString &label)
Definition: AButton.cpp:205
wxColour & Colour(int iIndex)
wxImage & Image(int iIndex)

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

Referenced by Populate().

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

692{
694 {
696 });
697}
void CallAfter(Action action)
Schedule an action to be done later, and in the main thread.
Definition: BasicUI.cpp:214

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

197{
198 wxMenu menu;
199
200 //i18n-hint: Audio setup menu
201 mHost.AppendSubMenu(*this, menu, &AudioSetupToolBar::OnHost, _("&Host"));
202 menu.AppendSeparator();
203
204 //i18n-hint: Audio setup menu
205 mOutput.AppendSubMenu(*this, menu,
206 &AudioSetupToolBar::OnOutput, _("&Playback Device"));
207 menu.AppendSeparator();
208
209 //i18n-hint: Audio setup menu
210 mInput.AppendSubMenu(*this, menu,
211 &AudioSetupToolBar::OnInput, _("&Recording Device"));
212 menu.AppendSeparator();
213
214 //i18n-hint: Audio setup menu
216 menu, &AudioSetupToolBar::OnChannels, _("Recording &Channels"));
217 menu.AppendSeparator();
218 menu.Append(kAudioDeviceRescan, _("R&escan Audio Devices"));
219 menu.Append(kAudioSettings, _("&Audio Settings..."));
220
221 menu.Bind(wxEVT_MENU_CLOSE, [this](auto&) { mAudioSetup->PopUp(); });
222 menu.Bind(wxEVT_MENU, &AudioSetupToolBar::OnAudioDeviceRescan, this, kAudioDeviceRescan);
223 menu.Bind(wxEVT_MENU, &AudioSetupToolBar::OnSettings, this, kAudioSettings);
224
225 wxWindow* btn = FindWindow(ID_AUDIO_SETUP_BUTTON);
226 wxRect r = btn->GetRect();
227 BasicMenu::Handle{ &menu }.Popup(
229 { r.GetLeft(), r.GetBottom() }
230 );
231}
void PopUp()
Definition: AButton.cpp:672
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 671 of file AudioSetupToolBar.cpp.

672{
674 // Remember 1-based value in preferences
676 CommonMenuItemSteps(false);
677}
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 191 of file AudioSetupToolBar.cpp.

192{
193 KeyboardCapture::OnFocus( *this, event );
194}
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 665 of file AudioSetupToolBar.cpp.

666{
667 ChangeHost(id);
668 CommonMenuItemSteps(false);
669}
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 679 of file AudioSetupToolBar.cpp.

680{
681 ChangeDeviceLabel(id, mInput, true);
682 CommonMenuItemSteps(false);
683}
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 685 of file AudioSetupToolBar.cpp.

686{
687 ChangeDeviceLabel(id, mOutput, false);
688 CommonMenuItemSteps(false);
689}

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

580{
581 // Hosts may have disappeared or appeared so a complete repopulate is needed.
584}

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

700{
702}

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:819

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

174{
175 const auto isAudioSetupDown = mAudioSetup != nullptr
177 : false;
178
180
181 if (isAudioSetupDown)
182 {
184 }
185
187
189}
void PushDown()
Definition: AButton.cpp:664
bool IsDown()
Definition: AButton.h:227
void EnableDisableButtons() override
virtual void ReCreateButtons()
Definition: ToolBar.cpp:533

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

Here is the call graph for this function:

◆ RegenerateTooltips()

void AudioSetupToolBar::RegenerateTooltips ( )
overrideprivatevirtual

Implements ToolBar.

Definition at line 359 of file AudioSetupToolBar.cpp.

360{
361#if wxUSE_TOOLTIPS
362 for (long iWinID = ID_AUDIO_SETUP_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
363 {
364 auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
366 switch (iWinID)
367 {
369 name = wxT("Open Audio Setup");
370 break;
371 }
372 std::vector<ComponentInterfaceSymbol> commands(
373 1u, { name, Verbatim(pCtrl->GetLabel()) });
374
375 // Some have a second
376 switch (iWinID)
377 {
379 break;
380 }
382 mProject, *pCtrl, commands.data(), commands.size());
383 }
384#endif
385}
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:934

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 // this was used to draw a bevel and can be removed
144}

◆ RepopulateMenus()

void AudioSetupToolBar::RepopulateMenus ( )
private

Definition at line 387 of file AudioSetupToolBar.cpp.

388{
389 FillHosts();
392 // make the device display selection reflect the prefs if they exist
393 UpdatePrefs();
394}
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 611 of file AudioSetupToolBar.cpp.

612{
613 if (in) {
616 if (in->totalSources >= 1)
618 else
620 gPrefs->Flush();
621
622 // updates mInputChannels
624 }
625
626 if (out) {
628 if (out->totalSources >= 1) {
630 } else {
632 }
633 gPrefs->Flush();
634 }
635}
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 233 of file AudioSetupToolBar.cpp.

234{
235 wxString desc;
236 const std::vector<DeviceSourceMap> &inMaps = DeviceManager::Instance()->GetInputDeviceMaps();
237 const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();
238
239 auto selectedHost = mHost.Get();
240 wxString oldHost = selectedHost ? *selectedHost : wxString{};
241
242 auto hostName = AudioIOHost.Read();
243
244 // if the prefs host name doesn't match the one displayed, it changed
245 // in another project's AudioSetupToolBar, so we need to repopulate everything.
246 if (oldHost != hostName)
247 // updates mHost and mOutput
249
250 auto devName = AudioIORecordingDevice.Read();
251 auto sourceName = AudioIORecordingSource.Read();
252 if (sourceName.empty())
253 desc = devName;
254 else
255 desc = devName + wxT(": ") + sourceName;
256
257 if (mInput.Get() && *mInput.Get() != desc) {
258 if (mInput.Set(desc))
259 // updates mInputChannels
261 else if (!mInput.Empty()) {
262 for (size_t i = 0; i < inMaps.size(); i++) {
263 if (inMaps[i].hostString == hostName &&
264 MakeDeviceSourceString(&inMaps[i]) == mInput.GetFirst()) {
265 // use the default. It should exist but check just in case, falling back on the 0 index.
266 DeviceSourceMap* defaultMap = DeviceManager::Instance()->GetDefaultInputDevice(inMaps[i].hostIndex);
267 if (defaultMap) {
268 mInput.Set(MakeDeviceSourceString(defaultMap));
269 SetDevices(defaultMap, nullptr);
270 }
271 else {
272 //use the first item (0th index) if we have no familiar devices
273 mInput.Set(0);
274 SetDevices(&inMaps[i], nullptr);
275 }
276 break;
277 }
278 }
279 }
280 }
281
282 devName = AudioIOPlaybackDevice.Read();
283 sourceName = AudioIOPlaybackSource.Read();
284 if (sourceName.empty())
285 desc = devName;
286 else
287 desc = devName + wxT(": ") + sourceName;
288
289 if (mOutput.Get() && *mOutput.Get() != desc) {
290 if (!mOutput.Set(desc) && !mOutput.Empty()) {
291 for (size_t i = 0; i < outMaps.size(); i++) {
292 if (outMaps[i].hostString == hostName &&
293 MakeDeviceSourceString(&outMaps[i]) == mOutput.GetFirst()) {
294 // use the default. It should exist but check just in case, falling back on the 0 index.
295 DeviceSourceMap* defaultMap = DeviceManager::Instance()->GetDefaultInputDevice(outMaps[i].hostIndex);
296 if (defaultMap) {
298 SetDevices(nullptr, defaultMap);
299 }
300 else {
301 //use the first item (0th index) if we have no familiar devices
302 mOutput.Set(0);
303 SetDevices(nullptr, &outMaps[i]);
304 }
305 break;
306 }
307 }
308 }
309 }
310
311 // 0 based choice id is one less than the number of channels
312 long oldChannels = 1 + mInputChannels.GetSmallIntegerId();
313
314 // Preferences store the actual number of channels
315 auto newChannels = AudioIORecordChannels.ReadWithDefault(0);
316 if (newChannels > 0 && oldChannels != newChannels)
317 mInputChannels.Set(newChannels - 1);
318
319 selectedHost = mHost.Get();
320 if (!hostName.empty() && selectedHost && *selectedHost != hostName)
321 mHost.Set(hostName);
322
324
325 // Set label to pull in language change
326 SetLabel(XO("Audio Setup"));
327
328 // Give base class a chance
330
331 Layout();
332 Refresh();
333}
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 335 of file AudioSetupToolBar.cpp.

336{
337 if (id == DeviceToolbarPrefsID())
338 UpdatePrefs();
340}
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

◆ mSubscription

Observer::Subscription AudioSetupToolBar::mSubscription
private

Definition at line 144 of file AudioSetupToolBar.h.

Referenced by AudioSetupToolBar().


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