core: added signalling for timecode display changes
Allows targeted application-wide UI updates for when the user changes the timecode display so that the response is immediate.
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
#include "timeslider.h"
|
||||
|
||||
#include "common/timecodefunctions.h"
|
||||
#include "core.h"
|
||||
|
||||
TimeSlider::TimeSlider(QWidget *parent) :
|
||||
IntegerSlider(parent)
|
||||
{
|
||||
SetMinimum(0);
|
||||
|
||||
connect(Core::instance(), &Core::TimecodeDisplayChanged, this, &TimeSlider::TimecodeDisplayChanged);
|
||||
}
|
||||
|
||||
void TimeSlider::SetTimebase(const rational &timebase)
|
||||
@@ -25,10 +28,15 @@ QString TimeSlider::ValueToString(const QVariant &v)
|
||||
|
||||
return Timecode::timestamp_to_timecode(v.toLongLong(),
|
||||
timebase_,
|
||||
Timecode::CurrentDisplay());
|
||||
Core::instance()->GetTimecodeDisplay());
|
||||
}
|
||||
|
||||
QVariant TimeSlider::StringToValue(const QString &s, bool *ok)
|
||||
{
|
||||
return QVariant::fromValue(Timecode::timecode_to_timestamp(s, timebase_, Timecode::CurrentDisplay(), ok));
|
||||
return QVariant::fromValue(Timecode::timecode_to_timestamp(s, timebase_, Core::instance()->GetTimecodeDisplay(), ok));
|
||||
}
|
||||
|
||||
void TimeSlider::TimecodeDisplayChanged()
|
||||
{
|
||||
UpdateLabel(Value());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user