#include "edlsession.h"
#include "floatauto.h"
#include "floatautos.h"
+#include "gwindowgui.h"
#include "indexstate.h"
#include "intauto.h"
#include "intautos.h"
//printf("TrackCanvas::draw_loop_points 7\n");
}
-void TrackCanvas::draw_brender_start()
+void TrackCanvas::draw_brender_range()
{
if(mwindow->preferences->use_brender)
{
- int64_t x = Units::round(mwindow->edl->session->brender_start *
+ int64_t x1 = Units::round(mwindow->edl->session->brender_start *
mwindow->edl->session->sample_rate /
- mwindow->edl->local_session->zoom_sample -
+ mwindow->edl->local_session->zoom_sample -
+ mwindow->edl->local_session->view_start[pane->number]);
+ if(MWindowGUI::visible(x1, x1 + 1, 0, get_w()))
+ {
+ set_color(RED);
+ draw_line(x1, 0, x1, get_h());
+ }
+ int64_t x2 = Units::round(mwindow->edl->session->brender_end *
+ mwindow->edl->session->sample_rate /
+ mwindow->edl->local_session->zoom_sample -
mwindow->edl->local_session->view_start[pane->number]);
- if(MWindowGUI::visible(x, x + 1, 0, get_w()))
+ if(MWindowGUI::visible(x2, x2 + 1, 0, get_w()))
{
set_color(RED);
- draw_line(x, 0, x, get_h());
+ draw_line(x2, 0, x2, get_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;
// Loop points
draw_loop_points();
- draw_brender_start();
+ draw_brender_range();
// Highlighted areas
draw_highlighting();
default:
- if( !mwindow->session->current_operation ) {
- if( get_buttonpress() == 3 )
- result = do_edit_popup();
- }
- else {
+ if(mwindow->session->current_operation) {
// if(mwindow->session->current_operation == SELECT_REGION) {
// mwindow->undo->update_undo_after(_("select"), LOAD_SESSION, 0, 0);
// }
int TrackCanvas::do_tracks(int cursor_x, int cursor_y, int button_press)
-{
- return 0;
-}
-
-int TrackCanvas::do_edit_popup()
{
int result = 0;
- int cursor_y = get_cursor_y();
+
// if(!mwindow->edl->session->show_assets) return 0;
for(Track *track = mwindow->edl->tracks->first;
int64_t track_x, track_y, track_w, track_h;
track_dimensions(track, track_x, track_y, track_w, track_h);
- if( cursor_y >= track_y && cursor_y < track_y + track_h ) {
+ if(button_press && get_buttonpress() == 3 &&
+ cursor_y >= track_y && cursor_y < track_y + track_h) {
gui->edit_menu->update(track, 0);
gui->edit_menu->activate_menu();
result = 1;