xlat default theme name, fix stop blunder
[goodguy/history.git] / cinelerra-5.1 / cinelerra / transportque.C
index 5b7fba9d4266ebce17592041b7f1eae35e83f99e..16aa45faf352aad41e945a99057f41dc1ed50521 100644 (file)
@@ -52,6 +52,7 @@ void TransportCommand::reset()
        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;
@@ -85,6 +86,7 @@ void TransportCommand::copy_from(TransportCommand *command)
        this->playbackstart = command->playbackstart;
        this->realtime = command->realtime;
        this->resume = command->resume;
+       this->audio_toggle = command->audio_toggle;
 }
 
 TransportCommand& TransportCommand::operator=(TransportCommand &command)
@@ -111,19 +113,17 @@ int TransportCommand::get_direction()
                case SLOW_FWD:
                case CURRENT_FRAME:
                        return PLAY_FORWARD;
-                       break;
 
                case SINGLE_FRAME_REWIND:
                case NORMAL_REWIND:
                case FAST_REWIND:
                case SLOW_REWIND:
                        return PLAY_REVERSE;
-                       break;
 
                default:
-                       return PLAY_FORWARD;
                        break;
        }
+       return PLAY_FORWARD;
 }
 
 float TransportCommand::get_speed()
@@ -150,13 +150,10 @@ float TransportCommand::get_speed()
 }
 
 // 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:
@@ -228,6 +225,7 @@ void TransportCommand::set_playback_range(EDL *edl, int use_inout)
                        break;
        }
 
+       audio_toggle = toggle_audio;
 }
 
 void TransportCommand::playback_range_adjust_inout()
@@ -258,19 +256,11 @@ void TransportCommand::playback_range_project()
        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()
@@ -285,12 +275,8 @@ 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;
@@ -317,7 +303,7 @@ int TransportQue::send_command(int 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();