1 /* Calf DSP Library Utility Application - calfjackhost
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
30 #include <calf/jackhost.h>
31 #include "custom_ctl.h"
33 namespace calf_plugins
{
35 class main_window
: public main_window_iface
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
;
50 add_plugin_params(main_window
*_main_win
, const std::string
&_name
)
51 : main_win(_main_win
), name(_name
) {}
57 GtkWidget
*strips_table
;
59 GtkActionGroup
*std_actions
, *plugin_actions
;
61 std::map
<plugin_ctl_iface
*, plugin_strip
*> plugins
;
62 std::set
<std::string
> conditions
;
63 std::vector
<plugin_ctl_iface
*> plugin_queue
;
67 main_window_owner_iface
*owner
;
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
);
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
);
87 void open_gui(plugin_ctl_iface
*plugin
);
88 bool check_condition(const char *cond
) {
89 return conditions
.count(cond
) != 0;