mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-16 07:31:16 +02: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:
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "AudioIO.h"
|
||||
|
||||
#include "DeviceChange.h"
|
||||
#include "DeviceManager.h"
|
||||
#include "toolbars/DeviceToolBar.h"
|
||||
|
||||
@@ -311,6 +312,11 @@ void DeviceManager::Rescan()
|
||||
|
||||
//private constructor - Singleton.
|
||||
DeviceManager::DeviceManager()
|
||||
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
|
||||
#if defined(HAVE_DEVICE_CHANGE)
|
||||
: DeviceChangeHandler()
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
m_inited = false;
|
||||
}
|
||||
@@ -323,4 +329,20 @@ DeviceManager::~DeviceManager()
|
||||
void DeviceManager::Init()
|
||||
{
|
||||
Rescan();
|
||||
|
||||
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
|
||||
#if defined(HAVE_DEVICE_CHANGE)
|
||||
DeviceChangeHandler::Enable(true);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(EXPERIMENTAL_DEVICE_CHANGE_HANDLER)
|
||||
#if defined(HAVE_DEVICE_CHANGE)
|
||||
void DeviceManager::DeviceChangeNotification()
|
||||
{
|
||||
Rescan();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user