implemented a footage viewer

Essentially a minor derivation of a viewer type that can automatically view
footage from the project (i.e. not in a sequence).
This commit is contained in:
itsmattkc
2019-12-30 20:17:48 +11:00
parent 55ea4a8177
commit 0db13a96ab
34 changed files with 439 additions and 152 deletions
+16
View File
@@ -20,6 +20,8 @@
#include "media.h"
#include "common/timecodefunctions.h"
MediaInput::MediaInput() :
connected_footage_(nullptr)
{
@@ -45,6 +47,20 @@ void MediaInput::Retranslate()
footage_input_->set_name(tr("Footage"));
}
NodeValueTable MediaInput::Value(const NodeValueDatabase &value) const
{
NodeValueTable table = value.Merge();
if (connected_footage_) {
rational media_duration = Timecode::timestamp_to_time(connected_footage_->duration(),
connected_footage_->timebase());
table.Push(NodeInput::kRational, QVariant::fromValue(media_duration), "length");
}
return table;
}
void MediaInput::FootageChanged()
{
StreamPtr new_footage = footage_input_->get_standard_value().value<StreamPtr>();
+2
View File
@@ -38,6 +38,8 @@ public:
virtual void Retranslate() override;
virtual NodeValueTable Value(const NodeValueDatabase& value) const override;
protected:
NodeInput* footage_input_;