mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Unify Region Drag/Drop
Identify Regions using PDB::ID. This allows dragging regions from almost anywhere to anywhere, without special cases.
This commit is contained in:
parent
5427cec821
commit
0204ea1f24
13 changed files with 64 additions and 118 deletions
|
|
@ -855,8 +855,6 @@ TriggerBoxUI::TriggerBoxUI (ArdourCanvas::Item* parent, TriggerBox& tb)
|
|||
}
|
||||
|
||||
std::vector<Gtk::TargetEntry> target_table;
|
||||
target_table.push_back (Gtk::TargetEntry ("x-ardour/region.erl", Gtk::TARGET_SAME_APP));
|
||||
target_table.push_back (Gtk::TargetEntry ("x-ardour/region.esl", Gtk::TARGET_SAME_APP));
|
||||
target_table.push_back (Gtk::TargetEntry ("x-ardour/region.pbdid", Gtk::TARGET_SAME_APP));
|
||||
target_table.push_back (Gtk::TargetEntry ("text/uri-list"));
|
||||
target_table.push_back (Gtk::TargetEntry ("text/plain"));
|
||||
|
|
@ -986,21 +984,8 @@ TriggerBoxUI::drag_data_received (Glib::RefPtr<Gdk::DragContext> const& context,
|
|||
context->drag_finish (false, false, time);
|
||||
return;
|
||||
}
|
||||
if (data.get_target () == "x-ardour/region.erl" || data.get_target () == "x-ardour/region.esl") {
|
||||
boost::shared_ptr<Region> region = PublicEditor::instance ().get_dragged_region_from_sidebar ();
|
||||
if (region) {
|
||||
_triggerbox.set_from_selection (n, region);
|
||||
context->drag_finish (true, false, time);
|
||||
} else {
|
||||
context->drag_finish (false, false, time);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.get_target () == "x-ardour/region.pbdid") {
|
||||
/* Long term goal is to receive all information from another TriggerBox Slot,
|
||||
* not just the region.
|
||||
*/
|
||||
PBD::ID rid (data.get_data_as_string ());
|
||||
boost::shared_ptr<Region> region = RegionFactory::region_by_id (rid);
|
||||
if (region) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue