added jackrack filter
[melted] / src / modules / jackrack / ui.h
1 /*
2 * JACK Rack
3 *
4 * Copyright (C) Robert Ham 2002, 2003 (node@users.sourceforge.net)
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #ifndef __JR_UI_H__
22 #define __JR_UI_H__
23
24 #include <glib.h>
25
26 #include "jack_rack.h"
27 #include "plugin_mgr.h"
28 #include "process.h"
29 #include "lock_free_fifo.h"
30
31 typedef struct _ui ui_t;
32
33 enum _ui_state
34 {
35 /* nothing's happening */
36 STATE_NORMAL,
37
38 /* the gui is waiting for the process callback to do something */
39 STATE_RACK_CHANGE,
40
41 /* we're closing down */
42 STATE_QUITTING
43 };
44 typedef enum _ui_state ui_state_t;
45
46
47 struct _jack_rack;
48
49 struct _ui
50 {
51 plugin_mgr_t * plugin_mgr;
52 process_info_t * procinfo;
53 struct _jack_rack * jack_rack;
54
55 lff_t * ui_to_process;
56 lff_t * process_to_ui;
57
58 lff_t *ui_to_midi;
59 lff_t *midi_to_ui;
60
61 char * filename;
62
63 gboolean shutdown;
64 ui_state_t state;
65
66 };
67
68 ui_t * ui_new (const char * client_name, unsigned long channels,
69 gboolean connect_inputs, gboolean connect_outputs);
70 void ui_quit (ui_t * ui);
71 void ui_destroy (ui_t * ui);
72
73 void ui_set_state (ui_t * ui, ui_state_t state);
74 ui_state_t ui_get_state (ui_t * ui);
75
76 void jack_shutdown_cb (void * data);
77 gboolean ui_loop_iterate (ui_t * ui);
78
79 #endif /* __JR_UI_H__ */