#include "edlsession.h"
#include "floatauto.h"
#include "floatautos.h"
+#include "gwindowgui.h"
#include "indexstate.h"
#include "intauto.h"
#include "intautos.h"
}
}
-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;