}
}
+ int64_t track_x, track_y, track_w, track_h;
+ track_dimensions(current,
+ track_x, track_y, track_w, track_h);
+ set_color((~get_resources()->get_bg_color()) & 0xffffff);
+ set_opaque();
+ int x1 = track_x, x2 = x1+track_w;
+ int y1 = track_y+track_h-1;
+ draw_line(x1,y1, x2,y1, background_pixmap);
}
if (x + w <= 0)
{
- draw_triangle_left(0, y + h /6, h * 2/3, h * 2/3, BLACK, GREEN, YELLOW, RED, BLUE);
+ draw_triangle_left(0, y + h /6,
+ h * 2/3, h * 2/3, BLACK, GREEN, YELLOW, RED, BLUE);
return;
} else
if (x >= get_w())
{
- draw_triangle_right(get_w() - h * 2/3, y + h /6, h * 2/3, h * 2/3, BLACK, GREEN, YELLOW, RED, BLUE);
+ draw_triangle_right(get_w() - h * 2/3, y + h /6,
+ h * 2/3, h * 2/3, BLACK, GREEN, YELLOW, RED, BLUE);
return;
}
// Fix bug in heroines & cvs version as of 22.8.2005:
// If we grab when zoomed in and zoom out while dragging, when edit gets really narrow strange things start happening
if (w >= 0 && w < 3) {x -= w /2; w = 3;};
- if(x < -10)
- {
- w += x - -10;
- x = -10;
- }
-
- if(y < -10)
- {
- h += y - -10;
- y = -10;
- }
+ if(x < -10) { w += x - -10; x = -10; }
+ if(y < -10) { h += y - -10; y = -10; }
w = MIN(w, get_w() + 20);
h = MIN(h, get_h() + 20);
// Fix bug in heroines & cvs version as of 22.8.2005:
// If we grab when zoomed in and zoom out while dragging, when edit gets really narrow strange things start happening
if (w >= 0 && w < 3) {x -= w /2; w = 3;};
- if(x < -10)
- {
- w += x - -10;
- x = -10;
- }
- if(y < -10)
- {
- h += y - -10;
- y = -10;
- }
+ if(x < -10) { w += x - -10; x = -10; }
+ if(y < -10) { h += y - -10; y = -10; }
w = MIN(w, get_w() + 20);
h = MIN(h, get_h() + 20);
set_color(mwindow->preferences->highlight_inverse);
void TrackCanvas::get_transition_coords(Edit *edit,
int64_t &x, int64_t &y, int64_t &w, int64_t &h)
{
- int transition_w = 30, transition_h = 30;
+ int transition_w = xS(30), transition_h = yS(30);
int has_titles = edit->track->show_titles();
int has_assets = edit->track->show_assets();
double title_bg_h = mwindow->theme->get_image("title_bg_data")->get_h();
toggle_x = MIN(get_w() - right_margin, toggle_x);
// On toggle
- toggle_x -= PluginOn::calculate_w(mwindow) + 10;
+ toggle_x -= PluginOn::calculate_w(mwindow) + xS(10);
if(toggle_x > min_x)
{
if(current_on >= plugin_on_toggles.total)
if(plugin->plugin_type == PLUGIN_STANDALONE)
{
// Show
- toggle_x -= PluginShow::calculate_w(mwindow) + 10;
+ toggle_x -= PluginShow::calculate_w(mwindow) + xS(10);
if(toggle_x > min_x)
{
if(current_show >= plugin_show_toggles.total)
}
current_show++;
}
- toggle_x -= PluginPresetEdit::calculate_w(mwindow) + 10;
+ toggle_x -= PluginPresetEdit::calculate_w(mwindow) + xS(10);
if(toggle_x > min_x)
{
if(current_preset >= preset_edit_buttons.total)
void TrackCanvas::draw_hard_edges()
{
+ if( !mwindow->edl->session->auto_conf->hard_edges )
+ return;
int64_t x, y, w, h;
for(Track *track = mwindow->edl->tracks->first; track; track = track->next) {
edit_dimensions(edit, x, y, w, h);
if( y+h < 0 || y >= get_h() ) continue;
int edge_x = !drag_handle ? x : x + w;
- int edge_y = y + h/2, k = 10;
+ int edge_y = y + h/2, xs10 = xS(10), ys10 = yS(10);
if( edge_x >= 0 && edge_x < get_w() ) {
if( !can_drag ) {
- draw_line(edge_x-k,edge_y-k, edge_x+k,edge_y+k);
- draw_line(edge_x-k,edge_y+k, edge_x+k,edge_y-k);
+ draw_line(edge_x-xs10,edge_y-ys10, edge_x+xs10,edge_y+ys10);
+ draw_line(edge_x-xs10,edge_y+ys10, edge_x+xs10,edge_y-ys10);
}
else if( !drag_handle ) {
- draw_line(edge_x+k,edge_y-k, edge_x,edge_y);
- draw_line(edge_x+k,edge_y+k, edge_x,edge_y);
+ draw_line(edge_x+xs10,edge_y-ys10, edge_x,edge_y);
+ draw_line(edge_x+xs10,edge_y+ys10, edge_x,edge_y);
}
else {
- draw_line(edge_x,edge_y, edge_x-k,edge_y-k);
- draw_line(edge_x,edge_y, edge_x-k,edge_y+k);
+ draw_line(edge_x,edge_y, edge_x-xs10,edge_y-ys10);
+ draw_line(edge_x,edge_y, edge_x-xs10,edge_y+ys10);
}
}
edge_x += delta;
pankeyframe_pixmap,
modekeyframe_pixmap,
maskkeyframe_pixmap,
+ 0,
};
if( !result && buttonpress && i == AUTOMATION_SPEED )
mwindow->speed_after(-1);
- int current_grouptype = mwindow->edl->local_session->zoombar_showautotype;
- if( result && buttonpress && grouptype != current_grouptype ) {
- mwindow->edl->local_session->zoombar_showautotype = grouptype;
- mwindow->gui->zoombar->update_autozoom();
+ if( result && buttonpress ) {
+ int color = GWindowGUI::auto_colors[i];
+ mwindow->gui->zoombar->update_autozoom(grouptype, color);
}
break; }
new_cursor = UPRIGHT_ARROW_CURSOR;
}
-
return result;
}
CLAMP(y1, ymin, ymax);
CLAMP(y2, ymin, ymax);
- if(y2 - 1 > y1)
- {
- set_color(BLACK);
- draw_box(x1 + 1, y1 + 1, x2 - x1, y2 - y1);
- set_color(color);
- draw_box(x1, y1, x2 - x1, y2 - y1);
+ if( y2-1 > y1 ) {
+ if( current->curve_mode == FloatAuto::LINEAR ) {
+ draw_box(x1, y1, x2 - x1, y2 - y1);
+ }
+ else {
+ ArrayList<int> polygon_x;
+ ArrayList<int> polygon_y;
+ polygon_x.append((x1 + x2) / 2 + 1);
+ polygon_y.append(y1 + 1);
+ polygon_x.append(x2 + 1);
+ polygon_y.append((y1 + y2) / 2 + 1);
+ polygon_x.append((x1 + x2) / 2 + 1);
+ polygon_y.append(y2 + 1);
+ polygon_x.append(x1 + 1);
+ polygon_y.append((y1 + y2) / 2 + 1);
+ fill_polygon(&polygon_x, &polygon_y);
+ }
}
// show bezier control points (only) if this
set_color(color);
draw_line(ax, 0, ax, get_h());
+ char text[BCSTRLEN];
if( show ) {
- char text[BCSTRLEN];
if( auto_keyframe->is_floatauto() ) {
FloatAuto *float_auto = (FloatAuto *)auto_keyframe;
sprintf(text, "%0.2f", float_auto->get_value());
}
- else {
+ else if( auto_keyframe->is_intauto() ) {
IntAuto *int_auto = (IntAuto *)auto_keyframe;
sprintf(text, "%d", int_auto->value);
}
+ else
+ show = 0;
+ }
+ if( show ) {
int font = MEDIUMFONT;
- int tw = get_text_width(font, text) + TOOLTIP_MARGIN * 2;
- int th = get_text_height(font, text) + TOOLTIP_MARGIN * 2;
+ int tw = get_text_width(font, text) + xS(TOOLTIP_MARGIN) * 2;
+ int th = get_text_height(font, text) + yS(TOOLTIP_MARGIN) * 2;
set_color(get_resources()->tooltip_bg_color);
ax += HANDLE_W/2;
ay += center_pixel + HANDLE_W/2;
set_color(BLACK);
draw_rectangle(ax, ay, tw, th);
set_font(font);
- ax += TOOLTIP_MARGIN;
- ay += TOOLTIP_MARGIN + get_text_ascent(font);
+ ax += xS(TOOLTIP_MARGIN);
+ ay += yS(TOOLTIP_MARGIN) + get_text_ascent(font);
draw_text(ax, ay, text);
}
return 0;
int new_cursor, update_cursor, rerender;
// Move background pixmap to foreground pixmap
- draw_pixmap(background_pixmap,
- 0,
- 0,
- get_w(),
- get_h(),
- 0,
- 0);
+ draw_pixmap(background_pixmap, 0, 0, get_w(), get_h(), 0, 0);
// In/Out points
draw_inout_points();
edl->create_objects();
edl->copy_all(mwindow->edl);
MainSession *session = mwindow->session;
- int edit_mode = mwindow->edl->session->edit_handle_mode[session->drag_button];
+ int handle_mode = mwindow->edl->session->edit_handle_mode[session->drag_button];
edl->modify_edithandles(session->drag_start,
- session->drag_position,
- session->drag_handle,
- edit_mode,
+ session->drag_position, session->drag_handle, handle_mode,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits,
!session->drag_edit ? 0 : session->drag_edit->group_id);
- double position = edit_mode == MOVE_EDGE || edit_mode == MOVE_EDGE_MEDIA ?
- session->drag_position : session->drag_start ;
+
+ double position = -1;
+ int show_edge = !session->drag_handle ? 1 : 2;
+ switch( handle_mode ) {
+ case MOVE_RIPPLE:
+ case MOVE_EDGE:
+ position = session->drag_handle ?
+ session->drag_position : session->drag_start;
+ show_edge = 3 - show_edge;
+ break;
+ case MOVE_ROLL:
+ case MOVE_SLIDE:
+ position = session->drag_position;
+ break;
+ case MOVE_SLIP:
+ position = session->drag_start;
+ show_edge = 3 - show_edge;
+ break;
+ }
+
+ if( position < 0 ) position = 0;
Track *track = session->drag_handle_track();
int64_t pos = track->to_units(position, 0);
- render_handle_frame(edl, pos, shift_down() ? 0 :
- session->drag_handle ? 1 : 2);
+ render_handle_frame(edl, pos, shift_down() ? 0 : show_edge);
edl->remove_user();
}
}
CICache *video_cache = new CICache(preferences);
render_engine->set_vcache(video_cache);
render_engine->arm_command(&command);
- int64_t left = pos-1;
- if( left < 0 ) left = 0;
VRender *vrender = render_engine->vrender;
result = vrender &&
!vrender->process_buffer(&vlt, left, 0) &&
delete video_cache;
mwindow->cwindow->gui->lock_window("TrackCanvas::render_handle_frame 0");
Canvas *canvas = mwindow->cwindow->gui->canvas;
- canvas->lock_canvas("TrackCanvas::render_handle_frame 1");
int w = canvas->w, h = canvas->h, w2 = w/2, h2 = h/2;
int lx = 0, ly = h2/2, rx = w2, ry = h2/2;
BC_WindowBase *window = canvas->get_canvas();
window->draw_vframe(&vlt, lx,ly, w2,h2, 0,0,vlt.get_w(),vlt.get_h());
window->draw_vframe(&vrt, rx,ry, w2,h2, 0,0,vrt.get_w(),vrt.get_h());
window->flash(1);
- canvas->unlock_canvas();
mwindow->cwindow->gui->unlock_window();
break; }
case 1:
Track *track = mwindow->session->drag_handle_track();
double position = track->from_units(mode == 1 ? left : pos);
if( position < 0 ) position = 0;
- edl->local_session->set_selectionstart(position);
- edl->local_session->set_selectionend(position);
PlaybackEngine *playback_engine = mwindow->cwindow->playback_engine;
if( playback_engine->is_playing_back )
playback_engine->stop_playback(1);
+ edl->local_session->set_selectionstart(position);
+ edl->local_session->set_selectionend(position);
mwindow->cwindow->playback_engine->refresh_frame(CHANGE_EDL, edl, 0);
break; }
}
// Snap to nearby values
old_value = current->get_value();
if(shift_down()) {
- double value1, value2, distance1, distance2;
+ double value1, value2, distance1=-1, distance2=-1;
if(current->previous) {
int autogrouptype = current->previous->autos->autogrouptype;
float change = value - old_value;
current->adjust_to_new_coordinates(position, value);
update_ganged_autos(change, current->autos->track, current);
- show_message(current, 1,", %.2f", current->get_value());
+ int color = GWindowGUI::auto_colors[current->autos->autoidx];
+ show_message(current, color, ", %.2f", current->get_value());
}
break;
value * levered_position(position - current->position,
current->get_control_in_position()));
update_ganged_autos(0, current->autos->track, current);
- show_message(current, 1,", %.2f", current->get_control_in_value());
+ int color = GWindowGUI::auto_colors[current->autos->autoidx];
+ show_message(current, color, ", %.2f", current->get_control_in_value());
}
break; }
value * levered_position(position - current->position,
current->get_control_out_position()));
update_ganged_autos(0, current->autos->track, current);
- show_message(current, 1,", %.2f", current->get_control_out_value());
+ int color = GWindowGUI::auto_colors[current->autos->autoidx];
+ show_message(current, color, ", %.2f", current->get_control_out_value());
}
break; }
}
result = 1;
current->value = value;
current->position = position;
- show_message(current, 0,", %d", current->value);
+ show_message(current, -1, ", %d", current->value);
}
return result;
{
result = 1;
current->position = position;
- show_message(current, 0,"");
+ show_message(current, -1, "");
double position_f = current->autos->track->from_units(current->position);
double center_f = (mwindow->edl->local_session->get_selectionstart(1) +
mwindow->session->track_highlighted = track;
result = 1;
current->position = position;
- show_message(current, 0,"");
+ show_message(current, -1, "");
double position_f = current->autos->track->from_units(current->position);
double center_f = (mwindow->edl->local_session->get_selectionstart(1) +
}
}
+ if( mwindow->edl->local_session->zoombar_showautocolor >= 0 )
+ mwindow->gui->zoombar->update_autozoom(-1);
+
if (result)
cursor_update(0);
update_overlay = 1;
}
}
- else if( result < 0 ) {
+ else if( result < 0 && !edit_result->silence() ) {
mwindow->undo->update_undo_before();
if( !shift_down() ) {
if( handle_result == 0 )
mwindow->session->drag_group->remove_user();
double start_position = 0;
mwindow->session->drag_group =
- mwindow->selected_edits_to_clip(0, &start_position,
- &mwindow->session->drag_group_first_track,
- mwindow->edl->session->labels_follow_edits,
- mwindow->edl->session->autos_follow_edits,
- mwindow->edl->session->plugins_follow_edits);
+ mwindow->edl->selected_edits_to_clip(0, &start_position,
+ &mwindow->session->drag_group_first_track);
if( mwindow->session->drag_group ) {
mwindow->session->current_operation = DRAG_GROUP;
mwindow->session->drag_group_position = start_position;
gui->stop_transport("TrackCanvas::button_press_event");
}
- int update_overlay = 0, update_cursor = 0, rerender = 0;
+ int update_overlay = 0, update_cursor = 0, rerender = 0, update_message = 0;
if(get_buttonpress() == WHEEL_UP) {
if(shift_down())
if( do_keyframes(cursor_x, cursor_y,
0, get_buttonpress(), new_cursor,
update_cursor, rerender) ) break;
+ update_message = 1;
// Test edit boundaries
if( do_edit_handles(cursor_x, cursor_y,
1, rerender, update_overlay, new_cursor,
update_overlay = 1;
break;
}
+ update_message = 1;
// Test edit boundaries
if( do_edit_handles(cursor_x, cursor_y,
1, rerender, update_overlay, new_cursor, update_cursor) ) break;
gui->update_patchbay();
}
- if( update_overlay ) {
+ if( update_message )
+ gui->default_message();
+
+ if( update_overlay )
gui->draw_overlays(1);
- }
+
if( update_cursor < 0 ) {
// double_click edit
gui->swindow->update_selection();
}
-void TrackCanvas::show_message(Auto *current, int show_curve_type, const char *fmt, ...)
+void TrackCanvas::show_message(Auto *current, int box_color, const char *fmt, ...)
{
char string[BCTEXTLEN];
char *cp = string, *ep = cp + sizeof(string)-1;
- if( show_curve_type ) {
+ if( box_color >= 0 ) {
cp += snprintf(string, ep-cp, "%-8s ",
FloatAuto::curve_name(((FloatAuto*)current)->curve_mode));
}
va_start(ap, fmt);
vsnprintf(cp, ep-cp, fmt, ap);
va_end(ap);
- gui->show_message(string);
+ gui->show_message(string, -1, box_color);
}
// Patchbay* TrackCanvas::get_patchbay()