int prev_edit_handle(int shift_down);
// seek to keyframes
int nearest_plugin_keyframe(int shift_down, int dir);
+ int nearest_auto_keyframe(int shift_down, int dir);
// offset is pixels to add to track_start
void trackmovement(int offset, int pane_number);
// view_start is pixels
switch( get_keypress() ) {
case 'A':
- if( !ctrl_down() || !shift_down() || alt_down() ) break;
- mwindow->edl->tracks->clear_selected_edits();
- draw_overlays(1);
+ if( !alt_down() ) {
+ if( !ctrl_down() || !shift_down() ) break;
+ mwindow->edl->tracks->clear_selected_edits();
+ draw_overlays(1);
+ result = 1;
+ break;
+ } // fall thru
+ case 'a':
+ if( !alt_down() ) break;
+ stop_transport("MWindowGUI::keypress_event 1");
+ mwindow->nearest_auto_keyframe(shift_down(),
+ !ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE);
result = 1;
break;
+
case 'e':
mwindow->toggle_editing_mode();
result = 1;
case 'k': case 'K':
if( alt_down() ) break;
- stop_transport("MWindowGUI::keypress_event 1");
+ stop_transport("MWindowGUI::keypress_event 2");
mwindow->nearest_plugin_keyframe(shift_down(),
!ctrl_down() ? PLAY_FORWARD : PLAY_REVERSE);
result = 1;
KeyFrame *keyframe = 0;
double start = edl->local_session->get_selectionstart(1);
double end = edl->local_session->get_selectionend(1);
- double position = dir == PLAY_FORWARD ? end : start, new_position = 0;
+ double position = dir == PLAY_FORWARD ? end : start;
+ double new_position = dir == PLAY_FORWARD ? start : end;
for( Track *track=edl->tracks->first; track; track=track->next ) {
if( !track->record ) continue;
for( int i=0; i<track->plugin_set.size(); ++i ) {
return find_selection(new_position);
}
+int MWindow::nearest_auto_keyframe(int shift_down, int dir)
+{
+ Auto *keyframe = 0;
+ double start = edl->local_session->get_selectionstart(1);
+ double end = edl->local_session->get_selectionend(1);
+ double position = dir == PLAY_FORWARD ? end : start;
+ double new_position = dir == PLAY_FORWARD ? start : end;
+ for( Track *track=edl->tracks->first; track; track=track->next ) {
+ if( !track->record ) continue;
+ int64_t pos = track->to_units(position, 0);
+ for( int i=0; i<AUTOMATION_TOTAL; ++i ) {
+ Autos *autos = track->automation->autos[i];
+ if( !autos ) continue;
+ Auto *key = dir == PLAY_FORWARD ?
+ autos->nearest_after(pos) :
+ autos->nearest_before(pos);
+ if( !key ) continue;
+ double key_position = track->from_units(key->position);
+ if( keyframe && (dir == PLAY_FORWARD ?
+ key_position >= new_position :
+ new_position >= key_position ) ) continue;
+ keyframe = key; new_position = key_position;
+ }
+ }
+
+ new_position = keyframe ?
+ keyframe->autos->track->from_units(keyframe->position) :
+ dir == PLAY_FORWARD ? edl->tracks->total_length() : 0;
+
+ if( !shift_down )
+ start = end = new_position;
+ else if( dir == PLAY_FORWARD )
+ end = new_position;
+ else
+ start = new_position;
+
+ edl->local_session->set_selectionstart(start);
+ edl->local_session->set_selectionend(end);
+ return find_selection(new_position);
+}
+
int MWindow::find_selection(double position, int scroll_display)
{
update_plugin_guis();
KeyFrame *PluginSet::nearest_keyframe(int64_t pos, int dir)
{
+ if( first && pos < first->startproject )
+ pos = first->startproject;
+ else if( last && pos > last->startproject+last->length )
+ pos = last->startproject+last->length;
Plugin *plugin = (Plugin*)editof(pos, dir, 0);
if( !plugin ) return 0;
KeyFrame *keyframe = (KeyFrame *)(dir == PLAY_FORWARD ?
stop_playback();
// Select region between two labels
- if( !is_vwindow() && get_double_click() ) {
+ if( !is_vwindow() && get_double_click() &&
+ get_edl()->labels->first ) {
int x = get_relative_cursor_x();
double position = pixel_to_position(x);
// Test labels
// Que the CWindow
unlock_window();
mwindow->cwindow->update(1, 0, 0);
- mwindow->gui->lock_window("TimeBar::select_region");
+ mwindow->gui->lock_window("TimeBar::select_region 3");
mwindow->gui->hide_cursor(0);
mwindow->gui->draw_cursor(1);
mwindow->gui->flash_canvas(0);
mwindow->gui->activate_timeline();
mwindow->gui->zoombar->update();
mwindow->gui->unlock_window();
- lock_window("TimeBar::select_region");
+ lock_window("TimeBar::select_region 4");
update_highlights();
return 0;
}
<tr>
<td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>Prev kf select</font></td>
- <td align="left"><font face="Liberation Serif" size=4>'Ctrl-shift-K’</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Ctrl-Shift-K’</font></td>
<td align="left"><font face="Liberation Serif" size=4>Select from cursor to previous keyframe</font></td>
</tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Next auto</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Alt-a’</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Move to next auto</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Prev auto</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Ctrl-Alt-a’</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Move to previous auto</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Next auto select</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Alt-Shift-A’</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Select from cursor to next auto</font></td>
+ </tr>
+ <tr>
+ <td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Prev auto select</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>'Ctrl-Alt-Shf-A’</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>Select from cursor to previous auto</font></td>
+ </tr>
<tr>
<td height="26" align="right"><font face="Liberation Serif" size=4> </font></td>
<td align="left"><font face="Liberation Serif" size=4>Previous edit</font></td>
<td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4><br></font></td>
<td align="left"><font face="Liberation Serif" size=4>Double MMB</font></td>
- <td align="left"><font face="Liberation Serif" size=4>On fade/speed, select keyframe position</font></td>
+ <td align="left"><font face="Liberation Serif" size=4>On auto or keyframe, select that position</font></td>
</tr>
<tr>
<td height="26" align="left"><font face="Liberation Serif" size=4><br></font></td>