gui->run_window();
}
-void CWindow::update(int position,
- int overlays,
- int tool_window,
- int operation,
- int timebar)
+void CWindow::update(int dir, int overlays, int tool_window, int operation, int timebar)
{
- if(position)
- {
- refresh_frame(CHANGE_NONE);
- }
+ if(dir)
+ refresh_frame(CHANGE_NONE, dir);
gui->lock_window("CWindow::update 2");
-
-
// Create tool window
if(operation)
- {
gui->set_operation(mwindow->edl->session->cwindow_operation);
- }
-
// Updated by video device.
- if(overlays && !position)
- {
+ if(overlays && !dir)
gui->canvas->draw_refresh();
- }
// Update tool parameters
// Never updated by someone else
- if(tool_window || position)
- {
+ if(tool_window || dir)
gui->update_tool();
- }
if(timebar)
- {
gui->timebar->update(1);
- }
double zoom = !mwindow->edl->session->cwindow_scrollbars ?
0 :mwindow->edl->session->cwindow_zoom;
return 1;
}
-void CWindow::refresh_frame(int change_type, EDL *edl)
+void CWindow::refresh_frame(int change_type, EDL *edl, int dir)
{
- mwindow->refresh_mixers();
- playback_engine->refresh_frame(change_type, edl);
+ mwindow->refresh_mixers(dir);
+ playback_engine->refresh_frame(change_type, edl, dir);
}
-void CWindow::refresh_frame(int change_type)
+void CWindow::refresh_frame(int change_type, int dir)
{
- refresh_frame(change_type, mwindow->edl);
+ refresh_frame(change_type, mwindow->edl, dir);
}
CWindowRemoteHandler::
void create_objects();
// Position is inclusive of the other 2
- void update(int position,
+ void update(int dir,
int overlays,
int tool_window,
int operation = 0,
void hide_window();
int update_position(double position);
void stop_playback(int wait);
- void refresh_frame(int change_type);
- void refresh_frame(int change_type, EDL *edl);
+ void refresh_frame(int change_type, int dir=1);
+ void refresh_frame(int change_type, EDL *edl, int dir=1);
int destination;
MWindow *mwindow;
zwindows_lock->unlock();
}
-void MWindow::refresh_mixers()
+void MWindow::refresh_mixers(int dir)
{
- queue_mixers(edl,CURRENT_FRAME,0,0,1,0,0);
+ int command = dir >= 0 ? CURRENT_FRAME : LAST_FRAME;
+ queue_mixers(edl,command,0,0,1,0,0);
}
void MWindow::stop_mixers()
void queue_mixers(EDL *edl, int command, int wait_tracking,
int use_inout, int update_refresh, int toggle_audio, int loop_play);
void create_mixers();
- void refresh_mixers();
+ void refresh_mixers(int dir=1);
void stop_mixers();
void close_mixers();
void open_mixers();
break;
case CURRENT_FRAME:
+ case LAST_FRAME:
last_command = command->command;
perform_change();
arm_render_engine();
case SLOW_FWD:
case NORMAL_FWD:
case FAST_FWD:
+ case CURRENT_FRAME:
+ case LAST_FRAME:
if( !prev_single_frame &&
prev_command == command &&
cur_audio == prev_audio ) {
case COMMAND_NONE:
case SINGLE_FRAME_FWD:
case SINGLE_FRAME_REWIND:
+ case CURRENT_FRAME:
+ case LAST_FRAME:
// Start from scratch
que->send_command(command, CHANGE_NONE, edl,
1, resume, use_inout, toggle_audio, loop_play,
}
}
-void PlaybackEngine::refresh_frame(int change_type, EDL *edl)
+void PlaybackEngine::refresh_frame(int change_type, EDL *edl, int dir)
{
- que->send_command(CURRENT_FRAME, change_type, edl, 1);
+ que->send_command(dir >= 0 ? CURRENT_FRAME : LAST_FRAME,
+ change_type, edl, 1);
}
void stop_playback(int wait);
void issue_command(EDL *edl, int command, int wait_tracking,
int use_inout, int update_refresh, int toggle_audio, int loop_play);
- void refresh_frame(int change_type, EDL *edl);
+ void refresh_frame(int change_type, EDL *edl, int dir=1);
// Maintain caches through console changes
CICache *audio_cache, *video_cache;
switch( prev_command ) {
case COMMAND_NONE:
case CURRENT_FRAME:
+ case LAST_FRAME:
case PAUSE:
case STOP:
command = NORMAL_FWD;
// Fix the tracking position
if(playback_engine)
{
- if(command->command == CURRENT_FRAME)
+ if(command->command == CURRENT_FRAME || command->command == LAST_FRAME)
{
//printf("RenderEngine::run 4.1 %d\n", playback_engine->tracking_position);
playback_engine->tracking_position = command->playbackstart;
position = mwindow->edl->align_to_frame(position, 0);
position = MAX(position, 0);
+ double start = mwindow->edl->local_session->get_selectionstart(1);
+ double end = mwindow->edl->local_session->get_selectionend(1);
if(position < selection_midpoint) {
mwindow->edl->local_session->set_selectionend(selection_midpoint);
mwindow->edl->local_session->set_selectionstart(position);
- // Que the CWindow
- gui->unlock_window();
- mwindow->cwindow->update(1, 0, 0, 0, 1);
- gui->lock_window("TrackCanvas::cursor_motion_event 1");
- // Update the faders
- mwindow->update_plugin_guis();
- gui->update_patchbay();
}
else {
mwindow->edl->local_session->set_selectionstart(selection_midpoint);
mwindow->edl->local_session->set_selectionend(position);
- // Don't que the CWindow
}
+ // Que the CWindow
+ gui->unlock_window();
+ int dir =
+ start != mwindow->edl->local_session->get_selectionstart(1) ? 1 :
+ end != mwindow->edl->local_session->get_selectionend(1) ? -1 : 0;
+ mwindow->cwindow->update(dir, 0, 0, 0, 1);
+ gui->lock_window("TrackCanvas::cursor_motion_event 1");
+ // Update the faders
+ mwindow->update_plugin_guis();
+ gui->update_patchbay();
timebar_position = mwindow->edl->local_session->get_selectionend(1);
int TransportCommand::single_frame(int command)
{
- return (command == SINGLE_FRAME_FWD ||
- command == SINGLE_FRAME_REWIND ||
- command == CURRENT_FRAME);
+ return (command == SINGLE_FRAME_FWD || command == SINGLE_FRAME_REWIND ||
+ command == CURRENT_FRAME || command == LAST_FRAME);
}
int TransportCommand::single_frame()
{
case NORMAL_REWIND:
case FAST_REWIND:
case SLOW_REWIND:
+ case LAST_FRAME:
return PLAY_REVERSE;
default:
case SINGLE_FRAME_FWD:
case SINGLE_FRAME_REWIND:
case CURRENT_FRAME:
+ case LAST_FRAME:
return 1.;
case FAST_FWD:
break;
case CURRENT_FRAME:
+ case LAST_FRAME:
case SINGLE_FRAME_FWD:
end_position = start_position + frame_period;
break;
break;
}
- if( use_displacement && command != CURRENT_FRAME &&
- get_direction() == PLAY_FORWARD ) {
+ if( use_displacement && (
+ (command != CURRENT_FRAME && get_direction() == PLAY_FORWARD ) ||
+ (command != LAST_FRAME && get_direction() == PLAY_REVERSE ) ) ) {
start_position += frame_period;
end_position += frame_period;
displacement = 1;
#define REWIND 11
#define GOTO_END 12
#define CURRENT_FRAME 13
+#define LAST_FRAME 14
// Level of change. Changes have to be inclusive of all the lesser changes.
// Delete cache
__LINE__, nested_edl, current_edit->nested_edl);
// Convert requested direction to command
- if(renderengine->command->command == CURRENT_FRAME)
+ if( renderengine->command->command == CURRENT_FRAME ||
+ renderengine->command->command == LAST_FRAME )
{
- command = CURRENT_FRAME;
+ command = renderengine->command->command;
}
else
if(direction == PLAY_REVERSE)
__LINE__, current_position, done);
// Update tracking.
- if(renderengine->command->realtime &&
- renderengine->playback_engine &&
- renderengine->command->command != CURRENT_FRAME)
+ if(renderengine->command->realtime && renderengine->playback_engine &&
+ renderengine->command->command != CURRENT_FRAME &&
+ renderengine->command->command != LAST_FRAME)
{
renderengine->playback_engine->update_tracking(fromunits(current_position));
}