added seek also selects #297
This commit is contained in:
+17
-1
@@ -476,7 +476,23 @@ void Timeline::select_all() {
|
||||
}
|
||||
|
||||
void Timeline::scroll_to_frame(long frame) {
|
||||
scroll_to_frame_internal(horizontalScrollBar, frame, zoom, timeline_area->width());
|
||||
scroll_to_frame_internal(horizontalScrollBar, frame, zoom, timeline_area->width());
|
||||
}
|
||||
|
||||
void Timeline::select_from_playhead() {
|
||||
sequence->selections.clear();
|
||||
for (int i=0;i<sequence->clips.size();i++) {
|
||||
Clip* c = sequence->clips.at(i);
|
||||
if (c != NULL
|
||||
&& c->timeline_in <= sequence->playhead
|
||||
&& c->timeline_out > sequence->playhead) {
|
||||
Selection s;
|
||||
s.in = c->timeline_in;
|
||||
s.out = c->timeline_out;
|
||||
s.track = c->track;
|
||||
sequence->selections.append(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Timeline::resizeEvent(QResizeEvent *event) {
|
||||
|
||||
@@ -204,6 +204,7 @@ public:
|
||||
QPushButton* snappingButton;
|
||||
|
||||
void scroll_to_frame(long frame);
|
||||
void select_from_playhead();
|
||||
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
public slots:
|
||||
|
||||
+8
-3
@@ -238,11 +238,16 @@ bool frame_rate_is_droppable(float rate) {
|
||||
void Viewer::seek(long p) {
|
||||
pause();
|
||||
seq->playhead = p;
|
||||
bool update_fx = false;
|
||||
if (main_sequence) {
|
||||
panel_timeline->scroll_to_frame(p);
|
||||
panel_effect_controls->scroll_to_frame(p);
|
||||
if (config.seek_also_selects) {
|
||||
panel_timeline->select_from_playhead();
|
||||
update_fx = true;
|
||||
}
|
||||
}
|
||||
update_parents();
|
||||
update_parents(update_fx);
|
||||
reset_all_audio();
|
||||
audio_scrub = true;
|
||||
}
|
||||
@@ -410,9 +415,9 @@ void Viewer::update_header_zoom() {
|
||||
}
|
||||
}
|
||||
|
||||
void Viewer::update_parents() {
|
||||
void Viewer::update_parents(bool reload_fx) {
|
||||
if (main_sequence) {
|
||||
update_ui(false);
|
||||
update_ui(reload_fx);
|
||||
} else {
|
||||
update_viewer();
|
||||
}
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public:
|
||||
int recording_track;
|
||||
|
||||
void reset_all_audio();
|
||||
void update_parents();
|
||||
void update_parents(bool reload_fx = false);
|
||||
|
||||
ViewerWidget* viewer_widget;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user