2 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef _gtk2_ardour_lua_script_manager_h_
20 #define _gtk2_ardour_lua_script_manager_h_
22 #include <gtkmm/button.h>
23 #include <gtkmm/notebook.h>
24 #include <gtkmm/liststore.h>
25 #include <gtkmm/treemodel.h>
26 #include <gtkmm/treeview.h>
28 #include "ardour/luascripting.h"
30 #include "ardour_window.h"
31 #include "luainstance.h"
33 class LuaScriptManager : public ArdourWindow
37 void set_session (ARDOUR::Session *);
40 void session_going_away();
46 void setup_actions ();
47 void action_selection_changed ();
48 void set_action_script_name (int, const std::string&);
50 void set_action_btn_clicked ();
51 void del_action_btn_clicked ();
52 void edit_action_btn_clicked ();
53 void call_action_btn_clicked ();
55 class LuaActionScriptModelColumns : public Gtk::TreeModelColumnRecord
58 LuaActionScriptModelColumns ()
66 Gtk::TreeModelColumn<int> id;
67 Gtk::TreeModelColumn<std::string> action;
68 Gtk::TreeModelColumn<std::string> name;
69 Gtk::TreeModelColumn<bool> enabled;
72 Gtk::Button _a_set_button;
73 Gtk::Button _a_del_button;
74 Gtk::Button _a_edit_button;
75 Gtk::Button _a_call_button;
77 Glib::RefPtr<Gtk::ListStore> _a_store;
78 LuaActionScriptModelColumns _a_model;
79 Gtk::TreeView _a_view;
81 /* action callback hooks */
82 void setup_callbacks ();
83 void callback_selection_changed ();
84 void set_callback_script_name (PBD::ID, const std::string&, const ActionHook& ah);
86 void add_callback_btn_clicked ();
87 void del_callback_btn_clicked ();
89 class LuaCallbackScriptModelColumns : public Gtk::TreeModelColumnRecord
92 LuaCallbackScriptModelColumns ()
99 Gtk::TreeModelColumn<PBD::ID> id;
100 Gtk::TreeModelColumn<std::string> name;
101 Gtk::TreeModelColumn<std::string> signals;
104 Glib::RefPtr<Gtk::ListStore> _c_store;
105 LuaCallbackScriptModelColumns _c_model;
106 Gtk::TreeView _c_view;
108 Gtk::Button _c_add_button;
109 Gtk::Button _c_del_button;
111 /* Session scripts */
112 void setup_session_scripts ();
113 void session_script_selection_changed ();
115 void add_sess_btn_clicked ();
116 void del_sess_btn_clicked ();
118 class LuaSessionScriptModelColumns : public Gtk::TreeModelColumnRecord
121 LuaSessionScriptModelColumns ()
126 Gtk::TreeModelColumn<std::string> name;
129 Glib::RefPtr<Gtk::ListStore> _s_store;
130 LuaCallbackScriptModelColumns _s_model;
131 Gtk::TreeView _s_view;
133 Gtk::Button _s_add_button;
134 Gtk::Button _s_del_button;
136 PBD::ScopedConnection _session_script_connection;
139 #endif /* _gtk2_ardour_lua_script_manager_h_ */