some ripple behavior fixes

This commit is contained in:
itsmattkc
2019-09-21 01:01:15 +10:00
parent 885aee97a2
commit d0d4756129
8 changed files with 45 additions and 6 deletions
+12
View File
@@ -64,6 +64,8 @@ const rational& Block::length()
void Block::set_length(const rational &length)
{
Q_ASSERT(length > 0);
Lock();
length_ = length;
@@ -177,6 +179,16 @@ void Block::set_media_in(const rational &media_in)
}
}
const QString &Block::block_name()
{
return block_name_;
}
void Block::set_block_name(const QString &name)
{
block_name_ = name;
}
rational Block::SequenceToMediaTime(const rational &sequence_time)
{
// These constants are not considered "values" per se, so we don't modify them
+5
View File
@@ -67,6 +67,9 @@ public:
const rational& media_in();
void set_media_in(const rational& media_in);
const QString& block_name();
void set_block_name(const QString& name);
public slots:
/**
* @brief Refreshes internal cache of in/out points up to date
@@ -113,6 +116,8 @@ private:
Block* next_;
QString block_name_;
private slots:
void EdgeAddedSlot(NodeEdgePtr edge);
+12
View File
@@ -147,6 +147,18 @@ NodeOutput* TrackOutput::track_output()
return track_output_;
}
Block *TrackOutput::NearestBlockBefore(const rational &time)
{
foreach (Block* block, block_cache_) {
// Blocks are sorted by time, so the first Block who's out point is at/after this time is the correct Block
if (block->out() >= time) {
return block;
}
}
return nullptr;
}
Block *TrackOutput::NearestBlockAfter(const rational &time)
{
foreach (Block* block, block_cache_) {
+2
View File
@@ -59,6 +59,8 @@ public:
NodeOutput* track_output();
Block* NearestBlockBefore(const rational& time);
Block* NearestBlockAfter(const rational& time);
const QVector<Block*>& Blocks();