13
0
livetrax/gtk2_ardour/plugin_manager_ui.h

151 lines
5.0 KiB
C
Raw Normal View History

2021-05-26 19:02:11 -04:00
/*
* Copyright (C) 2021 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.
*/
#ifndef _gtkardour_plugin_manager_h_
#define _gtkardour_plugin_manager_h_
#include <gtkmm/box.h>
2021-07-15 23:52:16 -04:00
#include <gtkmm/button.h>
2021-05-26 19:02:11 -04:00
#include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/table.h>
#include <gtkmm/textview.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treerowreference.h>
#include <gtkmm/treestore.h>
#include <gtkmm/treeview.h>
#include "widgets/ardour_button.h"
#include "widgets/pane.h"
#include "ardour/plugin_manager.h"
#include "ardour_window.h"
class PluginManagerUI : public ArdourWindow
{
public:
PluginManagerUI ();
~PluginManagerUI ();
private:
void refill ();
2021-07-16 12:40:51 -04:00
void maybe_refill (ArdourWidgets::ArdourButton*);
2021-05-26 19:02:11 -04:00
void selection_changed ();
2021-06-18 15:21:46 -04:00
void blacklist_changed (std::string const&);
void favorite_changed (std::string const&);
void hidden_changed (std::string const&);
void row_activated (Gtk::TreeModel::Path const&, Gtk::TreeViewColumn*);
2021-05-26 19:02:11 -04:00
void reindex ();
2021-05-26 19:02:11 -04:00
void rescan_all ();
2021-06-18 15:21:46 -04:00
void rescan_faulty ();
2021-05-26 19:02:11 -04:00
void rescan_selected ();
void clear_log ();
void show_plugin_prefs ();
void vst_path_cb (ARDOUR::PluginType);
void edit_vst_path (std::string const&, std::string const&, sigc::slot<std::string>, sigc::slot<bool, std::string>);
2021-05-26 19:02:11 -04:00
2021-07-15 23:52:16 -04:00
void search_entry_changed ();
void search_clear_button_clicked ();
2021-07-16 01:34:43 -04:00
bool show_this_plugin (boost::shared_ptr<ARDOUR::PluginScanLogEntry>, ARDOUR::PluginInfoPtr, const std::string&);
2021-07-15 23:52:16 -04:00
2021-06-18 15:21:46 -04:00
void plugin_status_changed (ARDOUR::PluginType, std::string, ARDOUR::PluginManager::PluginStatusType);
struct PluginCount {
PluginCount ()
: total (0)
, error (0)
, stale (0)
, ndscn (0)
{}
void set (ARDOUR::PluginScanLogEntry const& psle);
unsigned int total;
unsigned int error;
unsigned int stale;
unsigned int ndscn;
};
2021-05-26 19:02:11 -04:00
struct PluginColumns : public Gtk::TreeModel::ColumnRecord {
2021-07-16 01:34:43 -04:00
PluginColumns ()
{
2021-05-26 19:02:11 -04:00
add (status);
add (blacklisted);
2021-06-18 15:21:46 -04:00
add (favorite);
add (hidden);
2021-05-26 19:02:11 -04:00
add (type);
add (path);
2021-07-16 12:40:51 -04:00
add (name);
add (creator);
add (tags);
2021-05-26 19:02:11 -04:00
add (psle);
2021-06-18 15:21:46 -04:00
add (plugin);
add (can_blacklist);
add (can_fav_hide);
2021-05-26 19:02:11 -04:00
}
2021-07-16 01:34:43 -04:00
Gtk::TreeModelColumn<std::string> status;
Gtk::TreeModelColumn<bool> blacklisted;
Gtk::TreeModelColumn<bool> favorite;
Gtk::TreeModelColumn<bool> hidden;
Gtk::TreeModelColumn<std::string> name;
Gtk::TreeModelColumn<std::string> type;
Gtk::TreeModelColumn<std::string> creator;
2021-07-16 12:40:51 -04:00
Gtk::TreeModelColumn<std::string> tags;
2021-07-16 01:34:43 -04:00
Gtk::TreeModelColumn<std::string> path;
2021-05-26 19:02:11 -04:00
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::PluginScanLogEntry> > psle;
2021-07-16 01:34:43 -04:00
Gtk::TreeModelColumn<ARDOUR::PluginInfoPtr> plugin;
Gtk::TreeModelColumn<bool> can_blacklist;
Gtk::TreeModelColumn<bool> can_fav_hide;
2021-05-26 19:02:11 -04:00
};
PluginColumns plugin_columns;
Glib::RefPtr<Gtk::ListStore> plugin_model;
Gtk::TreeView plugin_display;
Gtk::ScrolledWindow _scroller;
Gtk::TextView _log;
Gtk::ScrolledWindow _log_scroller;
ArdourWidgets::VPane _pane;
ArdourWidgets::ArdourButton _btn_reindex;
2021-05-26 19:02:11 -04:00
ArdourWidgets::ArdourButton _btn_rescan_all;
2021-06-18 15:21:46 -04:00
ArdourWidgets::ArdourButton _btn_rescan_err;
2021-05-26 19:02:11 -04:00
ArdourWidgets::ArdourButton _btn_rescan_sel;
ArdourWidgets::ArdourButton _btn_clear;
ArdourWidgets::ArdourButton _btn_prefs;
2021-06-18 15:21:46 -04:00
Gtk::Table _tbl_nfo;
2021-07-15 23:52:16 -04:00
Gtk::Table _tbl_search;
Gtk::Entry _entry_search;
Gtk::Button _btn_search_clear;
ArdourWidgets::ArdourButton _cb_search_name;
ArdourWidgets::ArdourButton _cb_search_type;
2021-07-16 12:40:51 -04:00
ArdourWidgets::ArdourButton _cb_search_tags;
2021-07-15 23:52:16 -04:00
ArdourWidgets::ArdourButton _cb_search_creator;
2021-07-16 12:40:51 -04:00
ArdourWidgets::ArdourButton _cb_search_base_name;
2021-07-15 23:52:16 -04:00
ArdourWidgets::ArdourButton _cb_search_full_path;
2021-05-26 19:02:11 -04:00
Gtk::Table _top;
2021-06-18 15:21:46 -04:00
bool _in_row_change;
2021-07-16 12:40:51 -04:00
bool _in_search_change;
2021-06-18 15:21:46 -04:00
PBD::ScopedConnectionList _manager_connections;
2021-05-26 19:02:11 -04:00
};
#endif // _gtkardour_plugin_manager_h_