mal_uint8dsound[16];// DirectSound uses a GUID for identification.
#endif
#ifdef MAL_SUPPORT_WINMM
/*UINT_PTR*/mal_uint32winmm;// When creating a device, WinMM expects a Win32 UINT_PTR for device identification. In practice it's actually just a UINT.
/*UINT_PTR*/mal_uint32winmm;// When creating a device, WinMM expects a Win32 UINT_PTR for device identification. In practice it's actually just a UINT.
#endif
#ifdef MAL_SUPPORT_ALSA
charalsa[256];// ALSA uses a name string for identification.
#endif
#ifdef MAL_SUPPORT_COREAUDIO
// TODO: Implement me.
// TODO: Implement me.
#endif
#ifdef MAL_SUPPORT_OSS
chaross[64];// "dev/dsp0", etc. "dev/dsp" for the default device.
chaross[64];// "dev/dsp0", etc. "dev/dsp" for the default device.
#endif
#ifdef MAL_SUPPORT_OPENSL
mal_uint32opensl;// OpenSL|ES uses a 32-bit unsigned integer for identification.
...
...
@@ -546,7 +546,7 @@ typedef union
intsdl;// SDL devices are identified with an index.
#endif
#ifdef MAL_SUPPORT_NULL
intnullbackend;// Always 0.
intnullbackend;// Always 0.
#endif
}mal_device_id;
...
...
@@ -690,8 +690,8 @@ struct mal_context
}dsound;
#endif
#ifdef MAL_SUPPORT_WINMM
struct
{
struct
{
/*HMODULE*/mal_handlehWinMM;
mal_procwaveOutGetNumDevs;
mal_procwaveOutGetDevCapsA;
...
...
@@ -710,7 +710,7 @@ struct mal_context
mal_procwaveInAddBuffer;
mal_procwaveInStart;
mal_procwaveInReset;
}winmm;
}winmm;
#endif
#ifdef MAL_SUPPORT_ALSA
struct
...
...
@@ -765,17 +765,17 @@ struct mal_context
}alsa;
#endif
#ifdef MAL_SUPPORT_COREAUDIO
struct
{
int_unused;
}coreaudio;
struct
{
int_unused;
}coreaudio;
#endif
#ifdef MAL_SUPPORT_OSS
struct
{
intversionMajor;
intversionMinor;
}oss;
struct
{
intversionMajor;
intversionMinor;
}oss;
#endif
#ifdef MAL_SUPPORT_OPENSL
struct
...
...
@@ -997,8 +997,8 @@ struct mal_device
}dsound;
#endif
#ifdef MAL_SUPPORT_WINMM
struct
{
struct
{
/*HWAVEOUT, HWAVEIN*/mal_handlehDevice;
/*HANDLE*/mal_handlehEvent;
mal_uint32fragmentSizeInFrames;
...
...
@@ -1008,7 +1008,7 @@ struct mal_device
mal_uint8*pIntermediaryBuffer;
mal_uint8*_pHeapData;// Used internally and is used for the heap allocated data for the intermediary buffer and the WAVEHDR structures.
mal_post_error(pDevice,"[WinMM] Failed to unprepare header for playback device in preparation for sending a new block of data to the device for playback.",mal_result_from_MMRESULT(resultMM));
mal_post_error(pDevice,"[WinMM] Failed to prepare header for playback device in preparation for sending a new block of data to the device for playback.",mal_result_from_MMRESULT(resultMM));
mal_post_error(pDevice,"[WinMM] Failed to prepare header for capture device in preparation for adding a new capture buffer for the device.",mal_result_from_MMRESULT(resultMM));
// Try opening a temporary device first so we can get version information. This is closed at the end.
intfd=mal_open_temp_device__oss();
if(fd==-1){
// Try opening a temporary device first so we can get version information. This is closed at the end.
intfd=mal_open_temp_device__oss();
if(fd==-1){
returnmal_context_post_error(pContext,NULL,"[OSS] Failed to open temporary device for retrieving system properties.",MAL_NO_BACKEND);// Looks liks OSS isn't installed, or there are no available devices.
}
}
// Grab the OSS version.
intossVersion=0;
intresult=ioctl(fd,OSS_GETVERSION,&ossVersion);
if(result==-1){
close(fd);
// Grab the OSS version.
intossVersion=0;
intresult=ioctl(fd,OSS_GETVERSION,&ossVersion);
if(result==-1){
close(fd);
returnmal_context_post_error(pContext,NULL,"[OSS] Failed to retrieve OSS version.",MAL_NO_BACKEND);
// The object returned by SNDCTL_SYSINFO will have the information we're after.
intfd=mal_open_temp_device__oss();
if(fd==-1){
// The object returned by SNDCTL_SYSINFO will have the information we're after.
intfd=mal_open_temp_device__oss();
if(fd==-1){
returnmal_context_post_error(pContext,NULL,"[OSS] Failed to open a temporary device for retrieving system information used for device enumeration.",MAL_NO_BACKEND);
if(pDevice==NULL)returnmal_post_error(pDevice,"mal_device_start() called with invalid arguments (pDevice == NULL).",MAL_INVALID_ARGS);
if(mal_device__get_state(pDevice)==MAL_STATE_UNINITIALIZED)returnmal_post_error(pDevice,"mal_device_start() called for an uninitialized device.",MAL_DEVICE_NOT_INITIALIZED);