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:
itsmattkc
2020-03-18 14:09:31 +11:00
parent eb871ceccc
commit abb4c440fb
16 changed files with 71 additions and 36 deletions
+3 -5
View File
@@ -23,9 +23,9 @@
#include <QCoreApplication>
#include "codec/decoder.h"
#include "common/timecodefunctions.h"
#include "common/xmlutils.h"
#include "config/config.h"
#include "core.h"
#include "ui/icons/icons.h"
Footage::Footage()
@@ -40,8 +40,6 @@ Footage::~Footage()
void Footage::Load(QXmlStreamReader *reader, QHash<quintptr, StreamPtr>& footage_ptrs, QList<NodeParam::FootageConnection>&, const QAtomicInt* cancelled)
{
qDebug() << "Hello?";
QXmlStreamAttributes attributes = reader->attributes();
foreach (const QXmlStreamAttribute& attr, attributes) {
@@ -234,12 +232,12 @@ QString Footage::duration()
return Timecode::timestamp_to_timecode(duration,
frame_rate_timebase,
Timecode::CurrentDisplay());
Core::instance()->GetTimecodeDisplay());
} else if (streams_.first()->type() == Stream::kAudio) {
AudioStreamPtr audio_stream = std::static_pointer_cast<AudioStream>(streams_.first());
// If we're showing in a timecode, we prefer showing audio in seconds instead
Timecode::Display display = Timecode::CurrentDisplay();
Timecode::Display display = Core::instance()->GetTimecodeDisplay();
if (display == Timecode::kTimecodeDropFrame
|| display == Timecode::kTimecodeNonDropFrame) {
display = Timecode::kTimecodeSeconds;
+1 -1
View File
@@ -199,7 +199,7 @@ QString Sequence::duration()
int64_t timestamp = Timecode::time_to_timestamp(timeline_length, video_params().time_base());
return Timecode::timestamp_to_timecode(timestamp, video_params().time_base(), Timecode::CurrentDisplay());
return Timecode::timestamp_to_timecode(timestamp, video_params().time_base(), Core::instance()->GetTimecodeDisplay());
}
QString Sequence::rate()