annotate src/audacious/flow.h @ 3636:65b750891387

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