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:
Soren Jorvang
2011-01-02 02:49:30 +00:00
parent 26a3a9400b
commit c729b86c00
6 changed files with 29 additions and 24 deletions

View File

@ -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()