Merge of old SVN hotplug branch into current git HEAD. Includes hotplug support for DirectSound, WDM/KS. Both are working running in debugger but WDM/KS seems to be crashing in stand-alone build. I removed the use of struct _PaInternalInfo in hotplug/pa_front.c to reduce the size of the change. pa_win_dsound.c involved the most intricate changes due to other changes that had been made in the mean time. I've also initialized function ptrs ScanDeviceInfos, CommitDeviceInfos, DisposeDeviceInfos so this should build on all platforms.
This commit is contained in:
parent
7edc5cb655
commit
89f8f75a27
18 changed files with 1052 additions and 324 deletions
48
test/patest_update_available_device_list.c
Normal file
48
test/patest_update_available_device_list.c
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "portaudio.h"
|
||||
|
||||
void printDevices()
|
||||
{
|
||||
int deviceCount = Pa_GetDeviceCount();
|
||||
int i;
|
||||
|
||||
for( i=0; i < deviceCount; ++i ){
|
||||
const PaDeviceInfo *deviceInfo = Pa_GetDeviceInfo(i);
|
||||
const PaHostApiInfo *hostApiInfo = Pa_GetHostApiInfo( deviceInfo->hostApi );
|
||||
|
||||
assert( deviceInfo != 0 );
|
||||
|
||||
printf( "%d %s (%s)\n", i, deviceInfo->name, hostApiInfo->name );
|
||||
}
|
||||
}
|
||||
|
||||
static void devicesChangedCallback(void* p)
|
||||
{
|
||||
(void)p;
|
||||
|
||||
printf( "Portaudio device list have changed!\n" );
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Pa_Initialize();
|
||||
|
||||
Pa_SetDevicesChangedCallback(NULL, devicesChangedCallback);
|
||||
|
||||
for(;;){
|
||||
printDevices();
|
||||
|
||||
printf( "press [enter] to update the device list. or q + [enter] to quit.\n" );
|
||||
if( getchar() == 'q' )
|
||||
break;
|
||||
|
||||
Pa_UpdateAvailableDeviceList();
|
||||
}
|
||||
|
||||
Pa_Terminate();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue