changeset 3559:0898b8139af8 trunk

Vis -> Flow API.
author William Pitcock <nenolod@atheme.org>
date Tue, 18 Sep 2007 13:33:45 -0500
parents 5aec9950c47a
children 154f21dcd61e
files src/audacious/output.c src/audacious/visualization.c src/audacious/visualization.h
diffstat 3 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/output.c	Tue Sep 18 13:31:05 2007 -0500
+++ b/src/audacious/output.c	Tue Sep 18 13:33:45 2007 -0500
@@ -40,6 +40,7 @@
 
 #include "effect.h"
 #include "volumecontrol.h"
+#include "visualization.h"
 
 #include <math.h>
 
@@ -442,6 +443,7 @@
     {
         postproc_flow = flow_new();
         flow_link_element(postproc_flow, effect_flow);
+        flow_link_element(postproc_flow, vis_flow);
         flow_link_element(postproc_flow, volumecontrol_flow);
     }
 
@@ -503,9 +505,6 @@
             byteswap(length, ptr); /* swap back for output */
     }                           
 
-    /* do vis plugin(s) */
-    input_add_vis_pcm(time, fmt, nch, length, ptr);
-
     flow_execute(postproc_flow, time, ptr, length, op_state.fmt, op_state.rate, op_state.nch);
 
     writeoffs = 0;
--- a/src/audacious/visualization.c	Tue Sep 18 13:31:05 2007 -0500
+++ b/src/audacious/visualization.c	Tue Sep 18 13:33:45 2007 -0500
@@ -446,3 +446,10 @@
     else
         ui_vis_timeout_func(mainwin_vis, intern_vis_data);
 }
+
+void
+vis_flow(FlowContext *context)
+{
+    input_add_vis_pcm(context->time, context->fmt, context->channels,
+        context->len, context->data);
+}
--- a/src/audacious/visualization.h	Tue Sep 18 13:31:05 2007 -0500
+++ b/src/audacious/visualization.h	Tue Sep 18 13:33:45 2007 -0500
@@ -26,7 +26,7 @@
 #define VISUALIZATION_H
 
 #include <glib.h>
-
+#include "flow.h"
 #include "plugin.h"
 
 typedef struct _VisPluginData VisPluginData;
@@ -46,6 +46,7 @@
 gchar *vis_stringify_enabled_list(void);
 void vis_enable_from_stringified_list(gchar * list);
 void vis_send_data(gint16 pcm_data[2][512], gint nch, gint length);
+void vis_flow(FlowContext *context);
 
 extern VisPluginData vp_data;