mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
Applying patch from bug #766
This patch fixes the corrupted device names as documented by the bug report.
This commit is contained in:
@@ -100,7 +100,7 @@ void MidiIOPrefs::GetNamesAndLabels() {
|
||||
for (int i = 0; i < nDevices; i++) {
|
||||
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
|
||||
if (info->output || info->input) { //should always happen
|
||||
wxString name(info->interf, wxConvLocal);
|
||||
wxString name = wxSafeConvertMB2WX(info->interf);
|
||||
if (mHostNames.Index(name) == wxNOT_FOUND) {
|
||||
mHostNames.Add(name);
|
||||
mHostLabels.Add(name);
|
||||
@@ -195,9 +195,9 @@ void MidiIOPrefs::OnHost(wxCommandEvent & e)
|
||||
|
||||
for (int i = 0; i < nDevices; i++) {
|
||||
const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
|
||||
wxString interf(info->interf, wxConvLocal);
|
||||
wxString interf = wxSafeConvertMB2WX(info->interf);
|
||||
if (itemAtIndex.IsSameAs(interf)) {
|
||||
wxString name(info->name, wxConvLocal);
|
||||
wxString name = wxSafeConvertMB2WX(info->name);
|
||||
wxString device = wxString::Format(wxT("%s: %s"),
|
||||
interf.c_str(),
|
||||
name.c_str());
|
||||
@@ -259,16 +259,16 @@ bool MidiIOPrefs::Apply()
|
||||
if (info) {
|
||||
gPrefs->Write(wxT("/MidiIO/PlaybackDevice"),
|
||||
wxString::Format(wxT("%s: %s"),
|
||||
wxString(info->interf, wxConvLocal).c_str(),
|
||||
wxString(info->name, wxConvLocal).c_str()));
|
||||
wxString(wxSafeConvertMB2WX(info->interf)).c_str(),
|
||||
wxString(wxSafeConvertMB2WX(info->name)).c_str()));
|
||||
}
|
||||
#ifdef EXPERIMENTAL_MIDI_IN
|
||||
info = (const PmDeviceInfo *) mRecord->GetClientData(mRecord->GetSelection());
|
||||
if (info) {
|
||||
gPrefs->Write(wxT("/MidiIO/RecordingDevice"),
|
||||
wxString::Format(wxT("%s: %s"),
|
||||
wxString(info->interf, wxConvLocal).c_str(),
|
||||
wxString(info->name, wxConvLocal).c_str()));
|
||||
wxString(wxSafeConvertMB2WX(info->interf)).c_str(),
|
||||
wxString(wxSafeConvertMB2WX(info->name)).c_str()));
|
||||
}
|
||||
#endif
|
||||
return gPrefs->Flush();
|
||||
|
||||
Reference in New Issue
Block a user