mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +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
|
|
@ -108,8 +108,7 @@ TriggerPage::TriggerPage ()
|
|||
_no_strips.signal_drag_data_received ().connect (sigc::mem_fun (*this, &TriggerPage::no_strip_drag_data_received));
|
||||
|
||||
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"));
|
||||
target_table.push_back (Gtk::TargetEntry ("application/x-rootwin-drop"));
|
||||
|
|
@ -527,8 +526,9 @@ TriggerPage::no_strip_drag_motion (Glib::RefPtr<Gdk::DragContext> const& context
|
|||
void
|
||||
TriggerPage::no_strip_drag_data_received (Glib::RefPtr<Gdk::DragContext> const& context, int /*x*/, int y, Gtk::SelectionData const& data, guint /*info*/, guint time)
|
||||
{
|
||||
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 (data.get_target () == "x-ardour/region.pbdid") {
|
||||
PBD::ID rid (data.get_data_as_string ());
|
||||
boost::shared_ptr<Region> region = RegionFactory::region_by_id (rid);
|
||||
boost::shared_ptr<TriggerBox> triggerbox;
|
||||
|
||||
if (boost::dynamic_pointer_cast<AudioRegion> (region)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue