infinite = 0;
realtime = 0;
resume = 0;
+ audio_toggle = 0;
// Don't reset the change type for commands which don't perform the change
if(command != STOP) change_type = 0;
command = COMMAND_NONE;
this->playbackstart = command->playbackstart;
this->realtime = command->realtime;
this->resume = command->resume;
+ this->audio_toggle = command->audio_toggle;
}
TransportCommand& TransportCommand::operator=(TransportCommand &command)
return *this;
}
-int TransportCommand::single_frame()
+int TransportCommand::single_frame(int command)
{
return (command == SINGLE_FRAME_FWD ||
command == SINGLE_FRAME_REWIND ||
command == CURRENT_FRAME);
}
-
-
-int TransportCommand::get_direction()
+int TransportCommand::single_frame()
{
- switch(command)
- {
- case SINGLE_FRAME_FWD:
- case NORMAL_FWD:
- case FAST_FWD:
- case SLOW_FWD:
- case CURRENT_FRAME:
- return PLAY_FORWARD;
- break;
+ return single_frame(command);
+}
- case SINGLE_FRAME_REWIND:
- case NORMAL_REWIND:
- case FAST_REWIND:
- case SLOW_REWIND:
- return PLAY_REVERSE;
- break;
- default:
- return PLAY_FORWARD;
- break;
+int TransportCommand::get_direction(int command)
+{
+ switch(command) {
+ case SINGLE_FRAME_FWD:
+ case NORMAL_FWD:
+ case FAST_FWD:
+ case SLOW_FWD:
+ case CURRENT_FRAME:
+ return PLAY_FORWARD;
+
+ case SINGLE_FRAME_REWIND:
+ case NORMAL_REWIND:
+ case FAST_REWIND:
+ case SLOW_REWIND:
+ return PLAY_REVERSE;
+
+ default:
+ break;
}
+ return PLAY_FORWARD;
}
-
-float TransportCommand::get_speed()
+int TransportCommand::get_direction()
{
- switch(command)
- {
- case SLOW_FWD:
- case SLOW_REWIND:
- return 0.5;
-
- case NORMAL_FWD:
- case NORMAL_REWIND:
- case SINGLE_FRAME_FWD:
- case SINGLE_FRAME_REWIND:
- case CURRENT_FRAME:
- return 1.;
+ return get_direction(command);
+}
- case FAST_FWD:
- case FAST_REWIND:
- return 2.;
+float TransportCommand::get_speed(int command)
+{
+ switch(command) {
+ case SLOW_FWD:
+ case SLOW_REWIND:
+ return 0.5;
+
+ case NORMAL_FWD:
+ case NORMAL_REWIND:
+ case SINGLE_FRAME_FWD:
+ case SINGLE_FRAME_REWIND:
+ case CURRENT_FRAME:
+ return 1.;
+
+ case FAST_FWD:
+ case FAST_REWIND:
+ return 2.;
}
return 0.;
}
+float TransportCommand::get_speed()
+{
+ return get_speed(command);
+}
// Assume starting without pause
-void TransportCommand::set_playback_range(EDL *edl, int use_inout)
+void TransportCommand::set_playback_range(EDL *edl, int use_inout, int toggle_audio)
{
if(!edl) edl = this->edl;
-
-
-
switch(command)
{
case SLOW_FWD:
case CURRENT_FRAME:
case SINGLE_FRAME_FWD:
start_position = edl->local_session->get_selectionstart(1);
- end_position = start_position +
- 1.0 /
- edl->session->frame_rate;
+ end_position = start_position + 1.0 / edl->session->frame_rate;
break;
case SINGLE_FRAME_REWIND:
- start_position = edl->local_session->get_selectionend(1);
- end_position = start_position -
- 1.0 /
- edl->session->frame_rate;
+ end_position = edl->local_session->get_selectionend(1);
+ start_position = end_position - 1.0 / edl->session->frame_rate;
break;
}
break;
}
+ audio_toggle = toggle_audio;
}
void TransportCommand::playback_range_adjust_inout()
end_position = edl->tracks->total_playable_length();
}
-
-
-
-
-
-
-
-
-
-
-
-
-
+void TransportCommand::playback_range_1frame()
+{
+ start_position = end_position = edl->local_session->get_selectionstart(1);
+ if( edl->session->frame_rate > 0 ) end_position += 1./edl->session->frame_rate;
+}
TransportQue::TransportQue()
delete output_lock;
}
-int TransportQue::send_command(int command,
- int change_type,
- EDL *new_edl,
- int realtime,
- int resume,
- int use_inout)
+int TransportQue::send_command(int command, int change_type, EDL *new_edl,
+ int realtime, int resume, int use_inout, int toggle_audio)
{
input_lock->lock("TransportQue::send_command 1");
this->command.command = command;
}
// Set playback range
- this->command.set_playback_range(new_edl, use_inout);
+ this->command.set_playback_range(new_edl, use_inout, toggle_audio);
}
input_lock->unlock();