4 #include "modules/modules.h"
10 #include "sys/types.h"
16 fprintf(stderr
, "%s:%d: in function %s: %s\n",
17 get_last_error_file(),
18 get_last_error_line(),
19 get_last_error_func(),
20 get_last_error_message());
25 int main(int argc
, char **argv
)
27 struct graph _graph
, *graph
= &_graph
;
28 struct graphnode
*node
, *source_1
, *source_2
, *mixer
, *sink
;
31 if (graph_create(graph
)){
32 fprintf(stderr
, "cannot create graph\n");
36 moan(wavesource_create(&node
, "/home/aoe/reflections.wav"));
38 moan(graph_add_node(graph
, node
));
39 node
->name
= "source_1";
42 moan(wavesource_create(&node
, "/home/aoe/horizon.wav"));
44 moan(graph_add_node(graph
, node
));
45 node
->name
= "source_2";
48 moan(playsink_create(&node
));
50 moan(graph_add_node(graph
, node
));
54 moan(mixer_create(&node
));
56 moan(graph_add_node(graph
, node
));
60 printf("connecting mixer in0\n");
61 moan(graph_connect(graph
, source_1
->pins
, mixer
->pins
->next
));
62 printf("connecting mixer in1\n");
63 moan(graph_connect(graph
, source_2
->pins
, mixer
->pins
->next
->next
));
64 printf("connecting mixer out\n");
65 moan(graph_connect(graph
, mixer
->pins
, sink
->pins
));
66 moan(graph_sort(graph
));
69 struct graphnode
*node
;
70 for (node
=graph
->sorted_nodes
; node
; node
=node
->sorted_next
){
71 printf("sorted_node: %s\n", node
->name
);
75 while ((err
= graph_run(graph
)) == EOK
);