13
0

add "remove from favorites" context menu

This commit is contained in:
Robin Gareus 2015-12-27 18:17:45 +01:00
parent 9b7352f35f
commit 47922c5d19
2 changed files with 33 additions and 11 deletions

View File

@ -2343,18 +2343,19 @@ Mixer_UI::popup_note_context_menu (GdkEventButton *ev)
if (_selection.routes.empty()) {
items.push_back (MenuElem (_("No Track/Bus is selected.")));
m->popup (ev->button, ev->time);
return;
}
} else {
items.push_back (MenuElem (_("Add at the top"),
sigc::bind (sigc::mem_fun (*this, &Mixer_UI::add_selected_processor), AddTop)));
items.push_back (MenuElem (_("Add Pre-Fader"),
sigc::bind (sigc::mem_fun (*this, &Mixer_UI::add_selected_processor), AddPreFader)));
items.push_back (MenuElem (_("Add Post-Fader"),
sigc::bind (sigc::mem_fun (*this, &Mixer_UI::add_selected_processor), AddPostFader)));
items.push_back (MenuElem (_("Add at the end"),
sigc::bind (sigc::mem_fun (*this, &Mixer_UI::add_selected_processor), AddBottom)));
items.push_back (MenuElem (_("Add at the top"),
sigc::bind (sigc::mem_fun (*this, &Mixer_UI::add_selected_processor), AddTop)));
items.push_back (MenuElem (_("Add Pre-Fader"),
sigc::bind (sigc::mem_fun (*this, &Mixer_UI::add_selected_processor), AddPreFader)));
items.push_back (MenuElem (_("Add Post-Fader"),
sigc::bind (sigc::mem_fun (*this, &Mixer_UI::add_selected_processor), AddPostFader)));
items.push_back (MenuElem (_("Add at the end"),
sigc::bind (sigc::mem_fun (*this, &Mixer_UI::add_selected_processor), AddBottom)));
}
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Remove from favorites"), sigc::mem_fun (*this, &Mixer_UI::remove_selected_from_favorites)));
m->popup (ev->button, ev->time);
}
@ -2382,6 +2383,26 @@ Mixer_UI::add_selected_processor (ProcessorPosition pos)
add_favorite_processor (ppp, pos);
}
void
Mixer_UI::remove_selected_from_favorites ()
{
Glib::RefPtr<Gtk::TreeView::Selection> selection = favorite_plugins_display.get_selection();
if (!selection) {
return;
}
Gtk::TreeModel::iterator iter = selection->get_selected();
if (!iter) {
return;
}
ARDOUR::PluginPresetPtr ppp = (*iter)[favorite_plugins_columns.plugin];
PluginManager::PluginStatusType status = PluginManager::Normal;
PluginManager& manager (PluginManager::instance());
manager.set_status (ppp->_pip->type, ppp->_pip->unique_id, status);
manager.save_statuses ();
sync_treeview_from_favorite_order ();
}
void
Mixer_UI::plugin_row_activated (const TreeModel::Path& path, TreeViewColumn* column)
{

View File

@ -211,6 +211,7 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
void add_selected_processor (ProcessorPosition);
void add_favorite_processor (ARDOUR::PluginPresetPtr, ProcessorPosition);
void remove_selected_from_favorites ();
void initial_track_display ();
void show_track_list_menu ();