X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=snd_coreaudio.c;h=bbc97c07a92094ed0657bf0143aa36449660649a;hp=cb653f0447090953bc792784d52f8db44c9b748c;hb=861475e4f10eb1f592a5c64aff3b57eab4d11edb;hpb=a334e97bd7b1e7b37fe40a96caf9ccb8504c3f96 diff --git a/snd_coreaudio.c b/snd_coreaudio.c index cb653f04..bbc97c07 100644 --- a/snd_coreaudio.c +++ b/snd_coreaudio.c @@ -55,7 +55,7 @@ static OSStatus audioDeviceIOProc(AudioDeviceID inDevice, { float *outBuffer; unsigned int frameCount, factor, sampleIndex; - const float scale = 1.0f / SHRT_MAX; + float scale = 1.0f / SHRT_MAX; outBuffer = (float*)outOutputData->mBuffers[0].mData; factor = snd_renderbuffer->format.channels * snd_renderbuffer->format.width; @@ -73,6 +73,7 @@ static OSStatus audioDeviceIOProc(AudioDeviceID inDevice, if (snd_usethreadedmixing) { S_MixToBuffer(mixbuffer, submissionChunk); + sampleCount = submissionChunk * snd_renderbuffer->format.channels; for (sampleIndex = 0; sampleIndex < sampleCount; sampleIndex++) outBuffer[sampleIndex] = mixbuffer[sampleIndex] * scale; // unlock the mutex now @@ -239,7 +240,7 @@ qboolean SndSys_Init (const snd_format_t* requested, snd_format_t* suggested) return false; } - if(streamDesc.mFormatID != kAudioFormatLinearPCM) + if(streamDesc.mFormatID == kAudioFormatLinearPCM) { // Add the callback function status = AudioDeviceAddIOProc(outputDeviceID, audioDeviceIOProc, NULL); @@ -384,3 +385,15 @@ void SndSys_UnlockRenderBuffer (void) { pthread_mutex_unlock(&coreaudio_mutex); } + +/* +==================== +SndSys_SendKeyEvents + +Send keyboard events originating from the sound system (e.g. MIDI) +==================== +*/ +void SndSys_SendKeyEvents(void) +{ + // not supported +}