35#include <wx/textctrl.h>
73 return XO(
"Preferences for Device");
78 return "Devices_Preferences";
113 int nDevices = Pa_GetDeviceCount();
114 for (
int i = 0; i < nDevices; i++) {
115 const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
116 if ((info!=NULL)&&(info->maxOutputChannels > 0 || info->maxInputChannels > 0)) {
117 wxString
name = wxSafeConvertMB2WX(Pa_GetHostApiInfo(info->hostApi)->name);
137 S.StartStatic(
XC(
"Interface",
"device"));
139 S.StartMultiColumn(2);
142 mHost =
S.TieChoice(
XXO(
"&Host:"), HostSetting);
144 S.AddPrompt(
XXO(
"Using:"));
145 S.AddFixedText(
Verbatim(wxSafeConvertMB2WX(Pa_GetVersionText() ) ) );
151 S.StartStatic(
XO(
"Playback"));
153 S.StartMultiColumn(2);
164 S.StartStatic(
XC(
"Recording",
"preference"));
166 S.StartMultiColumn(2);
183 S.StartStatic(
XO(
"Latency"));
185 S.StartThreeColumn();
191 .NameSuffix(
XO(
"milliseconds"))
192 .TieNumericTextBox(
XXO(
"&Buffer length:"),
195 S.AddUnits(
XO(
"milliseconds"));
198 .NameSuffix(
XO(
"milliseconds"))
199 .TieNumericTextBox(
XXO(
"&Latency compensation:"),
201 S.AddUnits(
XO(
"milliseconds"));
219 int nHosts = Pa_GetHostApiCount();
220 for (
int i = 0; i < nHosts; ++i) {
221 wxString
name = wxSafeConvertMB2WX(Pa_GetHostApiInfo(i)->
name);
222 if (
name == apiName) {
229 wxLogDebug(
wxT(
"DevicePrefs::OnHost(): API index not found"));
233 int nDevices = Pa_GetDeviceCount();
238 mHost->Append(
_(
"No audio interfaces"), (
void *) NULL);
239 mHost->SetSelection(0);
245 wxArrayString playnames;
246 wxArrayString recordnames;
257 for (i = 0; i < inMaps.size(); i++) {
258 if (index == inMaps[i].hostIndex) {
260 devindex =
mRecord->Append(device);
264 if (device == recDevice) {
265 mRecord->SetSelection(devindex);
271 for (i = 0; i < outMaps.size(); i++) {
272 if (index == outMaps[i].hostIndex) {
274 devindex =
mPlay->Append(device);
277 mPlay->SetSelection(devindex);
283 if (
mPlay->GetCount() == 0) {
284 playnames.push_back(
_(
"No devices found"));
285 mPlay->Append(playnames[0], (
void *) NULL);
286 mPlay->SetSelection(0);
288 if (
mRecord->GetCount() == 0) {
289 recordnames.push_back(
_(
"No devices found"));
290 mRecord->Append(recordnames[0], (
void *) NULL);
297 if (
mPlay->GetCount() &&
mPlay->GetSelection() == wxNOT_FOUND) {
302 if (
mPlay->GetSelection() == wxNOT_FOUND) {
303 mPlay->SetSelection(0);
307 if (
mRecord->GetCount() &&
mRecord->GetSelection() == wxNOT_FOUND) {
312 if (
mPlay->GetSelection() == wxNOT_FOUND) {
313 mPlay->SetSelection(0);
324 int ndx =
mRecord->GetCurrentSelection();
325 if (ndx == wxNOT_FOUND) {
337 if (sel != wxNOT_FOUND) {
358 for (
int i = 0; i < cnt; i++) {
362 name =
_(
"1 (Mono)");
365 name =
_(
"2 (Stereo)");
368 name = wxString::Format(
wxT(
"%d"), i + 1);
371 channelnames.push_back(
name);
392 if (
mPlay->GetCount() > 0) {
394 mPlay->GetSelection());
DoubleSetting AudioIOLatencyCorrection
StringSetting AudioIORecordingSource
StringSetting AudioIOPlaybackDevice
DoubleSetting AudioIOLatencyDuration
StringSetting AudioIORecordingDevice
StringSetting AudioIOHost
IntSetting AudioIORecordingSourceIndex
IntSetting AudioIORecordChannels
wxString MakeDeviceSourceString(const DeviceSourceMap *map)
PrefsPanel * DevicePrefsFactory(wxWindow *parent, wxWindowID winid, AudacityProject *)
#define DEVICE_PREFS_PLUGIN_SYMBOL
const TranslatableString name
XXO("&Cut/Copy/Paste Toolbar")
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
DeviceSourceMap * GetDefaultInputDevice(int hostIndex)
const std::vector< DeviceSourceMap > & GetInputDeviceMaps()
const std::vector< DeviceSourceMap > & GetOutputDeviceMaps()
static DeviceManager * Instance()
Gets the singleton instance.
DeviceSourceMap * GetDefaultOutputDevice(int hostIndex)
A PrefsPanel used to select recording and playback devices and other settings.
void OnDevice(wxCommandEvent &e)
wxArrayStringEx mHostLabels
ComponentInterfaceSymbol GetSymbol() const override
void PopulateOrExchange(ShuttleGui &S) override
void OnHost(wxCommandEvent &e)
TranslatableString GetDescription() const override
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
TranslatableStrings mHostNames
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
bool Write(const T &value)
Write value to config and return true if successful.
void Invalidate() override
bool Reset()
Reset to the default value.
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
static void SetMinSize(wxWindow *window, const TranslatableStrings &items)
Holds a msgid for the translation catalog; may also bind format arguments.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
PrefsPanel::Registration sAttachment