Audacity  2.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 "../MemoryX.h"
15 #include <vector>
16 #include "ToolBar.h"
17 
18 class wxImage;
19 class wxSize;
20 class wxPoint;
21 class wxChoice;
22 class wxStaticText;
23 struct DeviceSourceMap;
24 
25 class DeviceToolBar final : public ToolBar {
26 
27  public:
28 
29  DeviceToolBar();
30  virtual ~DeviceToolBar();
31 
32  void Create(wxWindow * parent) override;
33 
34  void UpdatePrefs() override;
35 
36  void DeinitChildren();
37  void Populate() override;
38  void Repaint(wxDC * WXUNUSED(dc)) override {};
39  void EnableDisableButtons() override;
40  bool Layout() override;
41  void OnFocus(wxFocusEvent &event);
42  void OnCaptureKey(wxCommandEvent &event);
43 
44  void OnChoice(wxCommandEvent & event);
45 
48  int GetInitialWidth() override{ return 620; }
49  int GetMinToolbarWidth() override { return 200; }
50 
51  void ShowInputDialog();
52  void ShowOutputDialog();
53  void ShowHostDialog();
54  void ShowChannelsDialog();
55 
56  void RefillCombos();
57 
58  private:
59  int ChangeHost();
60  void ChangeDevice(bool isInput);
61  void FillHosts();
62  void FillHostDevices();
63  void FillInputChannels();
64  void SetDevices(const DeviceSourceMap *in, const DeviceSourceMap *out);
65  void RepositionCombos();
66  void SetNames();
67  void RegenerateTooltips() override;
68  void ShowComboDialog(wxChoice *combo, const wxString &title);
69 
70  wxChoice *mInput;
71  wxChoice *mOutput;
72  wxChoice *mInputChannels;
73  wxChoice *mHost;
74 
75  public:
76 
77  DECLARE_CLASS(DeviceToolBar)
78  DECLARE_EVENT_TABLE()
79 };
80 
81 #endif
82 
void Populate() override
Definition: DeviceToolBar.cpp:86
void FillHostDevices()
Definition: DeviceToolBar.cpp:501
void RegenerateTooltips() override
Definition: DeviceToolBar.cpp:344
wxChoice * mInputChannels
Definition: DeviceToolBar.h:72
void OnChoice(wxCommandEvent &event)
Definition: DeviceToolBar.cpp:714
wxChoice * mInput
Definition: DeviceToolBar.h:70
void ShowComboDialog(wxChoice *combo, const wxString &title)
Definition: DeviceToolBar.cpp:777
void OnFocus(wxFocusEvent &event)
Definition: DeviceToolBar.cpp:174
DeviceToolBar()
Methods for DeviceToolBar.
Definition: DeviceToolBar.cpp:59
wxChoice * mOutput
Definition: DeviceToolBar.h:71
int ChangeHost()
Definition: DeviceToolBar.cpp:584
A toobar to allow easier changing of input and output devices .
Definition: DeviceToolBar.h:25
void SetNames()
Definition: DeviceToolBar.cpp:334
void RepositionCombos()
Definition: DeviceToolBar.cpp:407
void DeinitChildren()
Definition: DeviceToolBar.cpp:78
void SetDevices(const DeviceSourceMap *in, const DeviceSourceMap *out)
Definition: DeviceToolBar.cpp:656
void Create(wxWindow *parent) override
Definition: DeviceToolBar.cpp:68
void FillHosts()
Definition: DeviceToolBar.cpp:476
void Repaint(wxDC *WXUNUSED(dc)) override
Definition: DeviceToolBar.h:38
void ShowChannelsDialog()
Definition: DeviceToolBar.cpp:772
void ChangeDevice(bool isInput)
Definition: DeviceToolBar.cpp:682
void ShowHostDialog()
Definition: DeviceToolBar.cpp:768
void ShowOutputDialog()
Definition: DeviceToolBar.cpp:764
void OnCaptureKey(wxCommandEvent &event)
Definition: DeviceToolBar.cpp:188
bool Layout() override
Definition: DeviceToolBar.cpp:355
wxChoice * mHost
Definition: DeviceToolBar.h:73
int GetInitialWidth() override
Definition: DeviceToolBar.h:48
void ShowInputDialog()
Definition: DeviceToolBar.cpp:760
int GetMinToolbarWidth() override
Definition: DeviceToolBar.h:49
void FillInputChannels()
Definition: DeviceToolBar.cpp:606
void RefillCombos()
Definition: DeviceToolBar.cpp:165
void UpdatePrefs() override
Definition: DeviceToolBar.cpp:208
void EnableDisableButtons() override
Definition: DeviceToolBar.cpp:310
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed...
Definition: ToolBar.h:87
Definition: DeviceManager.h:30
virtual ~DeviceToolBar()
Definition: DeviceToolBar.cpp:64