Commit 1b5ca01a authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winecoreaudio: Consolidate formatting of FOURCC values in a function.

parent 47c27742
...@@ -487,10 +487,7 @@ BOOL CoreAudio_GetDevCaps (void) ...@@ -487,10 +487,7 @@ BOOL CoreAudio_GetDevCaps (void)
propertySize = MAXPNAMELEN; propertySize = MAXPNAMELEN;
status = AudioDeviceGetProperty(devId, 0 , FALSE, kAudioDevicePropertyDeviceName, &propertySize, name); status = AudioDeviceGetProperty(devId, 0 , FALSE, kAudioDevicePropertyDeviceName, &propertySize, name);
if (status) { if (status) {
ERR("AudioHardwareGetProperty for kAudioDevicePropertyDeviceName return %c%c%c%c\n", (char) (status >> 24), ERR("AudioHardwareGetProperty for kAudioDevicePropertyDeviceName return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
return FALSE; return FALSE;
} }
...@@ -504,21 +501,15 @@ BOOL CoreAudio_GetDevCaps (void) ...@@ -504,21 +501,15 @@ BOOL CoreAudio_GetDevCaps (void)
propertySize = sizeof(CoreAudio_DefaultDevice.streamDescription); propertySize = sizeof(CoreAudio_DefaultDevice.streamDescription);
status = AudioDeviceGetProperty(devId, 0, FALSE , kAudioDevicePropertyStreamFormat, &propertySize, &CoreAudio_DefaultDevice.streamDescription); status = AudioDeviceGetProperty(devId, 0, FALSE , kAudioDevicePropertyStreamFormat, &propertySize, &CoreAudio_DefaultDevice.streamDescription);
if (status != noErr) { if (status != noErr) {
ERR("AudioHardwareGetProperty for kAudioDevicePropertyStreamFormat return %c%c%c%c\n", (char) (status >> 24), ERR("AudioHardwareGetProperty for kAudioDevicePropertyStreamFormat return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
return FALSE; return FALSE;
} }
TRACE("Device Stream Description mSampleRate : %f\n mFormatID : %c%c%c%c\n" TRACE("Device Stream Description mSampleRate : %f\n mFormatID : %s\n"
"mFormatFlags : %lX\n mBytesPerPacket : %lu\n mFramesPerPacket : %lu\n" "mFormatFlags : %lX\n mBytesPerPacket : %lu\n mFramesPerPacket : %lu\n"
"mBytesPerFrame : %lu\n mChannelsPerFrame : %lu\n mBitsPerChannel : %lu\n", "mBytesPerFrame : %lu\n mChannelsPerFrame : %lu\n mBitsPerChannel : %lu\n",
CoreAudio_DefaultDevice.streamDescription.mSampleRate, CoreAudio_DefaultDevice.streamDescription.mSampleRate,
(char) (CoreAudio_DefaultDevice.streamDescription.mFormatID >> 24), wine_dbgstr_fourcc(CoreAudio_DefaultDevice.streamDescription.mFormatID),
(char) (CoreAudio_DefaultDevice.streamDescription.mFormatID >> 16),
(char) (CoreAudio_DefaultDevice.streamDescription.mFormatID >> 8),
(char) CoreAudio_DefaultDevice.streamDescription.mFormatID,
CoreAudio_DefaultDevice.streamDescription.mFormatFlags, CoreAudio_DefaultDevice.streamDescription.mFormatFlags,
CoreAudio_DefaultDevice.streamDescription.mBytesPerPacket, CoreAudio_DefaultDevice.streamDescription.mBytesPerPacket,
CoreAudio_DefaultDevice.streamDescription.mFramesPerPacket, CoreAudio_DefaultDevice.streamDescription.mFramesPerPacket,
...@@ -566,10 +557,7 @@ LONG CoreAudio_WaveInit(void) ...@@ -566,10 +557,7 @@ LONG CoreAudio_WaveInit(void)
propertySize = sizeof(CoreAudio_DefaultDevice.outputDeviceID); propertySize = sizeof(CoreAudio_DefaultDevice.outputDeviceID);
status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &propertySize, &CoreAudio_DefaultDevice.outputDeviceID); status = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice, &propertySize, &CoreAudio_DefaultDevice.outputDeviceID);
if (status) { if (status) {
ERR("AudioHardwareGetProperty return %c%c%c%c for kAudioHardwarePropertyDefaultOutputDevice\n", (char) (status >> 24), ERR("AudioHardwareGetProperty return %s for kAudioHardwarePropertyDefaultOutputDevice\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
return DRV_FAILURE; return DRV_FAILURE;
} }
if (CoreAudio_DefaultDevice.outputDeviceID == kAudioDeviceUnknown) { if (CoreAudio_DefaultDevice.outputDeviceID == kAudioDeviceUnknown) {
...@@ -1010,10 +998,7 @@ static DWORD wodClose(WORD wDevID) ...@@ -1010,10 +998,7 @@ static DWORD wodClose(WORD wDevID)
err = AudioUnitUninitialize(audioUnit); err = AudioUnitUninitialize(audioUnit);
if (err) { if (err) {
ERR("AudioUnitUninitialize return %c%c%c%c\n", (char) (err >> 24), ERR("AudioUnitUninitialize return %s\n", wine_dbgstr_fourcc(err));
(char) (err >> 16),
(char) (err >> 8),
(char) err);
return MMSYSERR_ERROR; /* FIXME return an error based on the OSStatus */ return MMSYSERR_ERROR; /* FIXME return an error based on the OSStatus */
} }
...@@ -1299,10 +1284,8 @@ static DWORD wodPause(WORD wDevID) ...@@ -1299,10 +1284,8 @@ static DWORD wodPause(WORD wDevID)
* render callback will just produce silence. * render callback will just produce silence.
*/ */
status = AudioOutputUnitStop(WOutDev[wDevID].audioUnit); status = AudioOutputUnitStop(WOutDev[wDevID].audioUnit);
if (status) { if (status)
WARN("AudioOutputUnitStop return %c%c%c%c\n", WARN("AudioOutputUnitStop return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 24), (char) (status >> 16), (char) (status >> 8), (char) status);
}
OSSpinLockLock(&WOutDev[wDevID].lock); OSSpinLockLock(&WOutDev[wDevID].lock);
if (WOutDev[wDevID].state == WINE_WS_PLAYING) if (WOutDev[wDevID].state == WINE_WS_PLAYING)
...@@ -1342,8 +1325,7 @@ static DWORD wodRestart(WORD wDevID) ...@@ -1342,8 +1325,7 @@ static DWORD wodRestart(WORD wDevID)
status = AudioOutputUnitStart(WOutDev[wDevID].audioUnit); status = AudioOutputUnitStart(WOutDev[wDevID].audioUnit);
if (status) { if (status) {
ERR("AudioOutputUnitStart return %c%c%c%c\n", ERR("AudioOutputUnitStart return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 24), (char) (status >> 16), (char) (status >> 8), (char) status);
return MMSYSERR_ERROR; /* FIXME return an error based on the OSStatus */ return MMSYSERR_ERROR; /* FIXME return an error based on the OSStatus */
} }
...@@ -1391,8 +1373,7 @@ static DWORD wodReset(WORD wDevID) ...@@ -1391,8 +1373,7 @@ static DWORD wodReset(WORD wDevID)
status = AudioOutputUnitStart(wwo->audioUnit); status = AudioOutputUnitStart(wwo->audioUnit);
if (status) { if (status) {
ERR( "AudioOutputUnitStart return %c%c%c%c\n", ERR( "AudioOutputUnitStart return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 24), (char) (status >> 16), (char) (status >> 8), (char) status);
return MMSYSERR_ERROR; /* FIXME return an error based on the OSStatus */ return MMSYSERR_ERROR; /* FIXME return an error based on the OSStatus */
} }
...@@ -2063,17 +2044,10 @@ static DWORD widClose(WORD wDevID) ...@@ -2063,17 +2044,10 @@ static DWORD widClose(WORD wDevID)
* that lock and trying to grab the wwi->lock in the callback. */ * that lock and trying to grab the wwi->lock in the callback. */
err = AudioUnitUninitialize(wwi->audioUnit); err = AudioUnitUninitialize(wwi->audioUnit);
if (err) if (err)
{ ERR("AudioUnitUninitialize return %s\n", wine_dbgstr_fourcc(err));
ERR("AudioUnitUninitialize return %c%c%c%c\n", (char) (err >> 24),
(char) (err >> 16),
(char) (err >> 8),
(char) err);
}
if (!AudioUnit_CloseAudioUnit(wwi->audioUnit)) if (!AudioUnit_CloseAudioUnit(wwi->audioUnit))
{
ERR("Can't close AudioUnit\n"); ERR("Can't close AudioUnit\n");
}
OSSpinLockLock(&wwi->lock); OSSpinLockLock(&wwi->lock);
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#undef DPRINTF #undef DPRINTF
#undef STDMETHODCALLTYPE #undef STDMETHODCALLTYPE
#include "coreaudio.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wave); WINE_DEFAULT_DEBUG_CHANNEL(wave);
...@@ -99,14 +100,14 @@ int AudioUnit_InitializeWithStreamDescription(AudioUnit au, AudioStreamBasicDesc ...@@ -99,14 +100,14 @@ int AudioUnit_InitializeWithStreamDescription(AudioUnit au, AudioStreamBasicDesc
if (err != noErr) if (err != noErr)
{ {
ERR("AudioUnitSetProperty return an error %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR("AudioUnitSetProperty return an error %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
err = AudioUnitInitialize(au); err = AudioUnitInitialize(au);
if (err != noErr) if (err != noErr)
{ {
ERR("AudioUnitInitialize return an error %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR("AudioUnitInitialize return an error %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
return 1; return 1;
...@@ -120,7 +121,7 @@ int AudioUnit_SetVolume(AudioUnit au, float left, float right) ...@@ -120,7 +121,7 @@ int AudioUnit_SetVolume(AudioUnit au, float left, float right)
if (err != noErr) if (err != noErr)
{ {
ERR("AudioUnitSetParameter return an error %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR("AudioUnitSetParameter return an error %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
return 1; return 1;
...@@ -133,7 +134,7 @@ int AudioUnit_GetVolume(AudioUnit au, float *left, float *right) ...@@ -133,7 +134,7 @@ int AudioUnit_GetVolume(AudioUnit au, float *left, float *right)
err = AudioUnitGetParameter(au, kHALOutputParam_Volume, kAudioUnitParameterFlag_Output, 0, left); err = AudioUnitGetParameter(au, kHALOutputParam_Volume, kAudioUnitParameterFlag_Output, 0, left);
if (err != noErr) if (err != noErr)
{ {
ERR("AudioUnitGetParameter return an error %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR("AudioUnitGetParameter return an error %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
*right = *left; *right = *left;
...@@ -336,7 +337,7 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth) ...@@ -336,7 +337,7 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth)
err = NewAUGraph(graph); err = NewAUGraph(graph);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("NewAUGraph return %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("NewAUGraph return %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
...@@ -351,7 +352,7 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth) ...@@ -351,7 +352,7 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth)
err = AUGraphNewNode(*graph, &desc, 0, NULL, &synthNode); err = AUGraphNewNode(*graph, &desc, 0, NULL, &synthNode);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("AUGraphNewNode cannot create synthNode : %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("AUGraphNewNode cannot create synthNode : %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
...@@ -362,14 +363,14 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth) ...@@ -362,14 +363,14 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth)
err = AUGraphNewNode(*graph, &desc, 0, NULL, &outNode); err = AUGraphNewNode(*graph, &desc, 0, NULL, &outNode);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("AUGraphNewNode cannot create outNode %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("AUGraphNewNode cannot create outNode %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
err = AUGraphOpen(*graph); err = AUGraphOpen(*graph);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("AUGraphOpen return %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("AUGraphOpen return %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
...@@ -377,7 +378,7 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth) ...@@ -377,7 +378,7 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth)
err = AUGraphConnectNodeInput(*graph, synthNode, 0, outNode, 0); err = AUGraphConnectNodeInput(*graph, synthNode, 0, outNode, 0);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("AUGraphConnectNodeInput cannot connect synthNode to outNode : %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("AUGraphConnectNodeInput cannot connect synthNode to outNode : %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
...@@ -385,7 +386,7 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth) ...@@ -385,7 +386,7 @@ int SynthUnit_CreateDefaultSynthUnit(AUGraph *graph, AudioUnit *synth)
err = AUGraphGetNodeInfo(*graph, synthNode, 0, 0, 0, synth); err = AUGraphGetNodeInfo(*graph, synthNode, 0, 0, 0, synth);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("AUGraphGetNodeInfo return %c%c%c%c\n", (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("AUGraphGetNodeInfo return %s\n", wine_dbgstr_fourcc(err));
return 0; return 0;
} }
...@@ -399,14 +400,14 @@ int SynthUnit_Initialize(AudioUnit synth, AUGraph graph) ...@@ -399,14 +400,14 @@ int SynthUnit_Initialize(AudioUnit synth, AUGraph graph)
err = AUGraphInitialize(graph); err = AUGraphInitialize(graph);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("AUGraphInitialize(%p) return %c%c%c%c\n", graph, (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("AUGraphInitialize(%p) return %s\n", graph, wine_dbgstr_fourcc(err));
return 0; return 0;
} }
err = AUGraphStart(graph); err = AUGraphStart(graph);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("AUGraphStart(%p) return %c%c%c%c\n", graph, (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("AUGraphStart(%p) return %s\n", graph, wine_dbgstr_fourcc(err));
return 0; return 0;
} }
...@@ -420,14 +421,14 @@ int SynthUnit_Close(AUGraph graph) ...@@ -420,14 +421,14 @@ int SynthUnit_Close(AUGraph graph)
err = AUGraphStop(graph); err = AUGraphStop(graph);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("AUGraphStop(%p) return %c%c%c%c\n", graph, (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("AUGraphStop(%p) return %s\n", graph, wine_dbgstr_fourcc(err));
return 0; return 0;
} }
err = DisposeAUGraph(graph); err = DisposeAUGraph(graph);
if (err != noErr) if (err != noErr)
{ {
ERR_(midi)("DisposeAUGraph(%p) return %c%c%c%c\n", graph, (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR_(midi)("DisposeAUGraph(%p) return %s\n", graph, wine_dbgstr_fourcc(err));
return 0; return 0;
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#ifndef __WINE_COREAUDIO_H #ifndef __WINE_COREAUDIO_H
#define __WINE_COREAUDIO_H #define __WINE_COREAUDIO_H
#include "wine/debug.h"
extern LONG CoreAudio_WaveInit(void); extern LONG CoreAudio_WaveInit(void);
extern void CoreAudio_WaveRelease(void); extern void CoreAudio_WaveRelease(void);
...@@ -29,4 +31,12 @@ extern void CoreAudio_MIDIRelease(void); ...@@ -29,4 +31,12 @@ extern void CoreAudio_MIDIRelease(void);
extern LONG CoreAudio_MixerInit(void); extern LONG CoreAudio_MixerInit(void);
extern void CoreAudio_MixerRelease(void); extern void CoreAudio_MixerRelease(void);
/* fourcc is in native order, where MSB is the first character. */
static inline const char* wine_dbgstr_fourcc(unsigned long fourcc)
{
char buf[4] = { (char) (fourcc >> 24), (char) (fourcc >> 16),
(char) (fourcc >> 8), (char) fourcc };
return wine_dbgstr_an(buf, sizeof(buf));
}
#endif /* __WINE_COREAUDIO_H */ #endif /* __WINE_COREAUDIO_H */
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "mmddk.h" #include "mmddk.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "coreaudio.h"
WINE_DEFAULT_DEBUG_CHANNEL(midi); WINE_DEFAULT_DEBUG_CHANNEL(midi);
...@@ -356,7 +357,7 @@ static DWORD MIDIOut_Data(WORD wDevID, DWORD dwParam) ...@@ -356,7 +357,7 @@ static DWORD MIDIOut_Data(WORD wDevID, DWORD dwParam)
err = MusicDeviceMIDIEvent(destinations[wDevID].synth, (evt & 0xF0) | chn, d1, d2, 0); err = MusicDeviceMIDIEvent(destinations[wDevID].synth, (evt & 0xF0) | chn, d1, d2, 0);
if (err != noErr) if (err != noErr)
{ {
ERR("MusicDeviceMIDIEvent(%p, %04x, %04x, %04x, %d) return %c%c%c%c\n", destinations[wDevID].synth, (evt & 0xF0) | chn, d1, d2, 0, (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR("MusicDeviceMIDIEvent(%p, %04x, %04x, %04x, %d) return %s\n", destinations[wDevID].synth, (evt & 0xF0) | chn, d1, d2, 0, wine_dbgstr_fourcc(err));
return MMSYSERR_ERROR; return MMSYSERR_ERROR;
} }
} }
...@@ -434,7 +435,7 @@ static DWORD MIDIOut_LongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) ...@@ -434,7 +435,7 @@ static DWORD MIDIOut_LongData(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize)
err = MusicDeviceSysEx(destinations[wDevID].synth, (const UInt8 *) lpData, lpMidiHdr->dwBufferLength); err = MusicDeviceSysEx(destinations[wDevID].synth, (const UInt8 *) lpData, lpMidiHdr->dwBufferLength);
if (err != noErr) if (err != noErr)
{ {
ERR("MusicDeviceSysEx(%p, %p, %d) return %c%c%c%c\n", destinations[wDevID].synth, lpData, lpMidiHdr->dwBufferLength, (char) (err >> 24), (char) (err >> 16), (char) (err >> 8), (char) err); ERR("MusicDeviceSysEx(%p, %p, %d) return %s\n", destinations[wDevID].synth, lpData, lpMidiHdr->dwBufferLength, wine_dbgstr_fourcc(err));
return MMSYSERR_ERROR; return MMSYSERR_ERROR;
} }
} }
......
...@@ -364,10 +364,7 @@ LONG CoreAudio_MixerInit(void) ...@@ -364,10 +364,7 @@ LONG CoreAudio_MixerInit(void)
status = AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propertySize, NULL); status = AudioHardwareGetPropertyInfo(kAudioHardwarePropertyDevices, &propertySize, NULL);
if (status) if (status)
{ {
ERR("AudioHardwareGetPropertyInfo for kAudioHardwarePropertyDevices return %c%c%c%c\n", (char) (status >> 24), ERR("AudioHardwareGetPropertyInfo for kAudioHardwarePropertyDevices return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
return DRV_FAILURE; return DRV_FAILURE;
} }
...@@ -396,10 +393,7 @@ LONG CoreAudio_MixerInit(void) ...@@ -396,10 +393,7 @@ LONG CoreAudio_MixerInit(void)
status = AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &propertySize, deviceArray); status = AudioHardwareGetProperty(kAudioHardwarePropertyDevices, &propertySize, deviceArray);
if (status) if (status)
{ {
ERR("AudioHardwareGetProperty for kAudioHardwarePropertyDevices return %c%c%c%c\n", (char) (status >> 24), ERR("AudioHardwareGetProperty for kAudioHardwarePropertyDevices return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
goto error; goto error;
} }
...@@ -413,10 +407,7 @@ LONG CoreAudio_MixerInit(void) ...@@ -413,10 +407,7 @@ LONG CoreAudio_MixerInit(void)
propertySize = MAXPNAMELEN; propertySize = MAXPNAMELEN;
status = AudioDeviceGetProperty(line->deviceID, 0 , FALSE, kAudioDevicePropertyDeviceName, &propertySize, name); status = AudioDeviceGetProperty(line->deviceID, 0 , FALSE, kAudioDevicePropertyDeviceName, &propertySize, name);
if (status) { if (status) {
ERR("AudioHardwareGetProperty for kAudioDevicePropertyDeviceName return %c%c%c%c\n", (char) (status >> 24), ERR("AudioHardwareGetProperty for kAudioDevicePropertyDeviceName return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
goto error; goto error;
} }
...@@ -433,10 +424,7 @@ LONG CoreAudio_MixerInit(void) ...@@ -433,10 +424,7 @@ LONG CoreAudio_MixerInit(void)
propertySize = sizeof(UInt32); propertySize = sizeof(UInt32);
status = AudioDeviceGetPropertyInfo(line->deviceID, 0, FALSE, kAudioDevicePropertyStreams, &propertySize, &write ); status = AudioDeviceGetPropertyInfo(line->deviceID, 0, FALSE, kAudioDevicePropertyStreams, &propertySize, &write );
if (status) { if (status) {
ERR("AudioDeviceGetPropertyInfo for kAudioDevicePropertyDataSource return %c%c%c%c\n", (char) (status >> 24), ERR("AudioDeviceGetPropertyInfo for kAudioDevicePropertyDataSource return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
goto error; goto error;
} }
...@@ -448,10 +436,7 @@ LONG CoreAudio_MixerInit(void) ...@@ -448,10 +436,7 @@ LONG CoreAudio_MixerInit(void)
propertySize = sizeof(streamDescription); propertySize = sizeof(streamDescription);
status = AudioDeviceGetProperty(line->deviceID, 0, FALSE , kAudioDevicePropertyStreamFormat, &propertySize, &streamDescription); status = AudioDeviceGetProperty(line->deviceID, 0, FALSE , kAudioDevicePropertyStreamFormat, &propertySize, &streamDescription);
if (status != noErr) { if (status != noErr) {
ERR("AudioHardwareGetProperty for kAudioDevicePropertyStreamFormat return %c%c%c%c\n", (char) (status >> 24), ERR("AudioHardwareGetProperty for kAudioDevicePropertyStreamFormat return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
goto error; goto error;
} }
line->numChannels = streamDescription.mChannelsPerFrame; line->numChannels = streamDescription.mChannelsPerFrame;
...@@ -462,10 +447,7 @@ LONG CoreAudio_MixerInit(void) ...@@ -462,10 +447,7 @@ LONG CoreAudio_MixerInit(void)
propertySize = sizeof(UInt32); propertySize = sizeof(UInt32);
status = AudioDeviceGetPropertyInfo(line->deviceID, 0, TRUE, kAudioDevicePropertyStreams, &propertySize, &write ); status = AudioDeviceGetPropertyInfo(line->deviceID, 0, TRUE, kAudioDevicePropertyStreams, &propertySize, &write );
if (status) { if (status) {
ERR("AudioDeviceGetPropertyInfo for kAudioDevicePropertyStreams return %c%c%c%c\n", (char) (status >> 24), ERR("AudioDeviceGetPropertyInfo for kAudioDevicePropertyStreams return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
goto error; goto error;
} }
if ( (propertySize / sizeof(AudioStreamID)) != 0) if ( (propertySize / sizeof(AudioStreamID)) != 0)
...@@ -476,10 +458,7 @@ LONG CoreAudio_MixerInit(void) ...@@ -476,10 +458,7 @@ LONG CoreAudio_MixerInit(void)
propertySize = sizeof(streamDescription); propertySize = sizeof(streamDescription);
status = AudioDeviceGetProperty(line->deviceID, 0, TRUE, kAudioDevicePropertyStreamFormat, &propertySize, &streamDescription); status = AudioDeviceGetProperty(line->deviceID, 0, TRUE, kAudioDevicePropertyStreamFormat, &propertySize, &streamDescription);
if (status != noErr) { if (status != noErr) {
ERR("AudioHardwareGetProperty for kAudioDevicePropertyStreamFormat return %c%c%c%c\n", (char) (status >> 24), ERR("AudioHardwareGetProperty for kAudioDevicePropertyStreamFormat return %s\n", wine_dbgstr_fourcc(status));
(char) (status >> 16),
(char) (status >> 8),
(char) status);
goto error; goto error;
} }
line->numChannels = streamDescription.mChannelsPerFrame; line->numChannels = streamDescription.mChannelsPerFrame;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment