2005-09-25 14:42:24 -04: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 12:59:03 -05:00
|
|
|
#include <gtkmm/dialog.h>
|
2005-10-01 12:29:37 -04:00
|
|
|
#include <gtkmm/notebook.h>
|
|
|
|
#include <gtkmm/treeview.h>
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm2ext/selector.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
class PluginManager;
|
|
|
|
class Plugin;
|
|
|
|
}
|
|
|
|
|
2005-12-02 14:18:26 -05:00
|
|
|
class PluginSelector : public ArdourDialog
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
PluginSelector (ARDOUR::PluginManager *);
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::signal<void,ARDOUR::Plugin *> PluginCreated;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-27 12:59:03 -05:00
|
|
|
int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void set_session (ARDOUR::Session*);
|
|
|
|
|
|
|
|
private:
|
|
|
|
ARDOUR::Session* session;
|
|
|
|
Gtk::Notebook notebook;
|
2005-12-02 14:18:26 -05:00
|
|
|
Gtk::ScrolledWindow lscroller;
|
|
|
|
Gtk::ScrolledWindow vscroller;
|
2005-12-06 02:59:46 -05:00
|
|
|
Gtk::ScrolledWindow ascroller;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
// page 1
|
2005-11-22 00:10:12 -05:00
|
|
|
struct LadspaColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
LadspaColumns () {
|
|
|
|
add (name);
|
|
|
|
add (type);
|
|
|
|
add (ins);
|
|
|
|
add (outs);
|
|
|
|
add (plugin);
|
|
|
|
}
|
|
|
|
Gtk::TreeModelColumn<std::string> name;
|
|
|
|
Gtk::TreeModelColumn<std::string> type;
|
|
|
|
Gtk::TreeModelColumn<std::string> ins;
|
|
|
|
Gtk::TreeModelColumn<std::string> outs;
|
|
|
|
Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
|
|
|
|
};
|
|
|
|
LadspaColumns lcols;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> lmodel;
|
|
|
|
Glib::RefPtr<Gtk::TreeSelection> lselection;
|
|
|
|
Gtk::TreeView ladspa_display;
|
2006-04-26 12:04:04 -04:00
|
|
|
Gtk::Button* btn_add;
|
|
|
|
Gtk::Button* btn_remove;
|
2005-11-22 00:10:12 -05:00
|
|
|
|
|
|
|
struct AddedColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
AddedColumns () {
|
|
|
|
add (text);
|
|
|
|
add (plugin);
|
|
|
|
}
|
|
|
|
Gtk::TreeModelColumn<std::string> text;
|
|
|
|
Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
|
|
|
|
};
|
|
|
|
AddedColumns acols;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> amodel;
|
|
|
|
Glib::RefPtr<Gtk::TreeSelection> aselection;
|
|
|
|
Gtk::TreeView added_list;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#ifdef VST_SUPPORT
|
|
|
|
// page 2
|
2005-11-22 00:10:12 -05:00
|
|
|
struct VstColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
VstColumns () {
|
|
|
|
add (name);
|
|
|
|
add (ins);
|
|
|
|
add (outs);
|
|
|
|
add (plugin);
|
|
|
|
}
|
|
|
|
Gtk::TreeModelColumn<std::string> name;
|
|
|
|
Gtk::TreeModelColumn<std::string> ins;
|
|
|
|
Gtk::TreeModelColumn<std::string> outs;
|
|
|
|
Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin;
|
|
|
|
};
|
2006-01-11 01:10:07 -05:00
|
|
|
VstColumns vcols;
|
2005-11-22 00:10:12 -05:00
|
|
|
Glib::RefPtr<Gtk::ListStore> vmodel;
|
|
|
|
Glib::RefPtr<Gtk::TreeSelection> vselection;
|
|
|
|
Gtk::TreeView vst_display;
|
|
|
|
static void _vst_refiller (void *);
|
|
|
|
void vst_refiller ();
|
2006-04-26 12:33:10 -04:00
|
|
|
void vst_display_selection_changed();
|
2005-09-25 14:42:24 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
ARDOUR::PluginInfo* i_selected_plug;
|
|
|
|
|
|
|
|
// We need an integer for the output side because
|
|
|
|
// the name isn't promised to be unique.
|
|
|
|
gint o_selected_plug;
|
|
|
|
|
|
|
|
ARDOUR::PluginManager *manager;
|
|
|
|
list<ARDOUR::PluginInfo*> added_plugins;
|
|
|
|
|
2005-11-22 00:10:12 -05:00
|
|
|
static void _input_refiller (void *);
|
2005-12-02 14:18:26 -05:00
|
|
|
|
2005-11-22 00:10:12 -05:00
|
|
|
void input_refiller ();
|
|
|
|
void row_clicked(GdkEventButton *);
|
2005-09-25 14:42:24 -04:00
|
|
|
void btn_add_clicked();
|
|
|
|
void btn_remove_clicked();
|
|
|
|
void btn_update_clicked();
|
2006-04-26 12:04:04 -04:00
|
|
|
void added_list_selection_changed();
|
|
|
|
void ladspa_display_selection_changed();
|
2005-09-25 14:42:24 -04:00
|
|
|
void btn_apply_clicked();
|
|
|
|
void use_plugin (ARDOUR::PluginInfo*);
|
2005-11-27 12:59:03 -05:00
|
|
|
void cleanup ();
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __ardour_plugin_selector_h__
|