From ec88a2037e377f0f43234f474cf923857a498f4a Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Tue, 25 May 2004 23:54:16 +0000 Subject: [PATCH] cleanup formatting --- .../src/arch/Sound/RageSoundDriver_CA.cpp | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp index b4bcd39577..90e2eb8957 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_CA.cpp @@ -74,7 +74,8 @@ static Desc FindClosestFormat(const vector& formats) return v[0]; // something is better than nothing. } -static void GetIOProcFormats( CAAudioHardwareStream stream, vector &procFormats ) +static void GetIOProcFormats( CAAudioHardwareStream stream, + vector &procFormats ) { UInt32 numFormats = stream.GetNumberAvailableIOProcFormats(); @@ -87,7 +88,8 @@ static void GetIOProcFormats( CAAudioHardwareStream stream, vector &procFo } } -static void GetPhysicalFormats( CAAudioHardwareStream stream, vector &physicalFormats ) +static void GetPhysicalFormats( CAAudioHardwareStream stream, + vector &physicalFormats ) { UInt32 numFormats = stream.GetNumberAvailablePhysicalFormats(); for( UInt32 i=0; iGetStreamByIndex( kAudioDeviceSectionOutput, 0 ); + AudioStreamID sID; + + sID = mOutputDevice->GetStreamByIndex( kAudioDeviceSectionOutput, 0 ); CAAudioHardwareStream stream( sID ); try @@ -144,8 +149,9 @@ RageSound_CA::RageSound_CA() { const Desc& f = physicalFormats[i]; - LOG->Info("Format %u: Rate: %i ID: %s Flags 0x%lx bpp %lu fpp %lu bpf %lu channels %lu bits %lu", - i, (int) f.mSampleRate, FormatToString(f.mFormatID).c_str(), f.mFormatFlags, + LOG->Info("Format %u: Rate: %i ID: %s Flags 0x%lx bpp %lu fpp %lu" + " bpf %lu channels %lu bits %lu", i, int(f.mSampleRate), + FormatToString(f.mFormatID).c_str(), f.mFormatFlags, f.mBytesPerPacket, f.mFramesPerPacket, f.mBytesPerFrame, f.mChannelsPerFrame, f.mBitsPerChannel); } @@ -159,8 +165,9 @@ RageSound_CA::RageSound_CA() { const Desc& f = procFormats[i]; - LOG->Info("Format %u: Rate: %i ID: %s Flags 0x%lx bpp %lu fpp %lu bpf %lu channels %lu bits %lu", - i, (int) f.mSampleRate, FormatToString(f.mFormatID).c_str(), f.mFormatFlags, + LOG->Info("Format %u: Rate: %i ID: %s Flags 0x%lx bpp %lu fpp %lu" + " bpf %lu channels %lu bits %lu", i, int(f.mSampleRate), + FormatToString(f.mFormatID).c_str(), f.mFormatFlags, f.mBytesPerPacket, f.mFramesPerPacket, f.mBytesPerFrame, f.mChannelsPerFrame, f.mBitsPerChannel); } @@ -248,20 +255,20 @@ OSStatus RageSound_CA::GetData(AudioDeviceID inDevice, const AudioTimeStamp *inOutputTime, void *inClientData) { - RageTimer tm; + RageTimer tm; RageSound_CA *This = (RageSound_CA *)inClientData; UInt32 dataPackets = outOutputData->mBuffers[0].mDataByteSize; dataPackets /= gConverter->GetOutputFormat().mBytesPerPacket; - + This->mDecodePos = int64_t(inOutputTime->mSampleTime); gConverter->FillComplexBuffer(dataPackets, *outOutputData, NULL); - g_fLastIOProcTime = tm.GetDeltaTime(); - ++g_iNumIOProcCalls; + g_fLastIOProcTime = tm.GetDeltaTime(); + ++g_iNumIOProcCalls; - return noErr; + return noErr; } OSStatus RageSound_CA::OverloadListener(AudioDeviceID inDevice, @@ -270,7 +277,8 @@ OSStatus RageSound_CA::OverloadListener(AudioDeviceID inDevice, AudioDevicePropertyID inPropertyID, void *inData) { - LOG->Warn( "Audio overload. Last IOProc time: %f IOProc calls: %i", g_fLastIOProcTime, g_iNumIOProcCalls ); + LOG->Warn( "Audio overload. Last IOProc time: %f IOProc calls: %i", + g_fLastIOProcTime, g_iNumIOProcCalls ); g_iNumIOProcCalls = 0; return noErr; } @@ -280,10 +288,14 @@ void RageSound_CA::SetupDecodingThread() /* Increase the scheduling precedence of the decoder thread. */ thread_precedence_policy po; po.importance = 32; - kern_return_t ret = thread_policy_set( mach_thread_self(), THREAD_PRECEDENCE_POLICY, - (int *)&po, THREAD_PRECEDENCE_POLICY_COUNT ); + kern_return_t ret; + + ret = thread_policy_set( mach_thread_self(), + THREAD_PRECEDENCE_POLICY, (int *)&po, + THREAD_PRECEDENCE_POLICY_COUNT ); if( ret != KERN_SUCCESS ) - LOG->Warn( "thread_policy_set(THREAD_PRECEDENCE_POLICY) failed: %s", mach_error_string(ret) ); + LOG->Warn("thread_policy_set(THREAD_PRECEDENCE_POLICY) failed: %s", + mach_error_string(ret)); } /*