set DnD targets per processor
This prevents DnD of non-processors to the sidebar
This commit is contained in:
parent
5d8b75386c
commit
bcaae13e3e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user