Do not allow to DnD plugins to the same route's other processor box

e.g. detached mixer to editor-mixer processor box
This commit is contained in:
Robin Gareus 2024-12-11 15:45:57 +01:00
parent 938e1dc7e2
commit 82cb9ae37b
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 9 additions and 0 deletions

View file

@ -1984,6 +1984,7 @@ ProcessorBox::ProcessorBox (ARDOUR::Session* sess, std::function<PluginSelector*
processor_display.Reordered.connect (sigc::mem_fun (*this, &ProcessorBox::reordered));
processor_display.DropFromAnotherBox.connect (sigc::mem_fun (*this, &ProcessorBox::object_drop));
processor_display.DropFromExternal.connect (sigc::mem_fun (*this, &ProcessorBox::plugin_drop));
processor_display.DragRefuse.connect (sigc::mem_fun (*this, &ProcessorBox::drag_refuse));
processor_scroller.show ();
processor_display.show ();
@ -2151,6 +2152,13 @@ not match the configuration of this track.");
}
}
bool
ProcessorBox::drag_refuse (DnDVBox<ProcessorEntry>* source, ProcessorEntry*)
{
ProcessorBox* other = reinterpret_cast<ProcessorBox*> (source->get_data ("processorbox"));
return (other && other->_route == _route);
}
void
ProcessorBox::object_drop (DnDVBox<ProcessorEntry>* source, ProcessorEntry* position, Glib::RefPtr<Gdk::DragContext> const & context)
{

View file

@ -523,6 +523,7 @@ private:
void plugin_drop (Gtk::SelectionData const &, ProcessorEntry* position, Glib::RefPtr<Gdk::DragContext> const & context);
void object_drop (Gtkmm2ext::DnDVBox<ProcessorEntry> *, ProcessorEntry *, Glib::RefPtr<Gdk::DragContext> const &);
bool drag_refuse (Gtkmm2ext::DnDVBox<ProcessorEntry> *, ProcessorEntry *);
Width _width;
bool _redisplay_pending;