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_
23 #include "ardour/luascripting.h"
25 #include "ardour_window.h"
26 #include "luainstance.h"
28 class LuaScriptManager : public ArdourWindow
32 void set_session (ARDOUR::Session *);
35 void session_going_away();
41 void setup_actions ();
42 void action_selection_changed ();
43 void set_action_script_name (int, const std::string&);
45 void set_action_btn_clicked ();
46 void del_action_btn_clicked ();
47 void edit_action_btn_clicked ();
48 void call_action_btn_clicked ();
50 class LuaActionScriptModelColumns : public Gtk::TreeModelColumnRecord
53 LuaActionScriptModelColumns ()
61 Gtk::TreeModelColumn<int> id;
62 Gtk::TreeModelColumn<std::string> action;
63 Gtk::TreeModelColumn<std::string> name;
64 Gtk::TreeModelColumn<bool> enabled;
67 Gtk::Button _a_set_button;
68 Gtk::Button _a_del_button;
69 Gtk::Button _a_edit_button;
70 Gtk::Button _a_call_button;
72 Glib::RefPtr<Gtk::ListStore> _a_store;
73 LuaActionScriptModelColumns _a_model;
74 Gtk::TreeView _a_view;
76 /* action callback hooks */
77 void setup_callbacks ();
78 void callback_selection_changed ();
79 void set_callback_script_name (PBD::ID, const std::string&, const ActionHook& ah);
81 void add_callback_btn_clicked ();
82 void del_callback_btn_clicked ();
84 class LuaCallbackScriptModelColumns : public Gtk::TreeModelColumnRecord
87 LuaCallbackScriptModelColumns ()
94 Gtk::TreeModelColumn<PBD::ID> id;
95 Gtk::TreeModelColumn<std::string> name;
96 Gtk::TreeModelColumn<std::string> signals;
99 Glib::RefPtr<Gtk::ListStore> _c_store;
100 LuaCallbackScriptModelColumns _c_model;
101 Gtk::TreeView _c_view;
103 Gtk::Button _c_add_button;
104 Gtk::Button _c_del_button;
106 /* Session scripts */
107 void setup_session_scripts ();
108 void session_script_selection_changed ();
110 void add_sess_btn_clicked ();
111 void del_sess_btn_clicked ();
113 class LuaSessionScriptModelColumns : public Gtk::TreeModelColumnRecord
116 LuaSessionScriptModelColumns ()
121 Gtk::TreeModelColumn<std::string> name;
124 Glib::RefPtr<Gtk::ListStore> _s_store;
125 LuaCallbackScriptModelColumns _s_model;
126 Gtk::TreeView _s_view;
128 Gtk::Button _s_add_button;
129 Gtk::Button _s_del_button;
131 PBD::ScopedConnection _session_script_connection;
134 #endif /* _gtk2_ardour_lua_script_manager_h_ */