From 88af35c0aba64783e111dfb0585d7958a9e9963e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 14 Mar 2009 11:35:40 +0100 Subject: volume: moved code to mixer_all.c --- src/volume.c | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'src/volume.c') diff --git a/src/volume.c b/src/volume.c index 8e97280a4..a7bae9627 100644 --- a/src/volume.c +++ b/src/volume.c @@ -23,9 +23,9 @@ #include "idle.h" #include "pcm_volume.h" #include "config.h" -#include "mixer_control.h" #include "output_all.h" #include "mixer_api.h" +#include "mixer_all.h" #include @@ -166,9 +166,6 @@ void volume_init(void) static int hardware_volume_get(void) { - int device, count; - int volume, volume_total, volume_ok; - assert(hardware_volume_timer != NULL); if (last_hardware_volume >= 0 && @@ -176,25 +173,9 @@ static int hardware_volume_get(void) /* throttle access to hardware mixers */ return last_hardware_volume; - volume_total = 0; - volume_ok = 0; - - count = audio_output_count(); - for (device=0; device 0) { - //return average - last_hardware_volume = volume_total / volume_ok; - g_timer_start(hardware_volume_timer); - return last_hardware_volume; - } else { - return -1; - } + last_hardware_volume = mixer_all_get_volume(); + g_timer_start(hardware_volume_timer); + return last_hardware_volume; } static int software_volume_get(void) @@ -245,16 +226,10 @@ static bool software_volume_change(int change, bool rel) static bool hardware_volume_change(int change, bool rel) { - int device, count; - /* reset the cache */ last_hardware_volume = -1; - count = audio_output_count(); - for (device=0; device