changeset 3546:fd4cd1945b91 trunk

Connect volumecontrol flow to the work pipeline.
author William Pitcock <nenolod@atheme.org>
date Tue, 18 Sep 2007 10:47:14 -0500
parents 7a2b667bab4b
children 22136a5c3ea6
files src/audacious/output.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/output.c	Tue Sep 18 10:41:40 2007 -0500
+++ b/src/audacious/output.c	Tue Sep 18 10:47:14 2007 -0500
@@ -37,6 +37,7 @@
 #include "configdb.h"
 
 #include "effect.h"
+#include "volumecontrol.h"
 
 #include <math.h>
 
@@ -171,7 +172,10 @@
     if (!op_data.current_output_plugin->get_volume)
         return;
 
-    op_data.current_output_plugin->get_volume(l, r);
+    if (cfg.software_volume_control)
+        volumecontrol_get_volume_state(l, r);
+    else
+        op_data.current_output_plugin->get_volume(l, r);
 }
 
 void
@@ -183,7 +187,10 @@
     if (!op_data.current_output_plugin->set_volume)
         return;
 
-    op_data.current_output_plugin->set_volume(l, r);
+    if (cfg.software_volume_control)
+        volumecontrol_set_volume_state(l, r);
+    else
+        op_data.current_output_plugin->set_volume(l, r);
 }
 
 void
@@ -520,6 +527,9 @@
     length = effect_do_mod_samples(&ptr, length, op_state.fmt, op_state.rate, 
         op_state.nch);
 
+    if (cfg.software_volume_control)
+        volumecontrol_pad_audio(ptr, length, op_state.fmt, op_state.nch);
+
     writeoffs = 0;
     while (writeoffs < length)
     {