13
0

Re-use the Mixer's PluginManager (singleton)

Previously there were three plugin-manager instances (two of which
were never destroyed).

There were also 3 sets of context-menus (favorites, by tag, by author..),
all of which were re-built when plugin stati changed.

Since the Plugin-manager is a modal dialog, it can be re-used in
all contexts (route-ui, monitor-section, mixer).
This commit is contained in:
Robin Gareus 2019-05-25 00:12:55 +02:00
parent ce8740cf5e
commit 92cfed14cf
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 16 additions and 9 deletions

View File

@ -108,7 +108,6 @@ MonitorSection::MonitorSection ()
channel_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL); channel_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
_plugin_selector = new PluginSelector (PluginManager::instance());
insert_box = new ProcessorBox (0, boost::bind (&MonitorSection::plugin_selector, this), _rr_selection, 0); insert_box = new ProcessorBox (0, boost::bind (&MonitorSection::plugin_selector, this), _rr_selection, 0);
insert_box->set_no_show_all (); insert_box->set_no_show_all ();
insert_box->show (); insert_box->show ();
@ -587,7 +586,6 @@ void
MonitorSection::set_session (Session* s) MonitorSection::set_session (Session* s)
{ {
RouteUI::set_session (s); RouteUI::set_session (s);
_plugin_selector->set_session (_session);
insert_box->set_session (_session); insert_box->set_session (_session);
Glib::RefPtr<ActionGroup> global_monitor_actions = ActionManager::get_action_group (X_("Monitor Section")); Glib::RefPtr<ActionGroup> global_monitor_actions = ActionManager::get_action_group (X_("Monitor Section"));
@ -1613,6 +1611,12 @@ MonitorSection::processors_changed (ARDOUR::RouteProcessorChange)
update_processor_box (); update_processor_box ();
} }
PluginSelector*
MonitorSection::plugin_selector ()
{
return Mixer_UI::instance()->plugin_selector ();
}
void void
MonitorSection::use_others_actions () MonitorSection::use_others_actions ()
{ {

View File

@ -36,7 +36,6 @@
#include "route_ui.h" #include "route_ui.h"
#include "monitor_selector.h" #include "monitor_selector.h"
#include "plugin_selector.h"
#include "processor_box.h" #include "processor_box.h"
#include "processor_selection.h" #include "processor_selection.h"
@ -44,6 +43,8 @@ namespace ArdourWidgets {
class TearOff; class TearOff;
} }
class PluginSelector;
class MonitorSection : public RouteUI, public Gtk::EventBox class MonitorSection : public RouteUI, public Gtk::EventBox
{ {
public: public:
@ -56,7 +57,7 @@ public:
std::string state_id() const; std::string state_id() const;
PluginSelector* plugin_selector() { return _plugin_selector; } PluginSelector* plugin_selector();
void use_others_actions (); void use_others_actions ();
@ -177,7 +178,6 @@ private:
void route_property_changed (const PBD::PropertyChange&) {} void route_property_changed (const PBD::PropertyChange&) {}
ProcessorBox* insert_box; ProcessorBox* insert_box;
PluginSelector* _plugin_selector;
ProcessorSelection _rr_selection; ProcessorSelection _rr_selection;
void help_count_processors (boost::weak_ptr<ARDOUR::Processor> p, uint32_t* cnt) const; void help_count_processors (boost::weak_ptr<ARDOUR::Processor> p, uint32_t* cnt) const;
uint32_t count_processors (); uint32_t count_processors ();

View File

@ -41,6 +41,7 @@
#include "gui_thread.h" #include "gui_thread.h"
#include "io_selector.h" #include "io_selector.h"
#include "keyboard.h" #include "keyboard.h"
#include "mixer_ui.h"
#include "mixer_strip.h" #include "mixer_strip.h"
#include "port_insert_ui.h" #include "port_insert_ui.h"
#include "plugin_selector.h" #include "plugin_selector.h"
@ -140,7 +141,6 @@ RouteParams_UI::RouteParams_UI ()
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK);
_plugin_selector = new PluginSelector (PluginManager::instance());
show_all(); show_all();
} }
@ -228,6 +228,11 @@ RouteParams_UI::map_frozen()
} }
} }
PluginSelector*
RouteParams_UI::plugin_selector() {
return Mixer_UI::instance()->plugin_selector ();
}
void void
RouteParams_UI::setup_processor_boxes() RouteParams_UI::setup_processor_boxes()
{ {
@ -406,7 +411,6 @@ RouteParams_UI::set_session (Session *sess)
ArdourWindow::set_session (sess); ArdourWindow::set_session (sess);
route_display_model->clear(); route_display_model->clear();
_plugin_selector->set_session (_session);
if (_session) { if (_session) {
boost::shared_ptr<RouteList> r = _session->get_routes(); boost::shared_ptr<RouteList> r = _session->get_routes();

View File

@ -64,7 +64,7 @@ public:
void set_session (ARDOUR::Session*); void set_session (ARDOUR::Session*);
void session_going_away (); void session_going_away ();
PluginSelector* plugin_selector() { return _plugin_selector; } PluginSelector* plugin_selector();
private: private:
Gtk::VBox list_vpacker; Gtk::VBox list_vpacker;
@ -112,7 +112,6 @@ private:
IOSelector * _input_iosel; IOSelector * _input_iosel;
IOSelector * _output_iosel; IOSelector * _output_iosel;
PluginSelector *_plugin_selector;
ProcessorSelection _p_selection; ProcessorSelection _p_selection;
boost::shared_ptr<ARDOUR::Route> _route; boost::shared_ptr<ARDOUR::Route> _route;