Loading...
Searching...
No Matches
ladspalist.h
Go to the documentation of this file.
/*
* Copyright (C) 2012 Andreas Degert, Hermann Meyer
*
* 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.
*
* 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.
*
* 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.
*/
#include <ladspa.h>
namespace ladspa {
/****************************************************************
** class PluginDisplay
*/
class EnumListStore: public Gtk::ListStore {
public:
class Columns: public Gtk::TreeModel::ColumnRecord {
public:
Gtk::TreeModelColumn<int> value;
Gtk::TreeModelColumn<Glib::ustring> label;
Gtk::TreeModelColumn<PortDesc*> port;
Columns() { add(value); add(label); add(port); }
} col;
EnumListStore(): Gtk::ListStore(Columns()) {}
};
class PortListStore: public Gtk::ListStore {
public:
class Columns: public Gtk::TreeModel::ColumnRecord {
public:
Gtk::TreeModelColumn<int> pos;
Gtk::TreeModelColumn<Glib::ustring> name;
Gtk::TreeModelColumn<Glib::ustring> dflt;
Gtk::TreeModelColumn<Glib::ustring> low;
Gtk::TreeModelColumn<Glib::ustring> up;
Gtk::TreeModelColumn<Glib::ustring> step;
Gtk::TreeModelColumn<Glib::ustring> display;
Gtk::TreeModelColumn<Glib::RefPtr<Gtk::ListStore> > display_types;
Gtk::TreeModelColumn<PortDesc*> port;
Gtk::TreeModelColumn<bool> newrow;
Gtk::TreeModelColumn<bool> use_sr;
Gtk::TreeModelColumn<bool> has_caption;
Columns() {
add(pos); add(name); add(dflt); add(low); add(up); add(step); add(display);
add(display_types); add(port); add(newrow); add(use_sr); add(has_caption);
}
} col;
PortListStore(): Gtk::ListStore(Columns()) {}
};
class PluginListStore: public Gtk::ListStore {
public:
class Columns: public Gtk::TreeModel::ColumnRecord {
public:
Gtk::TreeModelColumn<Glib::ustring> name;
Gtk::TreeModelColumn<bool> active;
Gtk::TreeModelColumn<PluginDesc*> pdesc;
Columns() { add(name); add(active); add(pdesc); }
} col;
PluginListStore(): Gtk::ListStore(Columns()) {}
};
class MasterIdxListStore: public Gtk::ListStore {
public:
class Columns: public Gtk::TreeModel::ColumnRecord {
public:
Gtk::TreeModelColumn<int> idx;
Columns() { add(idx); }
} col;
MasterIdxListStore(): Gtk::ListStore(Columns()) {}
};
class PluginDisplay {
private:
gx_engine::GxMachineBase& machine;
LadspaPluginList pluginlist;
std::vector<PluginDesc*> needs_reload;
PluginDesc *current_plugin;
int old_state;
Glib::RefPtr<gx_gui::GxBuilder> bld;
int change_count;
Glib::RefPtr<Gio::SimpleActionGroup> actiongroup;
Glib::RefPtr<EnumListStore> enum_liststore;
Glib::RefPtr<PortListStore> port_liststore;
Glib::RefPtr<PluginListStore> plugin_liststore;
Glib::RefPtr<MasterIdxListStore> masteridx_liststore;
sigc::connection on_reordered_conn;
Glib::RefPtr<Gtk::ListStore> display_type_list;
Glib::RefPtr<Gtk::ListStore> display_type_list_sr;
Glib::RefPtr<Gtk::ListStore> output_type_list;
sigc::slot<void,bool,bool> finished_callback;
bool reload_plug;
// widget pointers, not initialized
Gtk::Window *window;
Gtk::TreeView *treeview1;
Gtk::TreeView *treeview2;
Gtk::TreeView *treeview3;
Gtk::Entry *ladspa_category;
Gtk::Entry *ladspa_maker;
Gtk::Entry *ladspa_uniqueid;
Gtk::Entry *search_entry;
Gtk::ComboBox *combobox_mono_stereo;
Gtk::ToggleButton *selected_only;
Gtk::ToggleButton *changed_only;
Gtk::ToggleButton *ladspa_only;
Gtk::ToggleButton *lv2_only;
Gtk::ToggleButton *show_all;
Gtk::Box *details_box;
Gtk::ToggleButton *show_details;
Gtk::Entry *plugin_name;
Gtk::ComboBox *plugin_category;
Gtk::ToggleButton *dry_wet_button;
Gtk::ToggleButton *stereo_to_mono_button;
Gtk::ComboBox *plugin_quirks;
Gtk::ComboBox *master_slider_idx;
Gtk::Entry *master_slider_name;
Gtk::CellRendererText *cellrenderer_master;
Gtk::CellRendererToggle *cellrenderer_newrow;
Gtk::CellRendererToggle *cellrenderer_caption;
Gtk::CellRendererToggle *cellrenderer_active;
Gtk::CellRendererText *cellrenderer_category;
Gtk::CellRendererText *cellrenderer_quirks;
private:
void set_title();
void on_save();
void on_apply();
void on_quit();
void on_select_all(bool v);
void on_find();
bool on_delete_event(GdkEventAny*);
void on_show_details();
void on_add_dry_wet_controller();
void on_stereo_to_mono_controller();
void on_stereo_to_mono();
void on_row_activated(const Gtk::TreePath& path, Gtk::TreeViewColumn* column);
void on_label_edited(const Glib::ustring& path, const Glib::ustring& newtext);
void on_parameter_selection_changed();
void on_reordered(const Gtk::TreePath& path);
void on_type_edited(const Glib::ustring& path, const Glib::ustring& newtext);
void on_step_edited(const Glib::ustring& path, const Glib::ustring& newtext);
void on_newrow_toggled(const Glib::ustring& path);
void on_caption_toggled(const Glib::ustring& path);
void on_name_edited(const Glib::ustring& path, const Glib::ustring& newtext);
void on_dflt_edited(const Glib::ustring& path, const Glib::ustring& newtext);
void on_low_edited(const Glib::ustring& path, const Glib::ustring& newtext);
void on_up_edited(const Glib::ustring& path, const Glib::ustring& newtext);
void on_search_entry_activate();
void selection_changed();
void on_active_toggled(const Glib::ustring& path);
void on_view_changed(const Gtk::ToggleButton*);
void display_category(const Gtk::TreeIter& it);
void display_quirks(const Gtk::TreeIter& it);
void on_mono_stereo_changed();
void on_delete_changes();
bool search_equal(const Glib::RefPtr<Gtk::TreeModel>& model, int column, const Glib::ustring& key, const Gtk::TreeIter& iter);
void display_label(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_step(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_ladspa(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_idx(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_name(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_default(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_lower(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_upper(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_SR(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_type(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_newrow(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
void display_caption(Gtk::CellRenderer *cell, const Gtk::TreeIter& it);
bool check_for_changes();
int ask_discard();
void save_current();
void load();
bool do_save();
void set_old_state(PluginDesc *p);
void display_master_idx(const Gtk::TreeIter& it);
void set_master_text();
void load_ladspalist(std::vector<unsigned long>& old_not_found, std::vector<PluginDesc*>& l);
public:
PluginDisplay(gx_engine::GxMachineBase& machine, Glib::RefPtr<Gdk::Pixbuf> icon, sigc::slot<void,bool,bool> finished_callback);
~PluginDisplay();
bool check_exit();
void present() { window->present(); }
void hide() { window->hide(); }
};
} // namespace ladspa
gx_engine::GxMachineBase
Definition machine.h:59
ladspa::EnumListStore::Columns
Definition ladspalist.h:29
ladspa::EnumListStore::Columns::port
Gtk::TreeModelColumn< PortDesc * > port
Definition ladspalist.h:33
ladspa::EnumListStore::Columns::Columns
Columns()
Definition ladspalist.h:34
ladspa::EnumListStore::Columns::label
Gtk::TreeModelColumn< Glib::ustring > label
Definition ladspalist.h:32
ladspa::EnumListStore::Columns::value
Gtk::TreeModelColumn< int > value
Definition ladspalist.h:31
ladspa::EnumListStore::EnumListStore
EnumListStore()
Definition ladspalist.h:36
ladspa::EnumListStore::col
ladspa::EnumListStore::Columns col
ladspa::LadspaPluginList
Definition ladspaback.h:201
ladspa::MasterIdxListStore::Columns
Definition ladspalist.h:77
ladspa::MasterIdxListStore::Columns::Columns
Columns()
Definition ladspalist.h:80
ladspa::MasterIdxListStore::Columns::idx
Gtk::TreeModelColumn< int > idx
Definition ladspalist.h:79
ladspa::MasterIdxListStore::col
ladspa::MasterIdxListStore::Columns col
ladspa::MasterIdxListStore::MasterIdxListStore
MasterIdxListStore()
Definition ladspalist.h:82
ladspa::PluginDesc
Definition ladspaback.h:134
ladspa::PluginDisplay::plugin_name
Gtk::Entry * plugin_name
Definition ladspalist.h:122
ladspa::PluginDisplay::combobox_mono_stereo
Gtk::ComboBox * combobox_mono_stereo
Definition ladspalist.h:114
ladspa::PluginDisplay::details_box
Gtk::Box * details_box
Definition ladspalist.h:120
ladspa::PluginDisplay::display_step
void display_step(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_quit
void on_quit()
ladspa::PluginDisplay::enum_liststore
Glib::RefPtr< EnumListStore > enum_liststore
Definition ladspalist.h:95
ladspa::PluginDisplay::on_reordered_conn
sigc::connection on_reordered_conn
Definition ladspalist.h:99
ladspa::PluginDisplay::plugin_liststore
Glib::RefPtr< PluginListStore > plugin_liststore
Definition ladspalist.h:97
ladspa::PluginDisplay::current_plugin
PluginDesc * current_plugin
Definition ladspalist.h:90
ladspa::PluginDisplay::on_reordered
void on_reordered(const Gtk::TreePath &path)
ladspa::PluginDisplay::finished_callback
sigc::slot< void, bool, bool > finished_callback
Definition ladspalist.h:103
ladspa::PluginDisplay::load_ladspalist
void load_ladspalist(std::vector< unsigned long > &old_not_found, std::vector< PluginDesc * > &l)
ladspa::PluginDisplay::selection_changed
void selection_changed()
ladspa::PluginDisplay::on_label_edited
void on_label_edited(const Glib::ustring &path, const Glib::ustring &newtext)
ladspa::PluginDisplay::display_upper
void display_upper(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::cellrenderer_master
Gtk::CellRendererText * cellrenderer_master
Definition ladspalist.h:129
ladspa::PluginDisplay::ladspa_maker
Gtk::Entry * ladspa_maker
Definition ladspalist.h:111
ladspa::PluginDisplay::changed_only
Gtk::ToggleButton * changed_only
Definition ladspalist.h:116
ladspa::PluginDisplay::display_idx
void display_idx(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_mono_stereo_changed
void on_mono_stereo_changed()
ladspa::PluginDisplay::needs_reload
std::vector< PluginDesc * > needs_reload
Definition ladspalist.h:89
ladspa::PluginDisplay::dry_wet_button
Gtk::ToggleButton * dry_wet_button
Definition ladspalist.h:124
ladspa::PluginDisplay::actiongroup
Glib::RefPtr< Gio::SimpleActionGroup > actiongroup
Definition ladspalist.h:94
ladspa::PluginDisplay::selected_only
Gtk::ToggleButton * selected_only
Definition ladspalist.h:115
ladspa::PluginDisplay::stereo_to_mono_button
Gtk::ToggleButton * stereo_to_mono_button
Definition ladspalist.h:125
ladspa::PluginDisplay::output_type_list
Glib::RefPtr< Gtk::ListStore > output_type_list
Definition ladspalist.h:102
ladspa::PluginDisplay::set_old_state
void set_old_state(PluginDesc *p)
ladspa::PluginDisplay::display_SR
void display_SR(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::cellrenderer_active
Gtk::CellRendererToggle * cellrenderer_active
Definition ladspalist.h:132
ladspa::PluginDisplay::on_delete_event
bool on_delete_event(GdkEventAny *)
ladspa::PluginDisplay::cellrenderer_newrow
Gtk::CellRendererToggle * cellrenderer_newrow
Definition ladspalist.h:130
ladspa::PluginDisplay::show_details
Gtk::ToggleButton * show_details
Definition ladspalist.h:121
ladspa::PluginDisplay::on_view_changed
void on_view_changed(const Gtk::ToggleButton *)
ladspa::PluginDisplay::ask_discard
int ask_discard()
ladspa::PluginDisplay::window
Gtk::Window * window
Definition ladspalist.h:106
ladspa::PluginDisplay::cellrenderer_caption
Gtk::CellRendererToggle * cellrenderer_caption
Definition ladspalist.h:131
ladspa::PluginDisplay::PluginDisplay
PluginDisplay(gx_engine::GxMachineBase &machine, Glib::RefPtr< Gdk::Pixbuf > icon, sigc::slot< void, bool, bool > finished_callback)
ladspa::PluginDisplay::master_slider_name
Gtk::Entry * master_slider_name
Definition ladspalist.h:128
ladspa::PluginDisplay::treeview2
Gtk::TreeView * treeview2
Definition ladspalist.h:108
ladspa::PluginDisplay::treeview3
Gtk::TreeView * treeview3
Definition ladspalist.h:109
ladspa::PluginDisplay::port_liststore
Glib::RefPtr< PortListStore > port_liststore
Definition ladspalist.h:96
ladspa::PluginDisplay::ladspa_category
Gtk::Entry * ladspa_category
Definition ladspalist.h:110
ladspa::PluginDisplay::display_master_idx
void display_master_idx(const Gtk::TreeIter &it)
ladspa::PluginDisplay::search_entry
Gtk::Entry * search_entry
Definition ladspalist.h:113
ladspa::PluginDisplay::cellrenderer_quirks
Gtk::CellRendererText * cellrenderer_quirks
Definition ladspalist.h:134
ladspa::PluginDisplay::display_label
void display_label(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_apply
void on_apply()
ladspa::PluginDisplay::on_select_all
void on_select_all(bool v)
ladspa::PluginDisplay::on_step_edited
void on_step_edited(const Glib::ustring &path, const Glib::ustring &newtext)
ladspa::PluginDisplay::change_count
int change_count
Definition ladspalist.h:93
ladspa::PluginDisplay::display_quirks
void display_quirks(const Gtk::TreeIter &it)
ladspa::PluginDisplay::hide
void hide()
Definition ladspalist.h:194
ladspa::PluginDisplay::display_type
void display_type(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_stereo_to_mono_controller
void on_stereo_to_mono_controller()
ladspa::PluginDisplay::search_equal
bool search_equal(const Glib::RefPtr< Gtk::TreeModel > &model, int column, const Glib::ustring &key, const Gtk::TreeIter &iter)
ladspa::PluginDisplay::save_current
void save_current()
ladspa::PluginDisplay::on_up_edited
void on_up_edited(const Glib::ustring &path, const Glib::ustring &newtext)
ladspa::PluginDisplay::display_type_list
Glib::RefPtr< Gtk::ListStore > display_type_list
Definition ladspalist.h:100
ladspa::PluginDisplay::display_default
void display_default(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_dflt_edited
void on_dflt_edited(const Glib::ustring &path, const Glib::ustring &newtext)
ladspa::PluginDisplay::lv2_only
Gtk::ToggleButton * lv2_only
Definition ladspalist.h:118
ladspa::PluginDisplay::ladspa_only
Gtk::ToggleButton * ladspa_only
Definition ladspalist.h:117
ladspa::PluginDisplay::on_parameter_selection_changed
void on_parameter_selection_changed()
ladspa::PluginDisplay::display_category
void display_category(const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_type_edited
void on_type_edited(const Glib::ustring &path, const Glib::ustring &newtext)
ladspa::PluginDisplay::load
void load()
ladspa::PluginDisplay::display_caption
void display_caption(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_show_details
void on_show_details()
ladspa::PluginDisplay::set_master_text
void set_master_text()
ladspa::PluginDisplay::master_slider_idx
Gtk::ComboBox * master_slider_idx
Definition ladspalist.h:127
ladspa::PluginDisplay::display_newrow
void display_newrow(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::display_name
void display_name(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::pluginlist
LadspaPluginList pluginlist
Definition ladspalist.h:88
ladspa::PluginDisplay::old_state
int old_state
Definition ladspalist.h:91
ladspa::PluginDisplay::on_row_activated
void on_row_activated(const Gtk::TreePath &path, Gtk::TreeViewColumn *column)
ladspa::PluginDisplay::on_stereo_to_mono
void on_stereo_to_mono()
ladspa::PluginDisplay::machine
gx_engine::GxMachineBase & machine
Definition ladspalist.h:87
ladspa::PluginDisplay::display_type_list_sr
Glib::RefPtr< Gtk::ListStore > display_type_list_sr
Definition ladspalist.h:101
ladspa::PluginDisplay::check_for_changes
bool check_for_changes()
ladspa::PluginDisplay::masteridx_liststore
Glib::RefPtr< MasterIdxListStore > masteridx_liststore
Definition ladspalist.h:98
ladspa::PluginDisplay::on_find
void on_find()
ladspa::PluginDisplay::on_delete_changes
void on_delete_changes()
ladspa::PluginDisplay::bld
Glib::RefPtr< gx_gui::GxBuilder > bld
Definition ladspalist.h:92
ladspa::PluginDisplay::display_lower
void display_lower(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_name_edited
void on_name_edited(const Glib::ustring &path, const Glib::ustring &newtext)
ladspa::PluginDisplay::reload_plug
bool reload_plug
Definition ladspalist.h:104
ladspa::PluginDisplay::ladspa_uniqueid
Gtk::Entry * ladspa_uniqueid
Definition ladspalist.h:112
ladspa::PluginDisplay::show_all
Gtk::ToggleButton * show_all
Definition ladspalist.h:119
ladspa::PluginDisplay::on_low_edited
void on_low_edited(const Glib::ustring &path, const Glib::ustring &newtext)
ladspa::PluginDisplay::on_caption_toggled
void on_caption_toggled(const Glib::ustring &path)
ladspa::PluginDisplay::cellrenderer_category
Gtk::CellRendererText * cellrenderer_category
Definition ladspalist.h:133
ladspa::PluginDisplay::on_newrow_toggled
void on_newrow_toggled(const Glib::ustring &path)
ladspa::PluginDisplay::on_active_toggled
void on_active_toggled(const Glib::ustring &path)
ladspa::PluginDisplay::plugin_quirks
Gtk::ComboBox * plugin_quirks
Definition ladspalist.h:126
ladspa::PluginDisplay::on_save
void on_save()
ladspa::PluginDisplay::display_ladspa
void display_ladspa(Gtk::CellRenderer *cell, const Gtk::TreeIter &it)
ladspa::PluginDisplay::on_search_entry_activate
void on_search_entry_activate()
ladspa::PluginDisplay::present
void present()
Definition ladspalist.h:193
ladspa::PluginDisplay::set_title
void set_title()
ladspa::PluginDisplay::plugin_category
Gtk::ComboBox * plugin_category
Definition ladspalist.h:123
ladspa::PluginDisplay::check_exit
bool check_exit()
ladspa::PluginDisplay::do_save
bool do_save()
ladspa::PluginDisplay::on_add_dry_wet_controller
void on_add_dry_wet_controller()
ladspa::PluginDisplay::treeview1
Gtk::TreeView * treeview1
Definition ladspalist.h:107
ladspa::PluginDisplay::~PluginDisplay
~PluginDisplay()
ladspa::PluginListStore::Columns
Definition ladspalist.h:65
ladspa::PluginListStore::Columns::active
Gtk::TreeModelColumn< bool > active
Definition ladspalist.h:68
ladspa::PluginListStore::Columns::name
Gtk::TreeModelColumn< Glib::ustring > name
Definition ladspalist.h:67
ladspa::PluginListStore::Columns::Columns
Columns()
Definition ladspalist.h:70
ladspa::PluginListStore::Columns::pdesc
Gtk::TreeModelColumn< PluginDesc * > pdesc
Definition ladspalist.h:69
ladspa::PluginListStore::PluginListStore
PluginListStore()
Definition ladspalist.h:72
ladspa::PluginListStore::col
ladspa::PluginListStore::Columns col
ladspa::PortListStore::Columns
Definition ladspalist.h:41
ladspa::PortListStore::Columns::step
Gtk::TreeModelColumn< Glib::ustring > step
Definition ladspalist.h:48
ladspa::PortListStore::Columns::newrow
Gtk::TreeModelColumn< bool > newrow
Definition ladspalist.h:52
ladspa::PortListStore::Columns::port
Gtk::TreeModelColumn< PortDesc * > port
Definition ladspalist.h:51
ladspa::PortListStore::Columns::use_sr
Gtk::TreeModelColumn< bool > use_sr
Definition ladspalist.h:53
ladspa::PortListStore::Columns::Columns
Columns()
Definition ladspalist.h:55
ladspa::PortListStore::Columns::pos
Gtk::TreeModelColumn< int > pos
Definition ladspalist.h:43
ladspa::PortListStore::Columns::display_types
Gtk::TreeModelColumn< Glib::RefPtr< Gtk::ListStore > > display_types
Definition ladspalist.h:50
ladspa::PortListStore::Columns::up
Gtk::TreeModelColumn< Glib::ustring > up
Definition ladspalist.h:47
ladspa::PortListStore::Columns::low
Gtk::TreeModelColumn< Glib::ustring > low
Definition ladspalist.h:46
ladspa::PortListStore::Columns::has_caption
Gtk::TreeModelColumn< bool > has_caption
Definition ladspalist.h:54
ladspa::PortListStore::Columns::dflt
Gtk::TreeModelColumn< Glib::ustring > dflt
Definition ladspalist.h:45
ladspa::PortListStore::Columns::display
Gtk::TreeModelColumn< Glib::ustring > display
Definition ladspalist.h:49
ladspa::PortListStore::Columns::name
Gtk::TreeModelColumn< Glib::ustring > name
Definition ladspalist.h:44
ladspa::PortListStore::col
ladspa::PortListStore::Columns col
ladspa::PortListStore::PortListStore
PortListStore()
Definition ladspalist.h:60
ladspa.h
ladspa
Definition ladspaback.h:21