accurate math on timeline, near-accurate on viewer
This commit is contained in:
+5
-5
@@ -108,7 +108,7 @@ Timeline::Timeline(QWidget *parent) :
|
||||
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), this, SLOT(setScroll(int)));
|
||||
connect(ui->videoScrollbar, SIGNAL(valueChanged(int)), ui->video_area, SLOT(setScroll(int)));
|
||||
connect(ui->audioScrollbar, SIGNAL(valueChanged(int)), ui->audio_area, SLOT(setScroll(int)));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(resized_scroll(double)), this, SLOT(resized_scroll_listener(double)));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(resize_move(double)), this, SLOT(resize_move(double)));
|
||||
|
||||
update_sequence();
|
||||
}
|
||||
@@ -451,7 +451,7 @@ void Timeline::repaint_timeline() {
|
||||
if (sequence != NULL) {
|
||||
long sequenceEndFrame = sequence->getEndFrame();
|
||||
|
||||
ui->headers->set_scrollbar_max(ui->horizontalScrollBar, sequenceEndFrame, (ui->editAreas->width()/2));
|
||||
ui->headers->set_scrollbar_max(ui->horizontalScrollBar, sequenceEndFrame, ui->editAreas->width() - getScreenPointFromFrame(zoom, 200));
|
||||
|
||||
if (last_frame != sequence->playhead) {
|
||||
ui->audio_monitor->update();
|
||||
@@ -1403,7 +1403,7 @@ void Timeline::deselect() {
|
||||
}
|
||||
|
||||
long getFrameFromScreenPoint(double zoom, int x) {
|
||||
long f = qCeil((float) x / zoom);
|
||||
long f = qCeil((float) x / zoom);
|
||||
if (f < 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1411,7 +1411,7 @@ long getFrameFromScreenPoint(double zoom, int x) {
|
||||
}
|
||||
|
||||
int getScreenPointFromFrame(double zoom, long frame) {
|
||||
return (int) qFloor(frame*zoom);
|
||||
return (int) qFloor(frame*zoom);
|
||||
}
|
||||
|
||||
long Timeline::getTimelineFrameFromScreenPoint(int x) {
|
||||
@@ -1576,7 +1576,7 @@ void Timeline::transition_menu_select(QAction* a) {
|
||||
ui->toolTransitionButton->setChecked(true);
|
||||
}
|
||||
|
||||
void Timeline::resized_scroll_listener(double z) {
|
||||
void Timeline::resize_move(double z) {
|
||||
set_zoom_value(zoom * z);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -223,7 +223,7 @@ private slots:
|
||||
|
||||
void transition_menu_select(QAction*);
|
||||
|
||||
void resized_scroll_listener(double z);
|
||||
void resize_move(double d);
|
||||
|
||||
private:
|
||||
void set_zoom_value(double v);
|
||||
@@ -231,7 +231,7 @@ private:
|
||||
void decheck_tool_buttons(QObject* sender);
|
||||
void set_tool(int tool);
|
||||
long last_frame;
|
||||
int scroll;
|
||||
int scroll;
|
||||
|
||||
int default_track_height;
|
||||
};
|
||||
|
||||
+4
-3
@@ -65,7 +65,7 @@ Viewer::Viewer(QWidget *parent) :
|
||||
connect(&recording_flasher, SIGNAL(timeout()), this, SLOT(recording_flasher_update()));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), ui->headers, SLOT(set_scroll(int)));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(valueChanged(int)), viewer_widget, SLOT(set_waveform_scroll(int)));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(resized_scroll(double)), this, SLOT(resized_scroll_listener(double)));
|
||||
connect(ui->horizontalScrollBar, SIGNAL(resize_move(double)), this, SLOT(resize_move(double)));
|
||||
connect(ui->zoomComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(zoom_update(int)));
|
||||
|
||||
update_playhead_timecode(0);
|
||||
@@ -431,7 +431,8 @@ void Viewer::set_zoom_value(double d) {
|
||||
viewer_widget->update();
|
||||
}
|
||||
ui->headers->set_scrollbar_max(ui->horizontalScrollBar, seq->getEndFrame(), ui->headers->width());
|
||||
center_scroll_to_playhead(ui->horizontalScrollBar, ui->headers->get_zoom(), seq->playhead);
|
||||
if (!ui->horizontalScrollBar->is_resizing())
|
||||
center_scroll_to_playhead(ui->horizontalScrollBar, ui->headers->get_zoom(), seq->playhead);
|
||||
}
|
||||
|
||||
void Viewer::set_media(Media* m) {
|
||||
@@ -573,7 +574,7 @@ void Viewer::zoom_update(int i) {
|
||||
ui->glViewerPane->adjust();
|
||||
}
|
||||
|
||||
void Viewer::resized_scroll_listener(double d) {
|
||||
void Viewer::resize_move(double d) {
|
||||
set_zoom_value(ui->headers->get_zoom()*d);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ private slots:
|
||||
void timer_update();
|
||||
void recording_flasher_update();
|
||||
void zoom_update(int i);
|
||||
void resized_scroll_listener(double d);
|
||||
void resize_move(double d);
|
||||
private:
|
||||
void clean_created_seq();
|
||||
void set_sequence(bool main, Sequence* s);
|
||||
|
||||
Reference in New Issue
Block a user