| read_MBR = (PROCISI)GetProcAddress(hinstDllMBR, "read_MBR"); | read_MBR = (PROCISI)GetProcAddress(hinstDllMBR, "read_MBR"); | ||||
| close_MBR = (PROCVV)GetProcAddress(hinstDllMBR, "close_MBR"); | close_MBR = (PROCVV)GetProcAddress(hinstDllMBR, "close_MBR"); | ||||
| reset_MBR = (PROCVV)GetProcAddress(hinstDllMBR, "reset_MBR"); | reset_MBR = (PROCVV)GetProcAddress(hinstDllMBR, "reset_MBR"); | ||||
| lastError_MBR = (PROCIV)GetProcAddress(hinstDllMBR, "lastError_MBR"); | |||||
| lastErrorStr_MBR = (PROCVCI)GetProcAddress(hinstDllMBR, "lastErrorStr_MBR"); | lastErrorStr_MBR = (PROCVCI)GetProcAddress(hinstDllMBR, "lastErrorStr_MBR"); | ||||
| setNoError_MBR = (PROCVI)GetProcAddress(hinstDllMBR, "setNoError_MBR"); | setNoError_MBR = (PROCVI)GetProcAddress(hinstDllMBR, "setNoError_MBR"); | ||||
| setVolumeRatio_MBR = (PROCVF)GetProcAddress(hinstDllMBR, "setVolumeRatio_MBR"); | setVolumeRatio_MBR = (PROCVF)GetProcAddress(hinstDllMBR, "setVolumeRatio_MBR"); | ||||
| init_MBR(mbr_voice_path); | init_MBR(mbr_voice_path); | ||||
| } | } | ||||
| int lastErrorStr_mbrola(char *buffer, int bufsize) | |||||
| char *lastErrorStr_mbrola(char *buffer, int bufsize) | |||||
| { | { | ||||
| int result; | int result; | ||||
| if (mbr_pid) | if (mbr_pid) | ||||
| mbrola_has_errors(); | mbrola_has_errors(); | ||||
| result = snprintf(buffer, bufsize, "%s", mbr_errorbuf); | result = snprintf(buffer, bufsize, "%s", mbr_errorbuf); | ||||
| return result >= bufsize ? (bufsize - 1) : result; | |||||
| return buffer; | |||||
| } | } | ||||
| void setNoError_mbrola(int no_error) | void setNoError_mbrola(int no_error) |
| typedef void (WINAPI *PROCVV)(void); | typedef void (WINAPI *PROCVV)(void); | ||||
| typedef void (WINAPI *PROCVI)(int); | typedef void (WINAPI *PROCVI)(int); | ||||
| typedef void (WINAPI *PROCVF)(float); | typedef void (WINAPI *PROCVF)(float); | ||||
| typedef int (WINAPI *PROCIV)(); | |||||
| typedef int (WINAPI *PROCIV)(void); | |||||
| typedef int (WINAPI *PROCIC)(char *); | typedef int (WINAPI *PROCIC)(char *); | ||||
| typedef int (WINAPI *PROCISI)(short *, int); | typedef int (WINAPI *PROCISI)(short *, int); | ||||
| typedef char * (WINAPI *PROCVCI)(char *, int); | typedef char * (WINAPI *PROCVCI)(char *, int); | ||||
| /* | /* | ||||
| * Copy into 'buffer' at most 'bufsize' bytes from the latest error | * Copy into 'buffer' at most 'bufsize' bytes from the latest error | ||||
| * message. This may also contain non-fatal errors from mbrola. The | |||||
| * returned value is the actual number of bytes copied. When no error | |||||
| * message is pending then an empty string is returned. Consecutive | |||||
| * calls to lastErrorStr_MBR() will return the same message unless it | |||||
| * is explicitly cleared with resetError_MBR(). | |||||
| * message. This may also contain non-fatal errors from mbrola. When | |||||
| * no error message is pending then an empty string is returned. | |||||
| * Consecutive calls to lastErrorStr_MBR() will return the same message. | |||||
| */ | */ | ||||
| int (WINAPI *lastErrorStr_MBR)(char *buffer, int bufsize); | |||||
| char * (WINAPI *lastErrorStr_MBR)(char *buffer, int bufsize); | |||||
| /* | /* | ||||
| * Tolerance to missing diphones. | * Tolerance to missing diphones. |