X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Fcinelerra%2Ftrackcanvas.C;h=52eab8b9e410068235ed347052389d289887e575;hb=dcdf2f77cc47ca7c543f27ddb03c4814015d974b;hp=bc34475653aef2daed0a3e791f1fdd2df24097d6;hpb=b4184445f396e16260ed90e645a280149aeda8c0;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index bc344756..52eab8b9 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -2170,6 +2170,7 @@ int TrackCanvas::do_keyframes(int cursor_x, pankeyframe_pixmap, modekeyframe_pixmap, maskkeyframe_pixmap, + 0, }; @@ -2227,10 +2228,9 @@ int TrackCanvas::do_keyframes(int cursor_x, 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; } @@ -2337,7 +2337,6 @@ int TrackCanvas::do_keyframes(int cursor_x, new_cursor = UPRIGHT_ARROW_CURSOR; } - return result; } @@ -2470,12 +2469,23 @@ void TrackCanvas::draw_floatauto(FloatAuto *current, 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 polygon_x; + ArrayList 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 @@ -4035,7 +4045,8 @@ int TrackCanvas::update_drag_floatauto(int cursor_x, int cursor_y) 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; @@ -4054,7 +4065,8 @@ int TrackCanvas::update_drag_floatauto(int cursor_x, int cursor_y) 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; } @@ -4068,7 +4080,8 @@ int TrackCanvas::update_drag_floatauto(int cursor_x, int cursor_y) 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; } } @@ -4088,7 +4101,7 @@ int TrackCanvas::update_drag_toggleauto(int cursor_x, int cursor_y) result = 1; current->value = value; current->position = position; - show_message(current, 0,", %d", current->value); + show_message(current, -1, ", %d", current->value); } return result; @@ -4105,7 +4118,7 @@ int TrackCanvas::update_drag_auto(int cursor_x, int cursor_y) { 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) + @@ -4169,7 +4182,7 @@ int TrackCanvas::update_drag_pluginauto(int cursor_x, int cursor_y) 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) + @@ -4680,6 +4693,9 @@ int TrackCanvas::button_release_event() } } + if( mwindow->edl->local_session->zoombar_showautocolor >= 0 ) + mwindow->gui->zoombar->update_autozoom(-1); + if (result) cursor_update(0); @@ -5021,11 +5037,8 @@ int TrackCanvas::do_edits(int cursor_x, int cursor_y, int button_press, int drag 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; @@ -5275,7 +5288,7 @@ int TrackCanvas::button_press_event() 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()) @@ -5318,6 +5331,7 @@ int TrackCanvas::button_press_event() 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, @@ -5353,6 +5367,7 @@ int TrackCanvas::button_press_event() 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; @@ -5383,9 +5398,12 @@ int TrackCanvas::button_press_event() 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(); @@ -5462,11 +5480,11 @@ double TrackCanvas::time_visible() } -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)); } @@ -5482,7 +5500,7 @@ void TrackCanvas::show_message(Auto *current, int show_curve_type, const char *f 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()