diff options
author | David Robillard <d@drobilla.net> | 2008-02-10 18:16:25 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-10 18:16:25 +0000 |
commit | 1b657585572298d1a69a7b43e611f59b7e185df3 (patch) | |
tree | 5b0ca4e1f222357499f97165a13308ac070c5ddc /gtk2_ardour/editor_canvas.cc | |
parent | e76b028ffdf054775cb697174d00cd0222d675c6 (diff) |
Committed underlay support (from Audun).
git-svn-id: svn://localhost/ardour2/branches/3.0@3037 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index aeff20f0bc..a2df1783aa 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -127,6 +127,7 @@ Editor::initialize_canvas () // Drag-N-Drop from the region list can generate this target target_table.push_back (TargetEntry ("regions")); + target_table.push_back (TargetEntry ("routes")); target_table.push_back (TargetEntry ("text/plain")); target_table.push_back (TargetEntry ("text/uri-list")); @@ -457,7 +458,11 @@ Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context if (data.get_target() == "regions") { drop_regions (context, x, y, data, info, time); - } else { + } + else if(data.get_target() == "routes") { + drop_routes (context, x, y, data, info, time); + } + else { drop_paths (context, x, y, data, info, time); } } @@ -541,6 +546,22 @@ Editor::drop_regions (const RefPtr<Gdk::DragContext>& context, } void +Editor::drop_routes (const Glib::RefPtr<Gdk::DragContext>& context, + int x, int y, + const Gtk::SelectionData& data, + guint info, guint time) { + const SerializedObjectPointers<boost::shared_ptr<Route> >* sr = + reinterpret_cast<const SerializedObjectPointers<boost::shared_ptr<Route> > *> (data.get_data()); + + for (uint32_t i = 0; i < sr->cnt; ++i) { + boost::shared_ptr<Route> r = sr->data[i]; + insert_route_list_drag (r, x, y); + } + + context->drag_finish (true, false, time); +} + +void Editor::maybe_autoscroll (GdkEvent* event) { nframes_t rightmost_frame = leftmost_frame + current_page_frames(); |