2005-09-25 18:42:24 +00:00
|
|
|
/*
|
|
|
|
|
Copyright (C) 2000 Paul Davis
|
|
|
|
|
|
|
|
|
|
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __ardour_plugin_selector_h__
|
|
|
|
|
#define __ardour_plugin_selector_h__
|
|
|
|
|
|
2005-11-27 17:59:03 +00:00
|
|
|
#include <gtkmm/dialog.h>
|
2005-10-01 16:29:37 +00:00
|
|
|
#include <gtkmm/notebook.h>
|
|
|
|
|
#include <gtkmm/treeview.h>
|
2005-09-25 20:33:00 +00:00
|
|
|
#include <gtkmm2ext/selector.h>
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2009-02-25 18:26:51 +00:00
|
|
|
#include "ardour/plugin.h"
|
2008-09-10 15:03:30 +00:00
|
|
|
#include "plugin_interest.h"
|
2006-08-01 04:05:15 +00:00
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
namespace ARDOUR {
|
|
|
|
|
class Session;
|
|
|
|
|
class PluginManager;
|
|
|
|
|
}
|
|
|
|
|
|
2005-12-02 19:18:26 +00:00
|
|
|
class PluginSelector : public ArdourDialog
|
2005-09-25 18:42:24 +00:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
PluginSelector (ARDOUR::PluginManager *);
|
|
|
|
|
|
2008-09-10 15:03:30 +00:00
|
|
|
void set_interested_object (PluginInterestedObject&);
|
|
|
|
|
|
2005-11-27 17:59:03 +00:00
|
|
|
int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
|
|
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
void set_session (ARDOUR::Session*);
|
2008-03-17 20:54:03 +00:00
|
|
|
void on_show ();
|
2005-09-25 18:42:24 +00:00
|
|
|
|
2008-09-10 15:03:30 +00:00
|
|
|
Gtk::Menu& plugin_menu ();
|
2008-12-12 14:43:24 +00:00
|
|
|
void show_manager ();
|
2008-09-10 15:03:30 +00:00
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
private:
|
2008-09-10 15:03:30 +00:00
|
|
|
PluginInterestedObject* interested_object;
|
|
|
|
|
|
2005-09-25 18:42:24 +00:00
|
|
|
ARDOUR::Session* session;
|
2008-09-10 15:03:30 +00:00
|
|
|
Gtk::ScrolledWindow scroller; // Available plugins
|
2006-08-01 04:05:15 +00:00
|
|
|
Gtk::ScrolledWindow ascroller; // Added plugins
|
2007-07-30 22:14:04 +00:00
|
|
|
|
|
|
|
|
Gtk::ComboBoxText filter_mode;
|
|
|
|
|
Gtk::Entry filter_entry;
|
|
|
|
|
Gtk::Button filter_button;
|
|
|
|
|
|
|
|
|
|
void filter_button_clicked ();
|
|
|
|
|
void filter_entry_changed ();
|
|
|
|
|
void filter_mode_changed ();
|
2006-08-01 04:05:15 +00:00
|
|
|
|
2008-01-10 21:20:59 +00:00
|
|
|
struct PluginColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
|
PluginColumns () {
|
2008-09-10 15:03:30 +00:00
|
|
|
add (favorite);
|
2005-11-22 05:10:12 +00:00
|
|
|
add (name);
|
2008-01-10 21:20:59 +00:00
|
|
|
add (type_name);
|
|
|
|
|
add (category);
|
|
|
|
|
add (creator);
|
2008-02-20 23:24:51 +00:00
|
|
|
add (audio_ins);
|
|
|
|
|
add (audio_outs);
|
|
|
|
|
add (midi_ins);
|
|
|
|
|
add (midi_outs);
|
2005-11-22 05:10:12 +00:00
|
|
|
add (plugin);
|
|
|
|
|
}
|
2008-09-10 15:03:30 +00:00
|
|
|
Gtk::TreeModelColumn<bool> favorite;
|
2008-01-10 21:20:59 +00:00
|
|
|
Gtk::TreeModelColumn<std::string> name;
|
|
|
|
|
Gtk::TreeModelColumn<std::string> type_name;
|
|
|
|
|
Gtk::TreeModelColumn<std::string> category;
|
|
|
|
|
Gtk::TreeModelColumn<std::string> creator;
|
2008-02-20 23:24:51 +00:00
|
|
|
Gtk::TreeModelColumn<std::string> audio_ins;
|
|
|
|
|
Gtk::TreeModelColumn<std::string> audio_outs;
|
|
|
|
|
Gtk::TreeModelColumn<std::string> midi_ins;
|
|
|
|
|
Gtk::TreeModelColumn<std::string> midi_outs;
|
2008-01-10 21:20:59 +00:00
|
|
|
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
|
2005-11-22 05:10:12 +00:00
|
|
|
};
|
2008-01-10 21:20:59 +00:00
|
|
|
PluginColumns plugin_columns;
|
|
|
|
|
Glib::RefPtr<Gtk::ListStore> plugin_model;
|
|
|
|
|
Gtk::TreeView plugin_display;
|
2006-04-26 16:04:04 +00:00
|
|
|
Gtk::Button* btn_add;
|
|
|
|
|
Gtk::Button* btn_remove;
|
2005-11-22 05:10:12 +00:00
|
|
|
|
|
|
|
|
struct AddedColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
|
AddedColumns () {
|
|
|
|
|
add (text);
|
|
|
|
|
add (plugin);
|
|
|
|
|
}
|
|
|
|
|
Gtk::TreeModelColumn<std::string> text;
|
2006-08-01 21:11:55 +00:00
|
|
|
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
|
2005-11-22 05:10:12 +00:00
|
|
|
};
|
|
|
|
|
AddedColumns acols;
|
|
|
|
|
Glib::RefPtr<Gtk::ListStore> amodel;
|
|
|
|
|
Gtk::TreeView added_list;
|
|
|
|
|
|
2008-01-10 21:20:59 +00:00
|
|
|
void refill ();
|
|
|
|
|
void refiller (const ARDOUR::PluginInfoList& plugs, const::std::string& filterstr, const char* type);
|
|
|
|
|
void ladspa_refiller (const std::string&);
|
2008-01-19 03:49:52 +00:00
|
|
|
void lv2_refiller (const std::string&);
|
2008-01-10 21:20:59 +00:00
|
|
|
void vst_refiller (const std::string&);
|
|
|
|
|
void au_refiller (const std::string&);
|
2005-09-25 18:42:24 +00:00
|
|
|
|
|
|
|
|
ARDOUR::PluginManager *manager;
|
|
|
|
|
|
2005-11-22 05:10:12 +00:00
|
|
|
void row_clicked(GdkEventButton *);
|
2005-09-25 18:42:24 +00:00
|
|
|
void btn_add_clicked();
|
|
|
|
|
void btn_remove_clicked();
|
|
|
|
|
void btn_update_clicked();
|
2006-04-26 16:04:04 +00:00
|
|
|
void added_list_selection_changed();
|
2008-01-10 21:20:59 +00:00
|
|
|
void display_selection_changed();
|
2005-09-25 18:42:24 +00:00
|
|
|
void btn_apply_clicked();
|
2008-09-10 15:03:30 +00:00
|
|
|
ARDOUR::PluginPtr load_plugin (ARDOUR::PluginInfoPtr);
|
2008-01-10 21:20:59 +00:00
|
|
|
bool show_this_plugin (const ARDOUR::PluginInfoPtr&, const std::string&);
|
2007-07-31 16:03:35 +00:00
|
|
|
void setup_filter_string (std::string&);
|
2008-09-10 15:03:30 +00:00
|
|
|
|
|
|
|
|
void favorite_changed (const Glib::ustring& path);
|
|
|
|
|
bool in_row_change;
|
|
|
|
|
|
|
|
|
|
void plugin_chosen_from_menu (const ARDOUR::PluginInfoPtr&);
|
|
|
|
|
Gtk::Menu* _menu;
|
2005-09-25 18:42:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // __ardour_plugin_selector_h__
|
2006-07-31 22:05:28 +00:00
|
|
|
|