1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-18 14:36:13 +01:00

Possible fix for bug #435

I say possible because I can't fully test it as my motherboard
audio device doesn't show up in Windows (don't know why yet).

So, because of that and because this "fix" needs a little discussion
amongst the troops, I've ifdef'd it with EXPERIMENTAL_HAVE_DEVICE_CHANGE
and have disabled it by default.

What is does is it sets up a device change listener and performs an
automatic rescan when a change is detected.  (That's the part that
needs discussion.)
This commit is contained in:
lllucius
2014-12-06 04:11:31 +00:00
parent abaac6b443
commit 71d8b0d8ec
11 changed files with 158 additions and 27 deletions

View File

@@ -21,6 +21,10 @@
#include <vector>
#include "wx/wx.h"
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
#include "DeviceChange.h"
#endif
typedef struct DeviceSourceMap {
int deviceIndex;
int sourceIndex;
@@ -35,6 +39,11 @@ typedef struct DeviceSourceMap {
wxString MakeDeviceSourceString(const DeviceSourceMap *map);
class DeviceManager
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
#if defined(HAVE_DEVICE_CHANGE)
: public DeviceChangeHandler
#endif
#endif
{
public:
/// Gets the singleton instance
@@ -53,7 +62,14 @@ class DeviceManager
const std::vector<DeviceSourceMap> &GetInputDeviceMaps();
const std::vector<DeviceSourceMap> &GetOutputDeviceMaps();
protected:
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
#if defined(HAVE_DEVICE_CHANGE)
// DeviceChangeHandler implementation
void DeviceChangeNotification();
#endif
#endif
protected:
//private constructor - Singleton.
DeviceManager();
virtual ~DeviceManager();