Commit 8a1ace9e authored by Felix Paul Kühne's avatar Felix Paul Kühne

AudioQueue: implement volume support just because we can

parent 10a5990d
...@@ -47,6 +47,7 @@ struct aout_sys_t ...@@ -47,6 +47,7 @@ struct aout_sys_t
{ {
AudioQueueRef audioQueue; AudioQueueRef audioQueue;
bool b_stopped; bool b_stopped;
float f_volume;
}; };
/***************************************************************************** /*****************************************************************************
...@@ -207,6 +208,24 @@ static int TimeGet (audio_output_t *p_aout, mtime_t *restrict delay) ...@@ -207,6 +208,24 @@ static int TimeGet (audio_output_t *p_aout, mtime_t *restrict delay)
return -1; return -1;
} }
/*****************************************************************************
* Module management
*****************************************************************************/
static int VolumeSet(audio_output_t * p_aout, float volume)
{
struct aout_sys_t *p_sys = p_aout->sys;
OSStatus ostatus;
aout_VolumeReport(p_aout, volume);
p_sys->f_volume = volume;
/* Set volume for output unit */
ostatus = AudioQueueSetParameter(p_sys->audioQueue, kAudioQueueParam_Volume, volume * volume * volume);
return ostatus;
}
/***************************************************************************** /*****************************************************************************
* Module management * Module management
*****************************************************************************/ *****************************************************************************/
...@@ -222,6 +241,10 @@ static int Open(vlc_object_t *obj) ...@@ -222,6 +241,10 @@ static int Open(vlc_object_t *obj)
aout->sys = sys; aout->sys = sys;
aout->start = Start; aout->start = Start;
aout->stop = Stop; aout->stop = Stop;
aout->volume_set = VolumeSet;
/* reset volume */
aout_VolumeReport(aout, 1.0);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment