Further defer changes of plugin Tags+Status, and consolidate code to call PluginListChanged only once.
This commit is contained in:
parent
3aacdd79ae
commit
b69d818ce9
|
@ -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
|
||||
|
|
|
@ -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,18 +2665,12 @@ 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 ()
|
||||
{
|
||||
|
|
|
@ -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 ();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -97,13 +97,14 @@ public:
|
|||
};
|
||||
std::vector<std::string> get_all_tags (enum TagFilter) const;
|
||||
|
||||
/** plugins were added to or removed from one of the PluginInfoLists */
|
||||
/** plugins were added to or removed from one of the PluginInfoLists, OR the user has made changes to the status/tags */
|
||||
PBD::Signal0<void> PluginListChanged;
|
||||
|
||||
/** Plugin Hidden/Favorite status changed */
|
||||
PBD::Signal3<void, ARDOUR::PluginType, std::string, PluginStatusType> PluginStatusesChanged; //PluginType t, string id, string tag
|
||||
/** A single plugin's Hidden/Favorite status changed */
|
||||
PBD::Signal3<void, ARDOUR::PluginType, std::string, PluginStatusType> PluginStatusChanged; //PluginType t, string id, string tag
|
||||
|
||||
PBD::Signal3<void, ARDOUR::PluginType, std::string, std::string> PluginTagsChanged; //PluginType t, string id, string tag
|
||||
/** A single plugin's Tags status changed */
|
||||
PBD::Signal3<void, ARDOUR::PluginType, std::string, std::string> PluginTagChanged; //PluginType t, string id, string tag
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -1474,7 +1474,7 @@ PluginManager::set_status (PluginType t, string id, PluginStatusType status)
|
|||
statuses.insert (ps);
|
||||
}
|
||||
|
||||
PluginStatusesChanged (t, id, status); /* EMIT SIGNAL */
|
||||
PluginStatusChanged (t, id, status); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
PluginType
|
||||
|
@ -1612,7 +1612,7 @@ PluginManager::set_tags (PluginType t, string id, string tag, bool factory, bool
|
|||
ptags.insert (ps);
|
||||
}
|
||||
if (!factory || force) {
|
||||
PluginTagsChanged (t, id, sanitized); /* EMIT SIGNAL */
|
||||
PluginTagChanged (t, id, sanitized); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user