From e07f93115b743436606ada616859512458bcc1e0 Mon Sep 17 00:00:00 2001 From: CaptainYS Date: Tue, 5 Dec 2023 00:00:31 -0500 Subject: [PATCH] Implemented SetVolume for macOSX. --- .../src/macosx/yssimplesound_macosx_objc.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/yssimplesound/src/macosx/yssimplesound_macosx_objc.m b/src/yssimplesound/src/macosx/yssimplesound_macosx_objc.m index 27cffe4..cd21f47 100644 --- a/src/yssimplesound/src/macosx/yssimplesound_macosx_objc.m +++ b/src/yssimplesound/src/macosx/yssimplesound_macosx_objc.m @@ -303,6 +303,19 @@ void YsSimpleSound_OSX_SetVolume(struct YsAVAudioEngine *engineInfoPtr,struct Ys { if(nil!=ptr) { +#if !__has_feature(objc_arc) + AVAudioEngine *enginePtr=engineInfoPtr->enginePtr; + AVAudioMixerNode *mixerNodePtr=engineInfoPtr->mixerNodePtr; + AVAudioPlayerNode *playerNodePtr=ptr->playerNodePtr; + AVAudioPCMBuffer *PCMBufferPtr=ptr->PCMBufferPtr; +#else + AVAudioEngine *enginePtr=(__bridge AVAudioEngine *)engineInfoPtr->enginePtr; + AVAudioMixerNode *mixerNodePtr=(__bridge AVAudioMixerNode *)engineInfoPtr->mixerNodePtr; + AVAudioPlayerNode *playerNodePtr=(__bridge AVAudioPlayerNode *)ptr->playerNodePtr; + AVAudioPCMBuffer *PCMBufferPtr=(__bridge AVAudioPCMBuffer *)ptr->PCMBufferPtr; +#endif + + playerNodePtr.volume=vol; } }