2016-02-13 20:57:22 -05:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
|
2016-02-13 20:57:22 -05:00
|
|
|
*
|
2019-08-02 17:26:43 -04:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2016-02-13 20:57:22 -05:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
2019-08-02 17:26:43 -04:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2016-02-13 20:57:22 -05:00
|
|
|
*/
|
|
|
|
|
2017-07-16 21:48:18 -04:00
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/comboboxtext.h>
|
|
|
|
#include <gtkmm/label.h>
|
|
|
|
|
2016-02-13 20:57:22 -05:00
|
|
|
#include "ardour/luascripting.h"
|
|
|
|
|
|
|
|
#include "ardour_dialog.h"
|
|
|
|
|
|
|
|
class ScriptSelector : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
2023-06-10 15:37:09 -04:00
|
|
|
ScriptSelector (Gtk::Window& parent, std::string title, ARDOUR::LuaScriptInfo::ScriptType t);
|
2016-02-13 20:57:22 -05:00
|
|
|
ARDOUR::LuaScriptInfoPtr script() const { return _script; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void setup_list ();
|
|
|
|
void refresh ();
|
|
|
|
void script_combo_changed ();
|
2017-12-07 10:17:53 -05:00
|
|
|
bool script_separator (const Glib::RefPtr<Gtk::TreeModel> &, const Gtk::TreeModel::iterator &i);
|
|
|
|
|
2016-02-13 20:57:22 -05:00
|
|
|
Gtk::Button* _add;
|
|
|
|
Gtk::ComboBoxText _script_combo;
|
|
|
|
|
2017-12-07 10:17:53 -05:00
|
|
|
Gtk::Label _type_label;
|
2016-02-13 20:57:22 -05:00
|
|
|
Gtk::Label _type;
|
2017-12-07 10:17:53 -05:00
|
|
|
Gtk::Label _author_label;
|
2016-02-13 20:57:22 -05:00
|
|
|
Gtk::Label _author;
|
|
|
|
Gtk::Label _description;
|
|
|
|
|
2016-04-07 16:13:45 -04:00
|
|
|
ARDOUR::LuaScriptList _scripts;
|
2016-02-13 20:57:22 -05:00
|
|
|
ARDOUR::LuaScriptInfoPtr _script;
|
|
|
|
ARDOUR::LuaScriptInfo::ScriptType _script_type;
|
|
|
|
sigc::connection _combocon;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SessionScriptManager : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SessionScriptManager (std::string title, const std::vector<std::string>&);
|
|
|
|
std::string name () { return _names_combo.get_active_text (); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
Gtk::ComboBoxText _names_combo;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ScriptParameterDialog : public ArdourDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScriptParameterDialog (std::string title, const ARDOUR::LuaScriptInfoPtr&, const std::vector<std::string>&, ARDOUR::LuaScriptParamList&);
|
|
|
|
std::string name () { return _name_entry.get_text (); }
|
2024-02-26 12:43:32 -05:00
|
|
|
bool need_interaction () const;
|
2016-02-13 20:57:22 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void update_sensitivity ();
|
2017-04-26 13:45:03 -04:00
|
|
|
bool parameters_ok () const;
|
2016-02-13 20:57:22 -05:00
|
|
|
void active_changed (int, Gtk::CheckButton*, Gtk::Entry*);
|
|
|
|
void value_changed (int, Gtk::Entry*);
|
|
|
|
|
|
|
|
Gtk::Entry _name_entry;
|
|
|
|
Gtk::Button* _add;
|
|
|
|
const std::vector<std::string> &_existing_names;
|
|
|
|
ARDOUR::LuaScriptParamList& _lsp;
|
|
|
|
};
|