diff options
author | Robin Gareus <robin@gareus.org> | 2015-12-30 12:15:25 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-12-30 12:25:09 +0100 |
commit | bcaae13e3e7c764d8e3184d151f348676056ba17 (patch) | |
tree | b7d17e3bf3be92fc32c7a6c62deac7cc2c85a6d7 /gtk2_ardour | |
parent | 5d8b75386c00124889c66df61fd8c4dd61a53928 (diff) |
set DnD targets per processor
This prevents DnD of non-processors to the sidebar
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/processor_box.cc | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 73abc02c43..181fc22a19 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -221,8 +221,14 @@ ProcessorEntry::drag_text () const bool ProcessorEntry::drag_data_get (Glib::RefPtr<Gdk::DragContext> const, Gtk::SelectionData &data) { - if (data.get_target() == "PluginPresetPtr" && _plugin_preset_pointer) { + if (data.get_target() == "PluginPresetPtr") { boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_processor); + + if (!_plugin_preset_pointer || !pi) { + data.set (data.get_target(), 8, NULL, 0); + return true; + } + boost::shared_ptr<ARDOUR::Plugin> plugin = pi->plugin(); assert (plugin); @@ -1105,6 +1111,13 @@ static std::list<Gtk::TargetEntry> drop_targets() return tmp; } +static std::list<Gtk::TargetEntry> drop_targets_noplugin() +{ + std::list<Gtk::TargetEntry> tmp; + tmp.push_back (Gtk::TargetEntry ("processor")); + return tmp; +} + ProcessorBox::ProcessorBox (ARDOUR::Session* sess, boost::function<PluginSelector*()> get_plugin_selector, RouteProcessorSelection& rsel, MixerStrip* parent, bool owner_is_mixer) : _parent_strip (parent) @@ -2069,7 +2082,16 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr<Processor> p) e->show_all_controls (); } - processor_display.add_child (e); + if (plugin_insert +#ifdef MIXBUS + && !plugin_insert->plugin(0)->is_channelstrip() +#endif + ) + { + processor_display.add_child (e); + } else { + processor_display.add_child (e, drop_targets_noplugin()); + } } void |