src/sound/cocoa_s.cpp
changeset 7666 a5fccd76176a
parent 6573 7624f942237f
child 6871 5a9dc001e1ad
child 8272 355cb9c4d086
child 9722 ebf0ece7d8f6
equal deleted inserted replaced
7665:ded23f6bc34c 7666:a5fccd76176a
    34 
    34 
    35 #undef WindowClass
    35 #undef WindowClass
    36 #undef Point
    36 #undef Point
    37 #undef Rect
    37 #undef Rect
    38 
    38 
       
    39 static FSoundDriver_Cocoa iFSoundDriver_Cocoa;
    39 
    40 
    40 static AudioUnit _outputAudioUnit;
    41 static AudioUnit _outputAudioUnit;
    41 
    42 
    42 /* The CoreAudio callback */
    43 /* The CoreAudio callback */
    43 static OSStatus audioCallback(void *inRefCon, AudioUnitRenderActionFlags inActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, AudioBuffer *ioData)
    44 static OSStatus audioCallback(void *inRefCon, AudioUnitRenderActionFlags inActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, AudioBuffer *ioData)
    46 
    47 
    47 	return noErr;
    48 	return noErr;
    48 }
    49 }
    49 
    50 
    50 
    51 
    51 static const char *CocoaSoundStart(const char * const *parm)
    52 const char *SoundDriver_Cocoa::Start(const char * const *parm)
    52 {
    53 {
    53 	Component comp;
    54 	Component comp;
    54 	ComponentDescription desc;
    55 	ComponentDescription desc;
    55 	struct AudioUnitInputCallback callback;
    56 	struct AudioUnitInputCallback callback;
    56 	AudioStreamBasicDescription requestedDesc;
    57 	AudioStreamBasicDescription requestedDesc;
   114 	/* We're running! */
   115 	/* We're running! */
   115 	return NULL;
   116 	return NULL;
   116 }
   117 }
   117 
   118 
   118 
   119 
   119 static void CocoaSoundStop()
   120 void SoundDriver_Cocoa::Stop()
   120 {
   121 {
   121 	struct AudioUnitInputCallback callback;
   122 	struct AudioUnitInputCallback callback;
   122 
   123 
   123 	/* stop processing the audio unit */
   124 	/* stop processing the audio unit */
   124 	if (AudioOutputUnitStop(_outputAudioUnit) != noErr) {
   125 	if (AudioOutputUnitStop(_outputAudioUnit) != noErr) {
   138 		DEBUG(driver, 0, "cocoa_s: Core_CloseAudio: CloseComponent failed");
   139 		DEBUG(driver, 0, "cocoa_s: Core_CloseAudio: CloseComponent failed");
   139 		return;
   140 		return;
   140 	}
   141 	}
   141 }
   142 }
   142 
   143 
   143 
       
   144 const HalSoundDriver _cocoa_sound_driver = {
       
   145 	CocoaSoundStart,
       
   146 	CocoaSoundStop,
       
   147 };
       
   148 
       
   149 #endif /* WITH_COCOA */
   144 #endif /* WITH_COCOA */