+Track *TimelinePane::over_patchbay()
+{
+ if( !patchbay ) return 0;
+ int patch_x = patchbay->get_relative_cursor_x() ;
+ if( patch_x < 0 || patch_x >= patchbay->get_w() ) return 0;
+ int patch_y = patchbay->get_relative_cursor_y();
+ if( patch_y < 0 || patch_y >= patchbay->get_h() ) return 0;
+// int canvas_x = patch_x + patchbay->get_x() - canvas->get_x();
+ int canvas_y = patch_y + patchbay->get_y() - canvas->get_y();
+ int pane_y = canvas_y + mwindow->edl->local_session->track_start[number];
+ for( Track *track=mwindow->edl->tracks->first; track; track=track->next ) {
+ int track_y = track->y_pixel;
+ if( pane_y < track_y ) continue;
+ track_y += track->vertical_span(mwindow->theme);
+ if( pane_y < track_y )
+ return track;
+ }
+
+ return 0;
+}