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:
@@ -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>();
|
||||
|
||||
@@ -38,6 +38,8 @@ public:
|
||||
|
||||
virtual void Retranslate() override;
|
||||
|
||||
virtual NodeValueTable Value(const NodeValueDatabase& value) const override;
|
||||
|
||||
protected:
|
||||
NodeInput* footage_input_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user