@@ -53,8 +53,9 @@ PlaybackControls::PlaybackControls(QWidget *parent) :
|
||||
lower_left_layout->setSpacing(0);
|
||||
lower_left_layout->setMargin(0);
|
||||
|
||||
cur_tc_lbl_ = new TimeSlider();
|
||||
connect(cur_tc_lbl_, &TimeSlider::ValueChanged, this, &PlaybackControls::TimeChanged);
|
||||
cur_tc_lbl_ = new RationalSlider();
|
||||
cur_tc_lbl_->SetDisplayType(RationalSlider::kTime);
|
||||
connect(cur_tc_lbl_, &RationalSlider::ValueChanged, this, &PlaybackControls::TimeChanged);
|
||||
lower_left_layout->addWidget(cur_tc_lbl_);
|
||||
lower_left_layout->addStretch();
|
||||
|
||||
@@ -179,12 +180,12 @@ void PlaybackControls::SetAudioVideoDragButtonsVisible(bool e)
|
||||
audio_drag_btn_->setVisible(e);
|
||||
}
|
||||
|
||||
void PlaybackControls::SetTime(const int64_t &r)
|
||||
void PlaybackControls::SetTime(const rational &r)
|
||||
{
|
||||
cur_tc_lbl_->SetValue(r);
|
||||
}
|
||||
|
||||
void PlaybackControls::SetEndTime(const int64_t &r)
|
||||
void PlaybackControls::SetEndTime(const rational &r)
|
||||
{
|
||||
if (time_base_.isNull()) {
|
||||
return;
|
||||
@@ -192,9 +193,9 @@ void PlaybackControls::SetEndTime(const int64_t &r)
|
||||
|
||||
end_time_ = r;
|
||||
|
||||
end_tc_lbl_->setText(Timecode::timestamp_to_timecode(end_time_,
|
||||
time_base_,
|
||||
Core::instance()->GetTimecodeDisplay()));
|
||||
end_tc_lbl_->setText(Timecode::time_to_timecode(end_time_,
|
||||
time_base_,
|
||||
Core::instance()->GetTimecodeDisplay()));
|
||||
}
|
||||
|
||||
void PlaybackControls::ShowPauseButton()
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "common/rational.h"
|
||||
#include "dragbutton.h"
|
||||
#include "widget/slider/timeslider.h"
|
||||
#include "widget/slider/rationalslider.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
@@ -53,9 +53,9 @@ public:
|
||||
void SetAudioVideoDragButtonsVisible(bool e);
|
||||
|
||||
public slots:
|
||||
void SetTime(const int64_t &r);
|
||||
void SetTime(const rational &r);
|
||||
|
||||
void SetEndTime(const int64_t &r);
|
||||
void SetEndTime(const rational &r);
|
||||
|
||||
void ShowPauseButton();
|
||||
|
||||
@@ -100,7 +100,7 @@ signals:
|
||||
|
||||
void VideoPressed();
|
||||
|
||||
void TimeChanged(const int64_t& t);
|
||||
void TimeChanged(const rational& t);
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *) override;
|
||||
@@ -111,10 +111,10 @@ private:
|
||||
QWidget* lower_left_container_;
|
||||
QWidget* lower_right_container_;
|
||||
|
||||
TimeSlider* cur_tc_lbl_;
|
||||
RationalSlider* cur_tc_lbl_;
|
||||
QLabel* end_tc_lbl_;
|
||||
|
||||
int64_t end_time_;
|
||||
rational end_time_;
|
||||
|
||||
rational time_base_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user