#include "editor.h"
#include "keyboard.h"
#include "public_editor.h"
+#include "ardour_ui.h"
#include "audio_region_view.h"
#include "audio_streamview.h"
#include "audio_time_axis.h"
*/
Duple event_coords = _track_canvas->window_to_canvas (Duple (ev->x, ev->y));
-
+
retry:
switch (direction) {
case GDK_SCROLL_UP:
current_stepping_trackview->step_height (false);
return true;
} else {
- scroll_tracks_up_line ();
+ scroll_up_one_track ();
return true;
}
break;
current_stepping_trackview->step_height (true);
return true;
} else {
- scroll_tracks_down_line ();
+ scroll_down_one_track ();
return true;
}
break;
return typed_event (item, event, PlayheadCursorItem);
}
-bool
-Editor::canvas_zoom_rect_event (GdkEvent *event, ArdourCanvas::Item* item)
-{
- return typed_event (item, event, NoItem);
-}
-
bool
Editor::canvas_note_event (GdkEvent *event, ArdourCanvas::Item* item)
{
bool
Editor::canvas_drop_zone_event (GdkEvent* event)
{
+ GdkEventScroll scroll;
+ ArdourCanvas::Duple winpos;
+
switch (event->type) {
case GDK_BUTTON_RELEASE:
if (event->button.button == 1) {
selection->clear_tracks ();
}
break;
+
+ case GDK_SCROLL:
+ /* convert coordinates back into window space so that
+ we can just call canvas_scroll_event().
+ */
+ winpos = _track_canvas->canvas_to_window (Duple (event->scroll.x, event->scroll.y));
+ scroll = event->scroll;
+ scroll.x = winpos.x;
+ scroll.y = winpos.y;
+ return canvas_scroll_event (&scroll, true);
+ break;
+
+ case GDK_ENTER_NOTIFY:
+ return typed_event (_canvas_drop_zone, event, DropZoneItem);
+
+ case GDK_LEAVE_NOTIFY:
+ return typed_event (_canvas_drop_zone, event, DropZoneItem);
+
default:
break;
}
(void) window_event_sample (&event, &px, &py);
- std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py);
+ std::pair<TimeAxisView*, int> const tv = trackview_by_y_position (py, false);
bool can_drop = false;
if (tv.first != 0) {
* TODO: check if file is audio/midi, allow drops on same track-type only,
* currently: if audio is dropped on a midi-track, it is only added to the region-list
*/
- if (Profile->get_sae() || Config->get_only_copy_imported_files()) {
+ if (Profile->get_sae() || ARDOUR_UI::config()->get_only_copy_imported_files()) {
context->drag_status(Gdk::ACTION_COPY, time);
} else {
if ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY) {