mirror of https://github.com/PCSX2/pcsx2.git
Prevent the WASAPI code from trying to compile in linux/mac, and add a setting to enable exclusive mode selection from the settings (.ini only for now)
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2756 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
86dcb0a1a9
commit
3e6b6c86c1
|
@ -21,7 +21,10 @@
|
||||||
#include "Dialogs.h"
|
#include "Dialogs.h"
|
||||||
|
|
||||||
#include "portaudio/include/portaudio.h"
|
#include "portaudio/include/portaudio.h"
|
||||||
|
|
||||||
|
#ifdef __WIN32__
|
||||||
#include "portaudio/include/pa_win_wasapi.h"
|
#include "portaudio/include/pa_win_wasapi.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
int PaLinuxCallback( const void *inputBuffer, void *outputBuffer,
|
int PaLinuxCallback( const void *inputBuffer, void *outputBuffer,
|
||||||
|
@ -42,6 +45,8 @@ private:
|
||||||
|
|
||||||
bool m_UseHardware;
|
bool m_UseHardware;
|
||||||
|
|
||||||
|
bool m_WasapiExclusiveMode;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Instance vars
|
// Instance vars
|
||||||
|
|
||||||
|
@ -150,6 +155,9 @@ public:
|
||||||
|
|
||||||
if(deviceIndex>=0)
|
if(deviceIndex>=0)
|
||||||
{
|
{
|
||||||
|
void* infoPtr = NULL;
|
||||||
|
|
||||||
|
#ifdef __WIN32__
|
||||||
PaWasapiStreamInfo info = {
|
PaWasapiStreamInfo info = {
|
||||||
sizeof(PaWasapiStreamInfo),
|
sizeof(PaWasapiStreamInfo),
|
||||||
paWASAPI,
|
paWASAPI,
|
||||||
|
@ -157,6 +165,13 @@ public:
|
||||||
paWinWasapiExclusive
|
paWinWasapiExclusive
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if((m_ApiId == paWASAPI) && m_WasapiExclusiveMode)
|
||||||
|
{
|
||||||
|
// Pass it the Exclusive mode enable flag
|
||||||
|
infoPtr = &info;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
PaStreamParameters outParams = {
|
PaStreamParameters outParams = {
|
||||||
|
|
||||||
// PaDeviceIndex device;
|
// PaDeviceIndex device;
|
||||||
|
@ -168,8 +183,7 @@ public:
|
||||||
2,
|
2,
|
||||||
paInt32,
|
paInt32,
|
||||||
0, //?
|
0, //?
|
||||||
NULL
|
infoPtr
|
||||||
//&info // Use this instead of the NULL above, to pass it the Exclusive mode enable flag
|
|
||||||
};
|
};
|
||||||
|
|
||||||
err = Pa_OpenStream(&stream,
|
err = Pa_OpenStream(&stream,
|
||||||
|
@ -300,6 +314,7 @@ public:
|
||||||
if(api == L"WASAPI") m_ApiId = paWASAPI;
|
if(api == L"WASAPI") m_ApiId = paWASAPI;
|
||||||
if(api == L"AudioScienceHPI") m_ApiId = paAudioScienceHPI;
|
if(api == L"AudioScienceHPI") m_ApiId = paAudioScienceHPI;
|
||||||
|
|
||||||
|
m_WasapiExclusiveMode = CfgReadBool( L"PORTAUDIO", L"Wasapi_Exclusive_Mode", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteSettings() const
|
void WriteSettings() const
|
||||||
|
@ -326,6 +341,8 @@ public:
|
||||||
|
|
||||||
CfgWriteStr( L"PORTAUDIO", L"HostApi", api);
|
CfgWriteStr( L"PORTAUDIO", L"HostApi", api);
|
||||||
CfgWriteStr( L"PORTAUDIO", L"Device", m_Device);
|
CfgWriteStr( L"PORTAUDIO", L"Device", m_Device);
|
||||||
|
|
||||||
|
CfgWriteBool( L"PORTAUDIO", L"Wasapi_Exclusive_Mode", m_WasapiExclusiveMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
} static PA;
|
} static PA;
|
||||||
|
|
Loading…
Reference in New Issue