rework deglitch/optimize/stop_playback, sams ladspa icons, reticle color, tweak frame...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / editpanel.C
index dadae3d95d80c38676511c413d7f06a0153cd24b..d140faee0f6d4230e58fe58c13640cbabdda09a4 100644 (file)
@@ -339,6 +339,8 @@ void EditPanel::toggle_label()
 void EditPanel::prev_label()
 {
        int shift_down = subwindow->shift_down();
+       int snap = subwindow->ctrl_down() && subwindow->alt_down();
+
        int have_mwindow_lock = mwindow->gui->get_window_lock();
        int have_subwindow_lock =
                 subwindow->get_top_level() == mwindow->gui->get_top_level() ?
@@ -355,7 +357,10 @@ void EditPanel::prev_label()
 
        mwindow->gui->lock_window("EditPanel::prev_label 2");
 
-       mwindow->prev_label(shift_down);
+       if( snap )
+               mwindow->snap_left_label();
+       else
+               mwindow->prev_label(shift_down);
 
        if(!have_mwindow_lock)
                mwindow->gui->unlock_window();
@@ -364,6 +369,8 @@ void EditPanel::prev_label()
 void EditPanel::next_label()
 {
        int shift_down = subwindow->shift_down();
+       int snap = subwindow->ctrl_down() && subwindow->alt_down();
+
        int have_mwindow_lock = mwindow->gui->get_window_lock();
        int have_subwindow_lock =
                 subwindow->get_top_level() == mwindow->gui->get_top_level() ?
@@ -380,7 +387,10 @@ void EditPanel::next_label()
 
        mwindow->gui->lock_window("EditPanel::next_label 2");
 
-       mwindow->next_label(shift_down);
+       if( snap )
+               mwindow->snap_right_label();
+       else
+               mwindow->next_label(shift_down);
 
        if(!have_mwindow_lock)
                mwindow->gui->unlock_window();
@@ -391,6 +401,8 @@ void EditPanel::next_label()
 void EditPanel::prev_edit()
 {
        int shift_down = subwindow->shift_down();
+       int snap = subwindow->ctrl_down() && subwindow->alt_down();
+
        int have_mwindow_lock = mwindow->gui->get_window_lock();
        int have_subwindow_lock =
                 subwindow->get_top_level() == mwindow->gui->get_top_level() ?
@@ -407,7 +419,10 @@ void EditPanel::prev_edit()
 
        mwindow->gui->lock_window("EditPanel::prev_edit 2");
 
-       mwindow->prev_edit_handle(shift_down);
+       if( snap )
+               mwindow->snap_left_edit();
+       else
+               mwindow->prev_edit_handle(shift_down);
 
        if(!have_mwindow_lock)
                mwindow->gui->unlock_window();
@@ -416,6 +431,8 @@ void EditPanel::prev_edit()
 void EditPanel::next_edit()
 {
        int shift_down = subwindow->shift_down();
+       int snap = subwindow->ctrl_down() && subwindow->alt_down();
+
        int have_mwindow_lock = mwindow->gui->get_window_lock();
        int have_subwindow_lock =
                 subwindow->get_top_level() == mwindow->gui->get_top_level() ?
@@ -432,7 +449,10 @@ void EditPanel::next_edit()
 
        mwindow->gui->lock_window("EditPanel::next_edit 2");
 
-       mwindow->next_edit_handle(shift_down);
+       if( snap )
+               mwindow->snap_right_edit();
+       else
+               mwindow->next_edit_handle(shift_down);
 
        if(!have_mwindow_lock)
                mwindow->gui->unlock_window();
@@ -442,9 +462,7 @@ void EditPanel::next_edit()
 double EditPanel::get_position()
 {
        EDL *edl = mwindow->edl;
-       return !edl ? 0 :
-               edl->local_session->get_selectionstart(1) +
-                       edl->session->get_frame_offset() / edl->session->frame_rate;
+       return !edl ? 0 : edl->local_session->get_selectionstart(1);
 }
 
 void EditPanel::set_position(double position)
@@ -452,7 +470,6 @@ void EditPanel::set_position(double position)
        EDL *edl = mwindow->edl;
        if( !edl ) return;
        if( position != get_position() ) {
-               position -= edl->session->get_frame_offset() / edl->session->frame_rate;
                if( position < 0 ) position = 0;
                edl->local_session->set_selectionstart(position);
                edl->local_session->set_selectionend(position);
@@ -708,7 +725,7 @@ EditNextLabel::~EditNextLabel()
 }
 int EditNextLabel::keypress_event()
 {
-       if(get_keypress() == RIGHT && ctrl_down())
+       if( ctrl_down() && get_keypress() == (!alt_down() ? RIGHT : '>') )
                return handle_event();
        return 0;
 }
@@ -735,7 +752,7 @@ EditPrevLabel::~EditPrevLabel()
 }
 int EditPrevLabel::keypress_event()
 {
-       if(get_keypress() == LEFT && ctrl_down())
+       if( ctrl_down() && get_keypress() == (!alt_down() ? LEFT : '<') )
                return handle_event();
        return 0;
 }
@@ -764,7 +781,7 @@ EditNextEdit::~EditNextEdit()
 }
 int EditNextEdit::keypress_event()
 {
-       if(get_keypress() == RIGHT && alt_down())
+       if( alt_down() && get_keypress() == (!ctrl_down() ? RIGHT : '.') )
                return handle_event();
        return 0;
 }
@@ -791,7 +808,7 @@ EditPrevEdit::~EditPrevEdit()
 }
 int EditPrevEdit::keypress_event()
 {
-       if(get_keypress() == LEFT && alt_down())
+       if( alt_down() && get_keypress() == (!ctrl_down() ? LEFT : ',') )
                return handle_event();
        return 0;
 }
@@ -877,7 +894,7 @@ int EditToClip::handle_event()
 
 int EditToClip::keypress_event()
 {
-       if(get_keypress() == 'i')
+       if(get_keypress() == 'i' && !alt_down())
        {
                handle_event();
                return 1;
@@ -1189,7 +1206,7 @@ EditLabelbutton::~EditLabelbutton()
 }
 int EditLabelbutton::keypress_event()
 {
-       if(get_keypress() == 'l')
+       if(get_keypress() == 'l' && !alt_down())
                return handle_event();
        return 0;
 }