Audacity 3.2.0
DevicePrefs.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 DevicePrefs.h
6
7 Joshua Haberman
8 James Crook
9
10**********************************************************************/
11
12#ifndef __AUDACITY_DEVICE_PREFS__
13#define __AUDACITY_DEVICE_PREFS__
14
15#include <wx/defs.h>
16
17#include "PrefsPanel.h"
18
19class wxChoice;
20class wxTextCtrl;
21class ShuttleGui;
22
23#define DEVICE_PREFS_PLUGIN_SYMBOL ComponentInterfaceSymbol{ XO("Device") }
24
25class DevicePrefs final : public PrefsPanel
26{
27 public:
28 DevicePrefs(wxWindow * parent, wxWindowID winid, AudacityProject* project);
29 virtual ~DevicePrefs();
30 ComponentInterfaceSymbol GetSymbol() const override;
31 TranslatableString GetDescription() const override;
32
33 bool Commit() override;
34 ManualPageID HelpPageName() override;
35 void PopulateOrExchange(ShuttleGui & S) override;
36
37 private:
38 void Populate();
39 void GetNamesAndLabels();
40
41
42 void OnHost(wxCommandEvent & e);
43 void OnDevice(wxCommandEvent & e);
44 void OnDefaultSampleRateChoice(wxCommandEvent& e);
45 void OnProjectSampleRateChoice(wxCommandEvent& e);
46
48
51
52 wxString mPlayDevice;
53 wxString mRecordDevice;
54 wxString mRecordSource;
56
57 wxChoice *mHost;
58 wxChoice *mPlay;
59 wxChoice *mRecord;
60 wxChoice *mChannels;
61
62 wxChoice* mProjectSampleRates { nullptr };
63 wxTextCtrl* mOtherProjectSampleRate { nullptr };
64
67
71
73 std::vector<int> mSampleRateValues;
74
75 DECLARE_EVENT_TABLE()
76};
77
78PrefsPanel *DevicePrefsFactory(wxWindow *parent, wxWindowID winid, AudacityProject *);
79
80#endif
PrefsPanel * DevicePrefsFactory(wxWindow *parent, wxWindowID winid, AudacityProject *)
const auto project
#define S(N)
Definition: ToChars.cpp:64
std::vector< TranslatableString > TranslatableStrings
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
A PrefsPanel used to select recording and playback devices and other settings.
Definition: DevicePrefs.h:26
wxTextCtrl * mOtherProjectSampleRate
Definition: DevicePrefs.h:63
void OnDevice(wxCommandEvent &e)
wxChoice * mDefaultSampleRates
Definition: DevicePrefs.h:68
wxArrayStringEx mHostLabels
Definition: DevicePrefs.h:50
void OnProjectSampleRateChoice(wxCommandEvent &e)
wxChoice * mHost
Definition: DevicePrefs.h:57
wxTextCtrl * mOtherDefaultSampleRate
Definition: DevicePrefs.h:69
ComponentInterfaceSymbol GetSymbol() const override
Definition: DevicePrefs.cpp:81
DevicePrefs(wxWindow *parent, wxWindowID winid, AudacityProject *project)
Definition: DevicePrefs.cpp:69
void PopulateOrExchange(ShuttleGui &S) override
wxChoice * mRecord
Definition: DevicePrefs.h:59
int mOtherDefaultSampleRateValue
Definition: DevicePrefs.h:70
wxString mRecordDevice
Definition: DevicePrefs.h:53
wxString mPlayDevice
Definition: DevicePrefs.h:52
TranslatableStrings mSampleRateNames
Definition: DevicePrefs.h:72
void OnDefaultSampleRateChoice(wxCommandEvent &e)
wxString mRecordSource
Definition: DevicePrefs.h:54
void OnHost(wxCommandEvent &e)
TranslatableString GetDescription() const override
Definition: DevicePrefs.cpp:86
virtual ~DevicePrefs()
Definition: DevicePrefs.cpp:76
wxChoice * mPlay
Definition: DevicePrefs.h:58
void GetNamesAndLabels()
wxChoice * mProjectSampleRates
Definition: DevicePrefs.h:62
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
Definition: DevicePrefs.cpp:91
wxChoice * mChannels
Definition: DevicePrefs.h:60
std::vector< int > mSampleRateValues
Definition: DevicePrefs.h:73
int mProjectSampleRateIndex
Definition: DevicePrefs.h:65
long mRecordChannels
Definition: DevicePrefs.h:55
AudacityProject * mProject
Definition: DevicePrefs.h:47
void Populate()
Definition: DevicePrefs.cpp:96
int mOtherProjectSampleRateValue
Definition: DevicePrefs.h:66
bool Commit() override
TranslatableStrings mHostNames
Definition: DevicePrefs.h:49
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:630
Holds a msgid for the translation catalog; may also bind format arguments.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.