projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add gif ffmpeg format, changes for drag auto color boxes
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
cinelerra
/
trackcanvas.C
diff --git
a/cinelerra-5.1/cinelerra/trackcanvas.C
b/cinelerra-5.1/cinelerra/trackcanvas.C
index 638e04341397691512d9f596617e2208723263ee..6e6eb3b2727a35b78dd3525fb7385e3874cd863b 100644
(file)
--- a/
cinelerra-5.1/cinelerra/trackcanvas.C
+++ b/
cinelerra-5.1/cinelerra/trackcanvas.C
@@
-2227,10
+2227,9
@@
int TrackCanvas::do_keyframes(int cursor_x,
if( !result && buttonpress && i == AUTOMATION_SPEED )
mwindow->speed_after(-1);
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; }
}
break; }
@@
-2337,7
+2336,6
@@
int TrackCanvas::do_keyframes(int cursor_x,
new_cursor = UPRIGHT_ARROW_CURSOR;
}
new_cursor = UPRIGHT_ARROW_CURSOR;
}
-
return result;
}
return result;
}
@@
-3808,22
+3806,37
@@
void TrackCanvas::update_drag_handle()
edl->create_objects();
edl->copy_all(mwindow->edl);
MainSession *session = mwindow->session;
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,
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,
edl->session->labels_follow_edits,
edl->session->plugins_follow_edits,
edl->session->autos_follow_edits,
- session->drag_edit->group_id);
- double position = edit_mode != MOVE_NO_EDITS &&
- ( session->drag_handle || edit_mode == MOVE_ONE_EDIT ) ?
+ !session->drag_edit ? 0 : session->drag_edit->group_id);
+
+ 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;
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);
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();
}
}
edl->remove_user();
}
}
@@
-3847,8
+3860,6
@@
int TrackCanvas::render_handle_frame(EDL *edl, int64_t pos, int mode)
CICache *video_cache = new CICache(preferences);
render_engine->set_vcache(video_cache);
render_engine->arm_command(&command);
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) &&
VRender *vrender = render_engine->vrender;
result = vrender &&
!vrender->process_buffer(&vlt, left, 0) &&
@@
-3874,11
+3885,11
@@
int TrackCanvas::render_handle_frame(EDL *edl, int64_t pos, int mode)
Track *track = mwindow->session->drag_handle_track();
double position = track->from_units(mode == 1 ? left : pos);
if( position < 0 ) position = 0;
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);
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; }
}
mwindow->cwindow->playback_engine->refresh_frame(CHANGE_EDL, edl, 0);
break; }
}
@@
-3983,7
+3994,7
@@
int TrackCanvas::update_drag_floatauto(int cursor_x, int cursor_y)
// Snap to nearby values
old_value = current->get_value();
if(shift_down()) {
// 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;
if(current->previous) {
int autogrouptype = current->previous->autos->autogrouptype;
@@
-4022,7
+4033,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);
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;
}
break;
@@
-4041,7
+4053,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);
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; }
}
break; }
@@
-4055,7
+4068,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);
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; }
}
}
break; }
}
@@
-4075,7
+4089,7
@@
int TrackCanvas::update_drag_toggleauto(int cursor_x, int cursor_y)
result = 1;
current->value = value;
current->position = position;
result = 1;
current->value = value;
current->position = position;
- show_message(current,
0,
", %d", current->value);
+ show_message(current,
-1,
", %d", current->value);
}
return result;
}
return result;
@@
-4092,7
+4106,7
@@
int TrackCanvas::update_drag_auto(int cursor_x, int cursor_y)
{
result = 1;
current->position = position;
{
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) +
double position_f = current->autos->track->from_units(current->position);
double center_f = (mwindow->edl->local_session->get_selectionstart(1) +
@@
-4156,7
+4170,7
@@
int TrackCanvas::update_drag_pluginauto(int cursor_x, int cursor_y)
mwindow->session->track_highlighted = track;
result = 1;
current->position = position;
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) +
double position_f = current->autos->track->from_units(current->position);
double center_f = (mwindow->edl->local_session->get_selectionstart(1) +
@@
-4667,6
+4681,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);
if (result)
cursor_update(0);
@@
-5262,7
+5279,7
@@
int TrackCanvas::button_press_event()
gui->stop_transport("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())
if(get_buttonpress() == WHEEL_UP) {
if(shift_down())
@@
-5305,6
+5322,7
@@
int TrackCanvas::button_press_event()
if( do_keyframes(cursor_x, cursor_y,
0, get_buttonpress(), new_cursor,
update_cursor, rerender) ) break;
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,
// Test edit boundaries
if( do_edit_handles(cursor_x, cursor_y,
1, rerender, update_overlay, new_cursor,
@@
-5340,6
+5358,7
@@
int TrackCanvas::button_press_event()
update_overlay = 1;
break;
}
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;
// Test edit boundaries
if( do_edit_handles(cursor_x, cursor_y,
1, rerender, update_overlay, new_cursor, update_cursor) ) break;
@@
-5370,9
+5389,12
@@
int TrackCanvas::button_press_event()
gui->update_patchbay();
}
gui->update_patchbay();
}
- if( update_overlay ) {
+ if( update_message )
+ gui->default_message();
+
+ if( update_overlay )
gui->draw_overlays(1);
gui->draw_overlays(1);
- }
+
if( update_cursor < 0 ) {
// double_click edit
gui->swindow->update_selection();
if( update_cursor < 0 ) {
// double_click edit
gui->swindow->update_selection();
@@
-5449,11
+5471,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
color
, const char *fmt, ...)
{
char string[BCTEXTLEN];
char *cp = string, *ep = cp + sizeof(string)-1;
{
char string[BCTEXTLEN];
char *cp = string, *ep = cp + sizeof(string)-1;
- if(
show_curve_type
) {
+ if(
color >= 0
) {
cp += snprintf(string, ep-cp, "%-8s ",
FloatAuto::curve_name(((FloatAuto*)current)->curve_mode));
}
cp += snprintf(string, ep-cp, "%-8s ",
FloatAuto::curve_name(((FloatAuto*)current)->curve_mode));
}
@@
-5469,7
+5491,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);
va_start(ap, fmt);
vsnprintf(cp, ep-cp, fmt, ap);
va_end(ap);
- gui->show_message(string);
+ gui->show_message(string
, color
);
}
// Patchbay* TrackCanvas::get_patchbay()
}
// Patchbay* TrackCanvas::get_patchbay()