widget: use rational for internal playhead value

Fixes #1688
This commit is contained in:
itsmattkc
2021-08-02 10:55:01 -07:00
parent 4510f6d36a
commit 438cce1ce5
38 changed files with 217 additions and 334 deletions
+2 -1
View File
@@ -43,9 +43,10 @@ ImageSection::ImageSection(QWidget* parent) :
layout->addWidget(new QLabel(tr("Frame to Export:")), row, 0);
frame_slider_ = new TimeSlider();
frame_slider_ = new RationalSlider();
frame_slider_->SetMinimum(0);
frame_slider_->SetValue(0);
frame_slider_->SetDisplayType(RationalSlider::kTime);
layout->addWidget(frame_slider_, row, 1);
}
+4 -4
View File
@@ -24,7 +24,7 @@
#include <QCheckBox>
#include "codecsection.h"
#include "widget/slider/timeslider.h"
#include "widget/slider/rationalslider.h"
namespace olive {
@@ -44,12 +44,12 @@ public:
frame_slider_->SetTimebase(r);
}
int64_t GetTimestamp() const
rational GetTime() const
{
return frame_slider_->GetValue();
}
void SetTimestamp(int64_t t)
void SetTime(const rational &t)
{
frame_slider_->SetValue(t);
}
@@ -57,7 +57,7 @@ public:
private:
QCheckBox* image_sequence_checkbox_;
TimeSlider* frame_slider_;
RationalSlider* frame_slider_;
private slots:
void ImageSequenceCheckBoxToggled(bool e);