Audacity 3.2.0
DeviceToolBar.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 DeviceToolbar.h
6
7 Dominic Mazzoni
8
9**********************************************************************/
10
11#ifndef __AUDACITY_DEVICE_TOOLBAR__
12#define __AUDACITY_DEVICE_TOOLBAR__
13
14#include <vector>
15#include "ToolBar.h"
16#include "Observer.h"
17
18enum class DeviceChangeMessage : char;
19
20class wxSize;
21class wxPoint;
22class wxChoice;
23struct DeviceSourceMap;
24
25class AudacityProject;
26
27class DeviceToolBar final : public ToolBar {
28
29 public:
30
31 static Identifier ID();
32
34 virtual ~DeviceToolBar();
35
36 bool ShownByDefault() const override;
37
39 static const DeviceToolBar &Get( const AudacityProject &project );
40
41 void Create(wxWindow * parent) override;
42
43 void UpdatePrefs() override;
44 void UpdateSelectedPrefs( int ) override;
45
46 void DeinitChildren();
47 void Populate() override;
48 void Repaint(wxDC * WXUNUSED(dc)) override {};
49 void EnableDisableButtons() override;
50 void OnFocus(wxFocusEvent &event);
51 void OnCaptureKey(wxCommandEvent &event);
52
53 void OnChoice(wxCommandEvent & event);
54
57 int GetInitialWidth() override{ return 883; }
58 int GetMinToolbarWidth() override { return 350; }
59
60 void ShowInputDialog();
61 void ShowOutputDialog();
62 void ShowHostDialog();
63 void ShowChannelsDialog();
64
65 private:
67
68 int ChangeHost();
69 void ChangeDevice(bool isInput);
70 void RefillCombos();
71 void FillHosts();
72 void FillHostDevices();
73 void FillInputChannels();
74 void SetDevices(const DeviceSourceMap *in, const DeviceSourceMap *out);
75 void SetNames();
76 void RegenerateTooltips() override;
77 void ShowComboDialog(wxChoice *combo, const TranslatableString &title);
78
79 wxChoice *mInput;
80 wxChoice *mOutput;
81 wxChoice *mInputChannels;
82 wxChoice *mHost;
83
85
86 public:
87
88 DECLARE_CLASS(DeviceToolBar)
89 DECLARE_EVENT_TABLE()
90};
91
93
94#endif
95
DeviceChangeMessage
Definition: DeviceChange.h:16
int DeviceToolbarPrefsID()
Methods for DeviceToolBar.
static const auto title
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
A toobar to allow easier changing of input and output devices .
Definition: DeviceToolBar.h:27
wxChoice * mOutput
Definition: DeviceToolBar.h:80
void FillInputChannels()
void ShowOutputDialog()
void Populate() override
void ShowChannelsDialog()
void OnCaptureKey(wxCommandEvent &event)
void SetDevices(const DeviceSourceMap *in, const DeviceSourceMap *out)
void RegenerateTooltips() override
wxChoice * mHost
Definition: DeviceToolBar.h:82
wxChoice * mInputChannels
Definition: DeviceToolBar.h:81
void EnableDisableButtons() override
int GetInitialWidth() override
Definition: DeviceToolBar.h:57
void OnFocus(wxFocusEvent &event)
void ShowComboDialog(wxChoice *combo, const TranslatableString &title)
Observer::Subscription mSubscription
Definition: DeviceToolBar.h:84
void ChangeDevice(bool isInput)
bool ShownByDefault() const override
Whether the toolbar should be shown by default. Default implementation returns true.
void UpdateSelectedPrefs(int) override
void FillHostDevices()
static DeviceToolBar & Get(AudacityProject &project)
void ShowInputDialog()
int GetMinToolbarWidth() override
Definition: DeviceToolBar.h:58
static Identifier ID()
wxChoice * mInput
Definition: DeviceToolBar.h:79
void OnRescannedDevices(DeviceChangeMessage)
DeviceToolBar(AudacityProject &project)
virtual ~DeviceToolBar()
void UpdatePrefs() override
void Create(wxWindow *parent) override
void OnChoice(wxCommandEvent &event)
void Repaint(wxDC *WXUNUSED(dc)) override
Definition: DeviceToolBar.h:48
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:73
Holds a msgid for the translation catalog; may also bind format arguments.