summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2018-02-02 19:25:01 -0600
committerBen Loftis <ben@harrisonconsoles.com>2018-02-02 19:25:01 -0600
commitb69d818ce9fb86728b0033c6396e17dea56508a8 (patch)
tree40e503c11a1dc886e933c4dec667a82fc0980668 /gtk2_ardour
parent3aacdd79ae7537f507e6ee86ad6ffb85bc55bdfc (diff)
Further defer changes of plugin Tags+Status, and consolidate code to call PluginListChanged only once.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/luasignal_syms.h2
-rw-r--r--gtk2_ardour/mixer_ui.cc14
-rw-r--r--gtk2_ardour/mixer_ui.h7
-rw-r--r--gtk2_ardour/plugin_selector.cc33
4 files changed, 23 insertions, 33 deletions
diff --git a/gtk2_ardour/luasignal_syms.h b/gtk2_ardour/luasignal_syms.h
index a56098b3e2..352b653df2 100644
--- a/gtk2_ardour/luasignal_syms.h
+++ b/gtk2_ardour/luasignal_syms.h
@@ -74,7 +74,7 @@ SESSION(RouteGroupsReordered, route_groups_reordered, 0)
// plugin manager instance
STATIC(PluginListChanged, &(PluginManager::instance().PluginListChanged), 0)
-STATIC(PluginStatusesChanged, &(PluginManager::instance().PluginStatusesChanged), 3)
+STATIC(PluginStatusChanged, &(PluginManager::instance().PluginStatusChanged), 3)
//STATIC(PluginStatusesChanged, &(PluginManager::instance().PluginTagsChanged), 3)
// Diskstream static global
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc
index 209644c5d1..27fae43c73 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -365,11 +365,9 @@ Mixer_UI::Mixer_UI ()
#else
#error implement deferred Plugin-Favorite list
#endif
- PluginManager::instance ().PluginListChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::refill_favorite_plugins, this), gui_context());
- PluginManager::instance ().PluginStatusesChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::plugin_status_changed, this, _1, _2, _3), gui_context());
- ARDOUR::Plugin::PresetsChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::refill_favorite_plugins, this), gui_context());
- PluginManager::instance ().PluginTagsChanged.connect(*this, invalidator (*this), boost::bind (&Mixer_UI::tags_changed, this, _1, _2, _3), gui_context());
+ PluginManager::instance ().PluginListChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::plugin_list_changed, this), gui_context());
+ ARDOUR::Plugin::PresetsChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::refill_favorite_plugins, this), gui_context());
}
Mixer_UI::~Mixer_UI ()
@@ -2667,19 +2665,13 @@ Mixer_UI::refill_favorite_plugins ()
}
void
-Mixer_UI::plugin_status_changed (PluginType, std::string, PluginManager::PluginStatusType)
+Mixer_UI::plugin_list_changed ()
{
refill_favorite_plugins();
refill_tag_combo();
}
void
-Mixer_UI::tags_changed (PluginType t, std::string unique_id, std::string tag)
-{
- refill_tag_combo();
-}
-
-void
Mixer_UI::refill_tag_combo ()
{
PluginManager& mgr (PluginManager::instance());
diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h
index 49e60c1b6e..098b1a999b 100644
--- a/gtk2_ardour/mixer_ui.h
+++ b/gtk2_ardour/mixer_ui.h
@@ -368,11 +368,12 @@ private:
void store_current_favorite_order();
void refiller (ARDOUR::PluginInfoList& result, const ARDOUR::PluginInfoList& plugs);
- void plugin_status_changed (ARDOUR::PluginType t, std::string unique_id, ARDOUR::PluginManager::PluginStatusType s);
- void refill_favorite_plugins ();
+ void plugin_list_changed ();
+
+ void refill_favorite_plugins ();
void refill_tag_combo ();
- void tags_changed (ARDOUR::PluginType t, std::string unique_id, std::string tag);
+
void tag_combo_changed ();
void sync_treeview_from_favorite_order ();
diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc
index 6f603da80f..314e36ebb7 100644
--- a/gtk2_ardour/plugin_selector.cc
+++ b/gtk2_ardour/plugin_selector.cc
@@ -68,10 +68,12 @@ PluginSelector::PluginSelector (PluginManager& mgr)
_plugin_menu = 0;
in_row_change = false;
+ //anytime the list changes ( Status, Tags, or scanned plugins ) we need to rebuild redirect-box plugin selector menu
manager.PluginListChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::build_plugin_menu, this), gui_context());
- manager.PluginListChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::refill, this), gui_context());
- manager.PluginStatusesChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::plugin_status_changed, this, _1, _2, _3), gui_context());
- manager.PluginTagsChanged.connect(plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::tags_changed, this, _1, _2, _3), gui_context());
+
+ //these are used to update the info of specific entries, while they are being edited
+ manager.PluginStatusChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::plugin_status_changed, this, _1, _2, _3), gui_context());
+ manager.PluginTagChanged.connect(plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::tags_changed, this, _1, _2, _3), gui_context());
plugin_model = Gtk::ListStore::create (plugin_columns);
plugin_display.set_model (plugin_model);
@@ -818,8 +820,8 @@ PluginSelector::run ()
manager.save_statuses();
}
- if (_need_menu_rebuild) {
- build_plugin_menu();
+ if ( _need_tag_save || _need_status_save || _need_menu_rebuild ) {
+ manager.PluginListChanged(); //emit signal
}
return (int) r;
@@ -840,6 +842,7 @@ PluginSelector::tag_reset_button_clicked ()
manager.reset_tags (pi);
display_selection_changed ();
_need_tag_save = true;
+ _need_menu_rebuild = true;
}
}
@@ -862,6 +865,7 @@ PluginSelector::tag_entry_changed ()
manager.set_tags (pi->type, pi->unique_id, tag_entry->get_text(), false);
_need_tag_save = true;
+ _need_menu_rebuild = true;
}
}
@@ -876,11 +880,6 @@ PluginSelector::tags_changed (PluginType t, std::string unique_id, std::string t
}
row[plugin_columns.tags] = tags;
}
-
- /* A plugin's tags change while the user is entering them.
- * defer a rebuilding of the "tag" menu until the dialog is closed.
- */
- _need_menu_rebuild = true;
}
void
@@ -906,9 +905,6 @@ PluginSelector::plugin_status_changed (PluginType t, std::string uid, PluginMana
plugin_model->erase(i);
}
- /* plugin menu must be re-built to accommodate Hidden and Favorite plugins */
- build_plugin_menu();
-
return;
}
}
@@ -1156,12 +1152,11 @@ PluginSelector::create_by_tags_menu (ARDOUR::PluginInfoList& all_plugs)
Gtk::Menu* submenu;
if ((x = tags_submenu_map.find (*t)) != tags_submenu_map.end()) {
submenu = x->second;
- } else {
+ string typ = GetPluginTypeStr(*i);
+ MenuElem elem ((*i)->name + typ, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
+ elem.get_child()->set_use_underline (false);
+ submenu->items().push_back (elem);
}
- string typ = GetPluginTypeStr(*i);
- MenuElem elem ((*i)->name + typ, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
- elem.get_child()->set_use_underline (false);
- submenu->items().push_back (elem);
}
}
return by_tags;
@@ -1209,6 +1204,7 @@ PluginSelector::favorite_changed (const std::string& path)
manager.set_status (pi->type, pi->unique_id, status);
_need_status_save = true;
+ _need_menu_rebuild = true;
}
in_row_change = false;
}
@@ -1241,6 +1237,7 @@ PluginSelector::hidden_changed (const std::string& path)
manager.set_status (pi->type, pi->unique_id, status);
_need_status_save = true;
+ _need_menu_rebuild = true;
}
in_row_change = false;
}