+ Filter: move implementation of get_changed_offsets to .cpp file
[calf.git] / src / calf / main_win.h
blob21ea9c705f37b16664ba89945fb837d3775e93af
1 /* Calf DSP Library Utility Application - calfjackhost
2 * GUI - main window
4 * Copyright (C) 2007 Krzysztof Foltman
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 * Boston, MA 02111-1307, USA.
21 #ifndef __CALF_MAIN_WIN_H
22 #define __CALF_MAIN_WIN_H
24 #include <expat.h>
25 #include <map>
26 #include <set>
27 #include <vector>
28 #include <gtk/gtk.h>
29 #include <calf/gui.h>
30 #include <calf/jackhost.h>
31 #include "custom_ctl.h"
33 namespace calf_plugins {
35 class main_window: public main_window_iface
37 public:
38 struct plugin_strip
40 main_window *main_win;
41 plugin_ctl_iface *plugin;
42 plugin_gui_window *gui_win;
43 GtkWidget *name, *midi_in, *audio_in[2], *audio_out[2], *extra;
46 struct add_plugin_params
48 main_window *main_win;
49 std::string name;
50 add_plugin_params(main_window *_main_win, const std::string &_name)
51 : main_win(_main_win), name(_name) {}
54 public:
55 GtkWindow *toplevel;
56 GtkWidget *all_vbox;
57 GtkWidget *strips_table;
58 GtkUIManager *ui_mgr;
59 GtkActionGroup *std_actions, *plugin_actions;
60 jack_client *client;
61 std::map<plugin_ctl_iface *, plugin_strip *> plugins;
62 std::set<std::string> conditions;
63 std::vector<plugin_ctl_iface *> plugin_queue;
64 std::string prefix;
65 bool is_closed;
66 int source_id;
67 main_window_owner_iface *owner;
69 protected:
70 plugin_strip *create_strip(plugin_ctl_iface *plugin);
71 void update_strip(plugin_ctl_iface *plugin);
72 static gboolean on_idle(void *data);
73 std::string make_plugin_list(GtkActionGroup *actions);
74 static void add_plugin_action(GtkWidget *src, gpointer data);
76 public:
77 main_window();
78 void set_owner(main_window_owner_iface *_owner) { owner = _owner; }
79 void new_plugin(const char *name) { owner->new_plugin(name); }
80 void add_plugin(plugin_ctl_iface *plugin);
81 void del_plugin(plugin_ctl_iface *plugin);
82 void set_window(plugin_ctl_iface *iface, plugin_gui_window *window);
83 void refresh_all_presets(bool builtin_too);
84 void refresh_plugin(plugin_ctl_iface *plugin);
85 void on_closed();
86 void close_guis();
87 void open_gui(plugin_ctl_iface *plugin);
88 bool check_condition(const char *cond) {
89 return conditions.count(cond) != 0;
92 void create();
96 #endif