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
@@ -24,7 +24,7 @@
#include <QEvent>
#include <QHBoxLayout>
#include "common/timecodefunctions.h"
#include "core.h"
#include "config/config.h"
#include "ui/icons/icons.h"
@@ -120,6 +120,8 @@ PlaybackControls::PlaybackControls(QWidget *parent) :
UpdateIcons();
SetTimebase(0);
connect(Core::instance(), &Core::TimecodeDisplayChanged, this, &PlaybackControls::TimecodeChanged);
}
void PlaybackControls::SetTimecodeEnabled(bool enabled)
@@ -147,9 +149,11 @@ void PlaybackControls::SetEndTime(const int64_t &r)
return;
}
end_tc_lbl_->setText(Timecode::timestamp_to_timecode(r,
end_time_ = r;
end_tc_lbl_->setText(Timecode::timestamp_to_timecode(end_time_,
time_base_,
Timecode::CurrentDisplay()));
Core::instance()->GetTimecodeDisplay()));
}
void PlaybackControls::ShowPauseButton()
@@ -181,3 +185,9 @@ void PlaybackControls::UpdateIcons()
next_frame_btn_->setIcon(icon::NextFrame);
go_to_end_btn_->setIcon(icon::GoToEnd);
}
void PlaybackControls::TimecodeChanged()
{
// Update end time
SetEndTime(end_time_);
}