Buildfix MSVC 2010
This commit is contained in:
parent
352519c91e
commit
b91c342ff4
|
@ -884,7 +884,9 @@ static bool create_win32_process(char* cmd)
|
||||||
#include <ole2.h>
|
#include <ole2.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SAPI
|
||||||
static ISpVoice* pVoice = NULL;
|
static ISpVoice* pVoice = NULL;
|
||||||
|
#endif
|
||||||
#ifdef HAVE_NVDA
|
#ifdef HAVE_NVDA
|
||||||
bool USE_POWERSHELL = false;
|
bool USE_POWERSHELL = false;
|
||||||
bool USE_NVDA = true;
|
bool USE_NVDA = true;
|
||||||
|
@ -897,7 +899,7 @@ bool USE_NVDA_BRAILLE = false;
|
||||||
static bool is_narrator_running_windows(void)
|
static bool is_narrator_running_windows(void)
|
||||||
{
|
{
|
||||||
DWORD status = 0;
|
DWORD status = 0;
|
||||||
bool res;
|
|
||||||
if (USE_POWERSHELL)
|
if (USE_POWERSHELL)
|
||||||
{
|
{
|
||||||
if (pi_set == false)
|
if (pi_set == false)
|
||||||
|
@ -913,6 +915,7 @@ static bool is_narrator_running_windows(void)
|
||||||
else if (USE_NVDA)
|
else if (USE_NVDA)
|
||||||
{
|
{
|
||||||
long res = nvdaController_testIfRunning();
|
long res = nvdaController_testIfRunning();
|
||||||
|
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
{
|
{
|
||||||
/* The running nvda service wasn't found, so revert
|
/* The running nvda service wasn't found, so revert
|
||||||
|
@ -924,23 +927,17 @@ static bool is_narrator_running_windows(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
/*
|
|
||||||
nvdaController_speakText(L"This is a test speech message");
|
|
||||||
nvdaController_brailleMessage(L"This is a test braille message");
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SAPI
|
#ifdef HAVE_SAPI
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SPVOICESTATUS pStatus;
|
SPVOICESTATUS pStatus;
|
||||||
if (pVoice != NULL)
|
if (pVoice)
|
||||||
{
|
{
|
||||||
ISpVoice_GetStatus(pVoice, &pStatus, NULL);
|
ISpVoice_GetStatus(pVoice, &pStatus, NULL);
|
||||||
if (pStatus.dwRunningState == SPRS_IS_SPEAKING)
|
if (pStatus.dwRunningState == SPRS_IS_SPEAKING)
|
||||||
return true;
|
return true;
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -995,6 +992,7 @@ static bool accessibility_speak_windows(int speed,
|
||||||
long res = nvdaController_testIfRunning();
|
long res = nvdaController_testIfRunning();
|
||||||
const size_t cSize = strlen(speak_text) + 1;
|
const size_t cSize = strlen(speak_text) + 1;
|
||||||
wchar_t *wc = malloc(sizeof(wchar_t) * cSize);
|
wchar_t *wc = malloc(sizeof(wchar_t) * cSize);
|
||||||
|
|
||||||
mbstowcs(wc, speak_text, cSize);
|
mbstowcs(wc, speak_text, cSize);
|
||||||
|
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
|
@ -1020,7 +1018,7 @@ static bool accessibility_speak_windows(int speed,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* stop the old voice if running */
|
/* stop the old voice if running */
|
||||||
if (pVoice != NULL)
|
if (pVoice)
|
||||||
{
|
{
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
ISpVoice_Release(pVoice);
|
ISpVoice_Release(pVoice);
|
||||||
|
@ -1031,7 +1029,9 @@ static bool accessibility_speak_windows(int speed,
|
||||||
if (FAILED(CoInitialize(NULL)))
|
if (FAILED(CoInitialize(NULL)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_SpVoice, NULL, CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice);
|
hr = CoCreateInstance(&CLSID_SpVoice, NULL,
|
||||||
|
CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice);
|
||||||
|
|
||||||
if (SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
wchar_t wtext[1200];
|
wchar_t wtext[1200];
|
||||||
|
|
Loading…
Reference in New Issue