Mercurial > audlegacy
comparison src/audacious/flow.h @ 3551:d4f9e45c1e27 trunk
Flow manager.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Tue, 18 Sep 2007 12:57:50 -0500 |
parents | |
children | 5aec9950c47a |
comparison
equal
deleted
inserted
replaced
3549:a5b1084e7f38 | 3551:d4f9e45c1e27 |
---|---|
1 /* | |
2 * Audacious | |
3 * Copyright (c) 2007 William Pitcock | |
4 * | |
5 * flow.h: Definition of flow context structure, flow management API. | |
6 * | |
7 * This program is free software; you can redistribute it and/or modify | |
8 * it under the terms of the GNU General Public License as published by | |
9 * the Free Software Foundation; under version 3 of the License. | |
10 * | |
11 * This program is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program. If not, see <http://www.gnu.org/licenses>. | |
18 * | |
19 * The Audacious team does not consider modular code linking to | |
20 * Audacious or using our public API to be a derived work. | |
21 */ | |
22 | |
23 #include <glib.h> | |
24 #include <mowgli.h> | |
25 | |
26 #include "output.h" | |
27 | |
28 #ifndef __AUDACIOUS_FLOW_H__ | |
29 #define __AUDACIOUS_FLOW_H__ | |
30 | |
31 typedef struct { | |
32 gpointer data; | |
33 gsize len; | |
34 AFormat fmt; | |
35 gint srate; | |
36 gint channels; | |
37 gboolean error; | |
38 } FlowContext; | |
39 | |
40 typedef void (*FlowFunction)(FlowContext *ctx); | |
41 | |
42 typedef struct _FlowElement { | |
43 struct _FlowElement *prev, *next; | |
44 FlowFunction func; | |
45 } FlowElement; | |
46 | |
47 typedef struct { | |
48 mowgli_object_t parent; | |
49 FlowElement *head, *tail; | |
50 } Flow; | |
51 | |
52 void flow_execute(Flow *flow, gpointer data, gsize len, AFormat fmt, | |
53 gint srate, gint channels); | |
54 | |
55 Flow *flow_new(void); | |
56 void flow_link_element(Flow *flow, FlowFunction func); | |
57 void flow_unlink_element(Flow *flow, FlowFunction func); | |
58 | |
59 #define flow_destroy(flow) mowgli_object_unref(flow) | |
60 | |
61 #endif |