mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Audio volume slider support for OS X.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6720 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -112,6 +112,18 @@ bool CoreAudioSound::Start()
|
||||
return true;
|
||||
}
|
||||
|
||||
void CoreAudioSound::SetVolume(int volume)
|
||||
{
|
||||
OSStatus err;
|
||||
|
||||
err = AudioUnitSetParameter(audioUnit,
|
||||
kHALOutputParam_Volume,
|
||||
kAudioUnitParameterFlag_Output, 0,
|
||||
volume / 100., 0);
|
||||
if (err != noErr)
|
||||
ERROR_LOG(AUDIO, "error setting volume");
|
||||
}
|
||||
|
||||
void CoreAudioSound::SoundLoop()
|
||||
{
|
||||
}
|
||||
@ -121,22 +133,16 @@ void CoreAudioSound::Stop()
|
||||
OSStatus err;
|
||||
|
||||
err = AudioOutputUnitStop(audioUnit);
|
||||
if (err != noErr) {
|
||||
if (err != noErr)
|
||||
ERROR_LOG(AUDIO, "error stopping audiounit");
|
||||
return;
|
||||
}
|
||||
|
||||
err = AudioUnitUninitialize(audioUnit);
|
||||
if (err != noErr) {
|
||||
if (err != noErr)
|
||||
ERROR_LOG(AUDIO, "error uninitializing audiounit");
|
||||
return;
|
||||
}
|
||||
|
||||
err = CloseComponent(audioUnit);
|
||||
if (err != noErr) {
|
||||
if (err != noErr)
|
||||
ERROR_LOG(AUDIO, "error closing audio component");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CoreAudioSound::Update()
|
||||
|
Reference in New Issue
Block a user