timebasedwidget: implemented go to in/out

This commit is contained in:
itsmattkc
2020-04-17 00:20:16 +10:00
parent a93b06b7a2
commit a5c1de6df3
5 changed files with 44 additions and 0 deletions
+10
View File
@@ -195,4 +195,14 @@ void TimeBasedPanel::ToggleShowAll()
GetTimeBasedWidget()->ToggleShowAll();
}
void TimeBasedPanel::GoToIn()
{
GetTimeBasedWidget()->GoToIn();
}
void TimeBasedPanel::GoToOut()
{
GetTimeBasedWidget()->GoToOut();
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -80,6 +80,10 @@ public:
virtual void ToggleShowAll() override;
virtual void GoToIn() override;
virtual void GoToOut() override;
public slots:
void SetTimebase(const rational& timebase);
+4
View File
@@ -146,6 +146,10 @@ public:
virtual void ToggleShowAll(){}
virtual void GoToIn(){}
virtual void GoToOut(){}
protected:
/**
* @brief paintEvent
+22
View File
@@ -462,4 +462,26 @@ void TimeBasedWidget::ToggleShowAll()
}
}
void TimeBasedWidget::GoToIn()
{
if (viewer_node_) {
if (points_ && points_->workarea()->enabled()) {
SetTimeAndSignal(Timecode::time_to_timestamp(points_->workarea()->in(), timebase()));
} else {
GoToStart();
}
}
}
void TimeBasedWidget::GoToOut()
{
if (viewer_node_) {
if (points_ && points_->workarea()->enabled()) {
SetTimeAndSignal(Timecode::time_to_timestamp(points_->workarea()->out(), timebase()));
} else {
GoToEnd();
}
}
}
OLIVE_NAMESPACE_EXIT
+4
View File
@@ -86,6 +86,10 @@ public slots:
void ToggleShowAll();
void GoToIn();
void GoToOut();
TimeRuler* ruler() const;
protected slots: