cursor_x < get_w() && cursor_y < get_h() )
{
//printf("TrackCanvas::drag_motion %d %d\n", __LINE__, pane->number);
cursor_x < get_w() && cursor_y < get_h() )
{
//printf("TrackCanvas::drag_motion %d %d\n", __LINE__, pane->number);
// will be deleted by Edits::optimize if not used
double length = mwindow->edl->session->default_transition_length;
int64_t start = edit->startproject+edit->length;
// will be deleted by Edits::optimize if not used
double length = mwindow->edl->session->default_transition_length;
int64_t start = edit->startproject+edit->length;
if(mwindow->session->current_operation == DRAG_ASSET &&
mwindow->session->drag_assets->total) {
Indexable *indexable = mwindow->session->drag_assets->values[0];
if(mwindow->session->current_operation == DRAG_ASSET &&
mwindow->session->drag_assets->total) {
Indexable *indexable = mwindow->session->drag_assets->values[0];
asset_length_units = mwindow->session->track_highlighted->to_units(asset_duration, 1);
position = drop_edit_position (&insertion, NULL, asset_length_units);
if( position == -1 ) {
result = 1;
break; // Do not do anything
}
asset_length_units = mwindow->session->track_highlighted->to_units(asset_duration, 1);
position = drop_edit_position (&insertion, NULL, asset_length_units);
if( position == -1 ) {
result = 1;
break; // Do not do anything
}
double position_f = mwindow->session->track_highlighted->from_units(position);
Track *track = mwindow->session->track_highlighted;
double position_f = mwindow->session->track_highlighted->from_units(position);
Track *track = mwindow->session->track_highlighted;
// // FIXME, we should create an mwindow/EDL method that overwrites, without clearing the keyframes and autos
// // Unfortunately, this is _a lot_ of work to do right
// printf("Problematic insertion\n");
// // FIXME, we should create an mwindow/EDL method that overwrites, without clearing the keyframes and autos
// // Unfortunately, this is _a lot_ of work to do right
// printf("Problematic insertion\n");
// position_f + asset_duration, 0);
// }
mwindow->paste_assets(position_f, track, !insertion);
// position_f + asset_duration, 0);
// }
mwindow->paste_assets(position_f, track, !insertion);
double position_f = mwindow->session->track_highlighted->from_units(position);
Track *track = mwindow->session->track_highlighted;
mwindow->move_edits(mwindow->session->drag_edits,
double position_f = mwindow->session->track_highlighted->from_units(position);
Track *track = mwindow->session->track_highlighted;
mwindow->move_edits(mwindow->session->drag_edits,
{
int64_t x1 = Units::round(mwindow->edl->session->brender_start *
mwindow->edl->session->sample_rate /
{
int64_t x1 = Units::round(mwindow->edl->session->brender_start *
mwindow->edl->session->sample_rate /
mwindow->edl->local_session->view_start[pane->number]);
if(MWindowGUI::visible(x1, x1 + 1, 0, get_w()))
{
mwindow->edl->local_session->view_start[pane->number]);
if(MWindowGUI::visible(x1, x1 + 1, 0, get_w()))
{
mwindow->edl->local_session->view_start[pane->number]);
if(MWindowGUI::visible(x2, x2 + 1, 0, get_w()))
mwindow->edl->local_session->view_start[pane->number]);
if(MWindowGUI::visible(x2, x2 + 1, 0, get_w()))
int grouptype = automation.autogrouptype(i, track);
if(draw) // Do dropshadow
result = do_float_autos(track, autos,
int grouptype = automation.autogrouptype(i, track);
if(draw) // Do dropshadow
result = do_float_autos(track, autos,
- cursor_x, cursor_y, draw,
+ cursor_x, cursor_y, draw,
buttonpress, 1, 1, MDGREY,
auto_keyframe, grouptype);
buttonpress, 1, 1, MDGREY,
auto_keyframe, grouptype);
case Autos::AUTOMATION_TYPE_INT: {
if(draw) // Do dropshadow
result = do_int_autos(track, autos,
case Autos::AUTOMATION_TYPE_INT: {
if(draw) // Do dropshadow
result = do_int_autos(track, autos,
- cursor_x, cursor_y, draw,
+ cursor_x, cursor_y, draw,
buttonpress, 1, 1, MDGREY,
auto_keyframe);
result = do_int_autos(track, autos,
buttonpress, 1, 1, MDGREY,
auto_keyframe);
result = do_int_autos(track, autos,
draw_box(x1, y1, x2 - x1, y2 - y1);
}
draw_box(x1, y1, x2 - x1, y2 - y1);
}
// floatauto doesn't adjust it's tangents automatically
if(current->curve_mode != FloatAuto::FREE &&
current->curve_mode != FloatAuto::TFREE)
// floatauto doesn't adjust it's tangents automatically
if(current->curve_mode != FloatAuto::FREE &&
current->curve_mode != FloatAuto::TFREE)
// drawing the tangent as a dashed line...
int const dash = HANDLE_W;
int const gap = HANDLE_W / 2;
float sx = 3 * (cp_x - x) / 4.;
float ex = 0;
// drawing the tangent as a dashed line...
int const dash = HANDLE_W;
int const gap = HANDLE_W / 2;
float sx = 3 * (cp_x - x) / 4.;
float ex = 0;
// q is the x displacement for a unit line of slope
float q = (sx > 0 ? 1 : -1) / sqrt(1 + slope * slope);
// q is the x displacement for a unit line of slope
float q = (sx > 0 ? 1 : -1) / sqrt(1 + slope * slope);
float sy = slope * sx, ey = slope * ex;
draw_line(quantize(sx + x), quantize(sy + y), quantize(ex + x), quantize(ey + y));
sx = ex - q * gap;
float sy = slope * sx, ey = slope * ex;
draw_line(quantize(sx + x), quantize(sy + y), quantize(ex + x), quantize(ey + y));
sx = ex - q * gap;
int TrackCanvas::test_floatauto(FloatAuto *current, int x, int y, int in_x,
int TrackCanvas::test_floatauto(FloatAuto *current, int x, int y, int in_x,
- int in_y, int out_x, int out_y, int center_pixel, int zoom_track,
+ int in_y, int out_x, int out_y, int center_pixel, int zoom_track,
int cursor_x, int cursor_y, int buttonpress, int autogrouptype)
{
int result = 0;
int cursor_x, int cursor_y, int buttonpress, int autogrouptype)
{
int result = 0;
if(buttonpress && (buttonpress != 3))
{
INIT_DRAG(current->position, value_to_percentage(current->get_value(), autogrouptype))
if(buttonpress && (buttonpress != 3))
{
INIT_DRAG(current->position, value_to_percentage(current->get_value(), autogrouptype))
// could be ctrl-click or ctrl-drag
// click would cycle through tangent modes
((FloatAuto*)current)->toggle_curve_mode();
// could be ctrl-click or ctrl-drag
// click would cycle through tangent modes
((FloatAuto*)current)->toggle_curve_mode();
// drag will start dragging the tangent, if applicable
INIT_DRAG(current->position, value_to_percentage(current->get_value(), autogrouptype))
mwindow->session->drag_handle = 0;
}
}
// drag will start dragging the tangent, if applicable
INIT_DRAG(current->position, value_to_percentage(current->get_value(), autogrouptype))
mwindow->session->drag_handle = 0;
}
}
(int)ax, (int)ax2, cursor_x, cursor_y,
buttonpress, autogrouptype);
}
(int)ax, (int)ax2, cursor_x, cursor_y,
buttonpress, autogrouptype);
}
draw_floatline(center_pixel,
(FloatAuto*)previous, (FloatAuto*)current,
(FloatAutos*)autos, unit_start, zoom_units, yscale,
draw_floatline(center_pixel,
(FloatAuto*)previous, (FloatAuto*)current,
(FloatAutos*)autos, unit_start, zoom_units, yscale,
// not really editing the node, rather start editing the curve
// tangent is editable and drag movement is significant
if( (FloatAuto::FREE == current->curve_mode ||
// not really editing the node, rather start editing the curve
// tangent is editable and drag movement is significant
if( (FloatAuto::FREE == current->curve_mode ||
current->adjust_to_new_coordinates(position, value);
synchronize_autos(change, current->autos->track, current, 0);
show_message(current, 1,", %.2f", current->get_value());
current->adjust_to_new_coordinates(position, value);
synchronize_autos(change, current->autos->track, current, 0);
show_message(current, 1,", %.2f", current->get_value());
double position_f = current->autos->track->from_units(current->position);
double center_f = (mwindow->edl->local_session->get_selectionstart(1) +
double position_f = current->autos->track->from_units(current->position);
double center_f = (mwindow->edl->local_session->get_selectionstart(1) +
double position_f = current->autos->track->from_units(current->position);
double center_f = (mwindow->edl->local_session->get_selectionstart(1) +
double position_f = current->autos->track->from_units(current->position);
double center_f = (mwindow->edl->local_session->get_selectionstart(1) +
current->autos->track->from_units(current->position),
mwindow->edl->session->time_format,
mwindow->edl->session->sample_rate,
current->autos->track->from_units(current->position),
mwindow->edl->session->time_format,
mwindow->edl->session->sample_rate,