2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2005-2006 Doug McLain <doug@nostar.net>
|
|
|
|
* Copyright (C) 2005-2006 Taybin Rutkin <taybin@taybin.com>
|
|
|
|
* Copyright (C) 2005-2011 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2006-2012 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2006 Nick Mainsbridge <mainsbridge@gmail.com>
|
|
|
|
* Copyright (C) 2009 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2014-2019 Robin Gareus <robin@gareus.org>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#ifndef __ardour_plugin_selector_h__
|
|
|
|
#define __ardour_plugin_selector_h__
|
|
|
|
|
2017-07-16 21:48:18 -04:00
|
|
|
#include <gtkmm/button.h>
|
2018-01-29 19:32:15 -05:00
|
|
|
#include <gtkmm/checkbutton.h>
|
2017-07-16 21:48:18 -04:00
|
|
|
#include <gtkmm/comboboxtext.h>
|
|
|
|
#include <gtkmm/entry.h>
|
|
|
|
#include <gtkmm/liststore.h>
|
2005-10-01 12:29:37 -04:00
|
|
|
#include <gtkmm/notebook.h>
|
2017-07-16 22:55:52 -04:00
|
|
|
#include <gtkmm/scrolledwindow.h>
|
2017-07-16 21:48:18 -04:00
|
|
|
#include <gtkmm/treemodel.h>
|
|
|
|
#include <gtkmm/treeview.h>
|
2017-07-16 22:55:52 -04:00
|
|
|
|
2018-01-30 13:51:45 -05:00
|
|
|
#include "widgets/ardour_button.h"
|
2018-01-30 10:27:55 -05:00
|
|
|
#include "widgets/ardour_dropdown.h"
|
|
|
|
|
2015-12-23 12:23:11 -05:00
|
|
|
#include "gtkmm2ext/dndtreeview.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/plugin.h"
|
2018-01-29 19:32:15 -05:00
|
|
|
#include "ardour/plugin_manager.h"
|
2009-12-17 13:24:23 -05:00
|
|
|
#include "ardour/session_handle.h"
|
2006-08-01 00:05:15 -04:00
|
|
|
|
2017-07-15 11:38:28 -04:00
|
|
|
#include "widgets/ardour_button.h"
|
|
|
|
|
|
|
|
#include "plugin_interest.h"
|
2015-01-04 23:41:39 -05:00
|
|
|
#include "ardour_dialog.h"
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
class PluginManager;
|
|
|
|
}
|
|
|
|
|
2005-12-02 14:18:26 -05:00
|
|
|
class PluginSelector : public ArdourDialog
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2011-11-14 12:41:29 -05:00
|
|
|
PluginSelector (ARDOUR::PluginManager&);
|
2009-11-15 20:06:33 -05:00
|
|
|
~PluginSelector ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-09-10 11:03:30 -04:00
|
|
|
void set_interested_object (PluginInterestedObject&);
|
2009-10-14 12:10:01 -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() ?
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
void on_show ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-11-15 12:19:38 -05:00
|
|
|
Gtk::Menu* plugin_menu ();
|
2008-12-12 09:43:24 -05:00
|
|
|
void show_manager ();
|
2008-09-10 11:03:30 -04:00
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
private:
|
2018-01-29 19:32:15 -05:00
|
|
|
|
|
|
|
//search
|
2018-01-30 13:51:45 -05:00
|
|
|
ArdourWidgets::ArdourButton* _search_name_checkbox;
|
|
|
|
ArdourWidgets::ArdourButton* _search_tags_checkbox;
|
|
|
|
ArdourWidgets::ArdourButton* _search_ignore_checkbox;
|
2018-01-29 19:32:15 -05:00
|
|
|
|
|
|
|
//radio-button filters
|
|
|
|
Gtk::RadioButton *_fil_effects_radio;
|
|
|
|
Gtk::RadioButton *_fil_instruments_radio;
|
|
|
|
Gtk::RadioButton *_fil_utils_radio;
|
|
|
|
Gtk::RadioButton *_fil_favorites_radio;
|
|
|
|
Gtk::RadioButton *_fil_hidden_radio;
|
|
|
|
Gtk::RadioButton *_fil_all_radio;
|
|
|
|
|
2018-01-30 10:27:55 -05:00
|
|
|
/* combobox filters */
|
|
|
|
ArdourWidgets::ArdourDropdown _fil_type_combo;
|
|
|
|
ArdourWidgets::ArdourDropdown _fil_creator_combo;
|
2018-01-29 19:32:15 -05:00
|
|
|
|
2008-09-10 11:03:30 -04:00
|
|
|
PluginInterestedObject* interested_object;
|
|
|
|
|
|
|
|
Gtk::ScrolledWindow scroller; // Available plugins
|
2006-08-01 00:05:15 -04:00
|
|
|
Gtk::ScrolledWindow ascroller; // Added plugins
|
2007-07-30 18:14:04 -04:00
|
|
|
|
2018-01-29 19:32:15 -05:00
|
|
|
Gtk::Entry search_entry;
|
|
|
|
Gtk::Button search_clear_button;
|
|
|
|
|
|
|
|
Gtk::Entry *tag_entry;
|
2018-01-30 22:50:22 -05:00
|
|
|
Gtk::Button* tag_reset_button;
|
2018-01-29 19:32:15 -05:00
|
|
|
void tag_reset_button_clicked ();
|
|
|
|
|
|
|
|
void set_sensitive_widgets();
|
2007-07-30 18:14:04 -04:00
|
|
|
|
2018-01-29 19:32:15 -05:00
|
|
|
void search_clear_button_clicked ();
|
|
|
|
void search_entry_changed ();
|
2015-11-17 21:46:50 -05:00
|
|
|
|
2018-01-29 19:32:15 -05:00
|
|
|
void tag_entry_changed ();
|
|
|
|
sigc::connection tag_entry_connection;
|
|
|
|
|
|
|
|
void tags_changed ( ARDOUR::PluginType t, std::string unique_id, std::string tag);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
struct PluginColumns : public Gtk::TreeModel::ColumnRecord {
|
|
|
|
PluginColumns () {
|
2008-09-10 11:03:30 -04:00
|
|
|
add (favorite);
|
2009-11-08 14:15:28 -05:00
|
|
|
add (hidden);
|
2005-11-22 00:10:12 -05:00
|
|
|
add (name);
|
2018-01-29 19:32:15 -05:00
|
|
|
add (tags);
|
|
|
|
add (creator);
|
2008-01-10 16:20:59 -05:00
|
|
|
add (type_name);
|
2018-01-29 19:32:15 -05:00
|
|
|
add (audio_io);
|
|
|
|
add (midi_io);
|
2005-11-22 00:10:12 -05:00
|
|
|
add (plugin);
|
|
|
|
}
|
2008-09-10 11:03:30 -04:00
|
|
|
Gtk::TreeModelColumn<bool> favorite;
|
2009-11-08 14:15:28 -05:00
|
|
|
Gtk::TreeModelColumn<bool> hidden;
|
2008-01-10 16:20:59 -05:00
|
|
|
Gtk::TreeModelColumn<std::string> name;
|
|
|
|
Gtk::TreeModelColumn<std::string> type_name;
|
|
|
|
Gtk::TreeModelColumn<std::string> creator;
|
2018-01-29 19:32:15 -05:00
|
|
|
Gtk::TreeModelColumn<std::string> tags;
|
|
|
|
Gtk::TreeModelColumn<std::string> audio_io;
|
|
|
|
Gtk::TreeModelColumn<std::string> midi_io;
|
2008-01-10 16:20:59 -05:00
|
|
|
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
|
2005-11-22 00:10:12 -05:00
|
|
|
};
|
2008-01-10 16:20:59 -05:00
|
|
|
PluginColumns plugin_columns;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> plugin_model;
|
2015-12-23 12:23:11 -05:00
|
|
|
Gtkmm2ext::DnDTreeView<ARDOUR::PluginInfoPtr> plugin_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;
|
2006-08-01 17:11:55 -04:00
|
|
|
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
|
2005-11-22 00:10:12 -05:00
|
|
|
};
|
|
|
|
AddedColumns acols;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> amodel;
|
|
|
|
Gtk::TreeView added_list;
|
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
void refill ();
|
|
|
|
void refiller (const ARDOUR::PluginInfoList& plugs, const::std::string& filterstr, const char* type);
|
|
|
|
void ladspa_refiller (const std::string&);
|
2008-01-18 22:49:52 -05:00
|
|
|
void lv2_refiller (const std::string&);
|
2008-01-10 16:20:59 -05:00
|
|
|
void vst_refiller (const std::string&);
|
2011-09-20 16:29:47 -04:00
|
|
|
void lxvst_refiller (const std::string&);
|
2016-11-13 10:32:30 -05:00
|
|
|
void mac_vst_refiller (const std::string&);
|
2008-01-10 16:20:59 -05:00
|
|
|
void au_refiller (const std::string&);
|
2016-04-28 19:26:46 -04:00
|
|
|
void lua_refiller (const std::string&);
|
2019-11-02 23:11:27 -04:00
|
|
|
void vst3_refiller (const std::string&);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-11-15 20:06:33 -05:00
|
|
|
Gtk::Menu* _plugin_menu;
|
2011-11-14 12:41:29 -05:00
|
|
|
ARDOUR::PluginManager& manager;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-04-20 15:51:35 -04:00
|
|
|
void row_activated(Gtk::TreeModel::Path path, Gtk::TreeViewColumn* col);
|
2005-09-25 14:42:24 -04:00
|
|
|
void btn_add_clicked();
|
|
|
|
void btn_remove_clicked();
|
2006-04-26 12:04:04 -04:00
|
|
|
void added_list_selection_changed();
|
2014-07-23 12:38:24 -04:00
|
|
|
void added_row_clicked(GdkEventButton* event);
|
2008-01-10 16:20:59 -05:00
|
|
|
void display_selection_changed();
|
2005-09-25 14:42:24 -04:00
|
|
|
void btn_apply_clicked();
|
2008-09-10 11:03:30 -04:00
|
|
|
ARDOUR::PluginPtr load_plugin (ARDOUR::PluginInfoPtr);
|
2008-01-10 16:20:59 -05:00
|
|
|
bool show_this_plugin (const ARDOUR::PluginInfoPtr&, const std::string&);
|
2008-09-10 11:03:30 -04:00
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
void favorite_changed (const std::string& path);
|
|
|
|
void hidden_changed (const std::string& path);
|
2008-09-10 11:03:30 -04:00
|
|
|
bool in_row_change;
|
|
|
|
|
|
|
|
void plugin_chosen_from_menu (const ARDOUR::PluginInfoPtr&);
|
2009-11-08 14:15:28 -05:00
|
|
|
|
2018-01-29 19:32:15 -05:00
|
|
|
void plugin_status_changed ( ARDOUR::PluginType t, std::string unique_id, ARDOUR::PluginManager::PluginStatusType s );
|
|
|
|
|
2009-11-08 14:15:28 -05:00
|
|
|
Gtk::Menu* create_favs_menu (ARDOUR::PluginInfoList&);
|
2020-06-25 15:10:14 -04:00
|
|
|
Gtk::Menu* create_charts_menu (ARDOUR::PluginInfoList&);
|
2009-11-08 14:15:28 -05:00
|
|
|
Gtk::Menu* create_by_creator_menu (ARDOUR::PluginInfoList&);
|
2018-01-29 19:32:15 -05:00
|
|
|
Gtk::Menu* create_by_tags_menu (ARDOUR::PluginInfoList&);
|
2009-11-15 20:06:33 -05:00
|
|
|
void build_plugin_menu ();
|
2014-02-24 16:39:32 -05:00
|
|
|
PBD::ScopedConnectionList plugin_list_changed_connection;
|
2015-11-17 21:46:50 -05:00
|
|
|
|
2018-01-29 19:32:15 -05:00
|
|
|
bool _need_tag_save;
|
|
|
|
bool _need_status_save;
|
2019-05-24 18:14:50 -04:00
|
|
|
bool _need_menu_rebuild;
|
2018-03-19 13:13:37 -04:00
|
|
|
bool _inhibit_refill;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __ardour_plugin_selector_h__
|
2006-07-31 18:05:28 -04:00
|
|
|
|