13
0

allow to add plugin(s) to all selected routes

This commit is contained in:
Robin Gareus 2015-12-25 17:11:47 +01:00
parent 5417af4877
commit e6cb65a171
2 changed files with 36 additions and 0 deletions

View File

@ -205,6 +205,7 @@ Mixer_UI::Mixer_UI ()
favorite_plugins_display.set_can_focus (false);
favorite_plugins_display.add_object_drag (favorite_plugins_columns.plugin.index(), "PluginPresetPtr");
favorite_plugins_display.set_drag_column (favorite_plugins_columns.name.index());
favorite_plugins_display.signal_row_activated().connect (sigc::mem_fun (*this, &Mixer_UI::plugin_row_activated));
favorite_plugins_scroller.add (favorite_plugins_display);
favorite_plugins_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
@ -2327,6 +2328,39 @@ Mixer_UI::sync_treeview_from_favorite_order ()
}
}
void
Mixer_UI::plugin_row_activated (const TreeModel::Path& path, TreeViewColumn* column)
{
if (!_session || _selection.routes.empty()) {
return;
}
TreeIter iter;
if (!(iter = favorite_plugins_model->get_iter (path))) {
return;
}
ARDOUR::PluginPresetPtr ppp = (*iter)[favorite_plugins_columns.plugin];
PluginInfoPtr pip = ppp->_pip;
for (RouteUISelection::iterator i = _selection.routes.begin(); i != _selection.routes.end(); ++i) {
boost::shared_ptr<ARDOUR::Route> rt = (*i)->route();
if (!rt) { continue; }
PluginPtr p = pip->load (*_session);
if (!p) { continue; }
if (ppp->_preset.valid) {
p->load_preset (ppp->_preset);
}
Route::ProcessorStreams err;
boost::shared_ptr<Processor> processor (new PluginInsert (*_session, p));
rt->add_processor_by_index (processor, -1, &err, Config->get_new_plugins_active ());
}
}
bool
PluginTreeStore::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest, const Gtk::SelectionData& data) const
{

View File

@ -198,6 +198,8 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
void track_list_delete (const Gtk::TreeModel::Path&);
void track_list_reorder (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter, int* new_order);
void plugin_row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* column);
void initial_track_display ();
void show_track_list_menu ();