#include "edlsession.h"
#include "floatauto.h"
#include "floatautos.h"
+#include "gwindowgui.h"
#include "indexstate.h"
#include "intauto.h"
#include "intautos.h"
{
int64_t edit_x, edit_y, edit_w, edit_h;
edit_dimensions(edit, edit_x, edit_y, edit_w, edit_h);
-
- if( cursor_x >= edit_x && cursor_x < edit_x + edit_w &&
- cursor_y >= edit_y && cursor_y < edit_y + edit_h ) {
+ if( cursor_y < edit_y || cursor_y >= edit_y + edit_h ) continue;
+ if( cursor_x >= edit_x && cursor_x < edit_x + edit_w ) {
*over_edit = edit;
break;
}
if( edit != track->edits->last ) continue;
- if( edit->silence() ) continue;
if( mwindow->session->current_operation != DRAG_ATRANSITION &&
mwindow->session->current_operation != DRAG_VTRANSITION ) continue;
- if( cursor_x >= edit_x + edit_w &&
- cursor_y >= edit_y && cursor_y < edit_y + edit_h ) {
+ if( !edit->silence() ) {
// add silence to allow drag transition past last edit
// will be deleted by Edits::optimize if not used
double length = mwindow->edl->session->default_transition_length;
int64_t start = edit->startproject+edit->length;
int64_t units = track->to_units(length, 1);
track->edits->create_silence(start, start+units);
+ continue;
}
+ if( cursor_x >= edit_x ) { *over_edit = edit; break; }
}
for(int i = 0; i < track->plugin_set.total; i++)
}
if( !*over_track )
- *over_track = pane->is_over_patchbay();
+ *over_track = pane->over_patchbay();
return 0;
}
(cursor_y = get_relative_cursor_y()) >= 0 && cursor_y < get_h() )
over_window = 1;
else {
- Track *track = pane->is_over_patchbay();
+ Track *track = pane->over_patchbay();
if( track && mwindow->session->track_highlighted == track )
over_window = 1;
}
}
}
-static int auto_colors[AUTOMATION_TOTAL] =
-{
- BLUE,
- RED,
- GREEN,
- BLUE,
- RED,
- GREEN,
- BLUE,
- WHITE,
- 0,
- 0,
- 0,
- WHITE
-};
-
// The operations which correspond to each automation type
-static int auto_operations[AUTOMATION_TOTAL] =
+int TrackCanvas::auto_operations[AUTOMATION_TOTAL] =
{
DRAG_MUTE,
DRAG_CAMERA_X,
auto_keyframe, grouptype);
result = do_float_autos(track, autos,
- cursor_x, cursor_y, draw,
- buttonpress, 0, 0, auto_colors[i],
+ cursor_x, cursor_y, draw, buttonpress,
+ 0, 0, GWindowGUI::auto_colors[i],
auto_keyframe, grouptype);
break; }
buttonpress, 1, 1, MDGREY,
auto_keyframe);
result = do_int_autos(track, autos,
- cursor_x, cursor_y, draw,
- buttonpress, 0, 0, auto_colors[i],
+ cursor_x, cursor_y, draw, buttonpress,
+ 0, 0, GWindowGUI::auto_colors[i],
auto_keyframe);
break; }
}
{
Auto *current;
mwindow->undo->update_undo_before();
- current = mwindow->session->drag_auto = autos->insert_auto(position1);
+ double position = autos->track->from_units(position1);
+ position = mwindow->edl->align_to_frame(position, 0);
+ int64_t new_position = autos->track->to_units(position,0);
+ current = mwindow->session->drag_auto = autos->insert_auto(new_position);
((FloatAuto*)current)->set_value(value);
mwindow->session->drag_start_percentage = value_to_percentage(value, autogrouptype);
mwindow->session->drag_start_position = current->position;
switch(mwindow->edl->session->editing_mode) {
// Test handles and resource boundaries and highlight a track
case EDITING_ARROW: {
- if( mwindow->edl->session->auto_conf->transitions &&
- do_transitions(cursor_x, cursor_y,
+ if( do_transitions(cursor_x, cursor_y,
1, new_cursor, update_cursor) ) break;
if( do_keyframes(cursor_x, cursor_y,
mwindow->edl->session->sample_rate;
//printf("TrackCanvas::button_press_event %d\n", position);
- if(mwindow->edl->session->auto_conf->transitions &&
- do_transitions(cursor_x, cursor_y,
+ if( do_transitions(cursor_x, cursor_y,
1, new_cursor, update_cursor)) break;
if(do_keyframes(cursor_x, cursor_y,
0, get_buttonpress(), new_cursor,
if( do_tracks(cursor_x, cursor_y, 1) ) break;
// Highlight selection
+ if( get_buttonpress() != LEFT_BUTTON ) break;
rerender = start_selection(position);
mwindow->session->current_operation = SELECT_REGION;
update_cursor = 1;
if( update_overlay ) {
gui->draw_overlays(1);
}
-
- if( update_cursor > 0 ) {
+ if( update_cursor < 0 ) {
+// double_click edit
+ gui->swindow->update_selection();
+ }
+ if( update_cursor ) {
gui->update_timebar(0);
gui->hide_cursor(0);
gui->show_cursor(1);
gui->zoombar->update();
gui->flash_canvas(1);
}
- else if(update_cursor < 0) {
- gui->swindow->update_selection();
- }
}
return result;
}