mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
bug 11 followup: DeviceToolbar - fix mirroring issue when using reset toolbars menu item
This commit is contained in:
parent
0d1e121aa4
commit
2672b3a019
@ -210,6 +210,21 @@ static void AddSources(int deviceIndex, int rate, wxArrayString *hosts, std::vec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceToolBar::DeinitChildren()
|
||||||
|
{
|
||||||
|
mPlayBitmap = NULL;
|
||||||
|
mRecordBitmap = NULL;
|
||||||
|
mChannelsLabel = NULL;
|
||||||
|
|
||||||
|
mInput = NULL;
|
||||||
|
mOutput = NULL;
|
||||||
|
mInputChannels = NULL;
|
||||||
|
mHost = NULL;
|
||||||
|
|
||||||
|
mInputDeviceSourceMaps.clear();
|
||||||
|
mOutputDeviceSourceMaps.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceToolBar::Populate()
|
void DeviceToolBar::Populate()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -218,8 +233,9 @@ void DeviceToolBar::Populate()
|
|||||||
wxArrayString hosts;
|
wxArrayString hosts;
|
||||||
wxArrayString channels;
|
wxArrayString channels;
|
||||||
|
|
||||||
channels.Add(wxT("1 (Mono)"));
|
DeinitChildren();
|
||||||
|
|
||||||
|
channels.Add(wxT("1 (Mono)"));
|
||||||
int nDevices = Pa_GetDeviceCount();
|
int nDevices = Pa_GetDeviceCount();
|
||||||
|
|
||||||
//The heirarchy for devices is Host/device/source.
|
//The heirarchy for devices is Host/device/source.
|
||||||
@ -463,6 +479,8 @@ bool DeviceToolBar::Layout()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//These don't add up to 1 because there is a bit of margin that we allow
|
//These don't add up to 1 because there is a bit of margin that we allow
|
||||||
//the layout sizer to handle.
|
//the layout sizer to handle.
|
||||||
#define kHostWidthRatio 0.13
|
#define kHostWidthRatio 0.13
|
||||||
|
@ -43,6 +43,7 @@ class DeviceToolBar:public ToolBar {
|
|||||||
void RecreateTipWindows();
|
void RecreateTipWindows();
|
||||||
void UpdatePrefs();
|
void UpdatePrefs();
|
||||||
|
|
||||||
|
void DeinitChildren();
|
||||||
virtual void Populate();
|
virtual void Populate();
|
||||||
virtual void Repaint(wxDC *dc) {};
|
virtual void Repaint(wxDC *dc) {};
|
||||||
virtual void EnableDisableButtons();
|
virtual void EnableDisableButtons();
|
||||||
@ -52,6 +53,8 @@ class DeviceToolBar:public ToolBar {
|
|||||||
|
|
||||||
void OnChoice(wxCommandEvent & event);
|
void OnChoice(wxCommandEvent & event);
|
||||||
|
|
||||||
|
/// When the prefs don't exist this value is used.
|
||||||
|
/// It should be small enough to work on tiny screens
|
||||||
int GetInitialWidth() {return 600;}
|
int GetInitialWidth() {return 600;}
|
||||||
private:
|
private:
|
||||||
int ChangeHost();
|
int ChangeHost();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user