implemented 'ripple to' timeline actions
This commit is contained in:
@@ -221,3 +221,10 @@ rational Block::MediaToSequenceTime(const rational &media_time)
|
||||
|
||||
return media_time - media_in() + in();
|
||||
}
|
||||
|
||||
void Block::CopyParameters(Block *source, Block *dest)
|
||||
{
|
||||
dest->set_block_name(source->block_name());
|
||||
dest->set_length(source->length());
|
||||
dest->set_media_in(source->media_in());
|
||||
}
|
||||
|
||||
@@ -102,6 +102,8 @@ protected:
|
||||
|
||||
rational MediaToSequenceTime(const rational& media_time);
|
||||
|
||||
static void CopyParameters(Block* source, Block* dest);
|
||||
|
||||
private:
|
||||
NodeInput* previous_input_;
|
||||
NodeOutput* block_output_;
|
||||
|
||||
@@ -33,8 +33,7 @@ Block *ClipBlock::copy()
|
||||
{
|
||||
ClipBlock* c = new ClipBlock();
|
||||
|
||||
c->set_block_name(block_name());
|
||||
c->set_length(length());
|
||||
CopyParameters(this, c);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@ Block *GapBlock::copy()
|
||||
{
|
||||
GapBlock* c = new GapBlock();
|
||||
|
||||
c->set_block_name(block_name());
|
||||
c->set_length(length());
|
||||
CopyParameters(this, c);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ Block *TrackOutput::NearestBlockBefore(const rational &time)
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return this;
|
||||
}
|
||||
|
||||
Block *TrackOutput::NearestBlockAfter(const rational &time)
|
||||
@@ -163,7 +163,7 @@ Block *TrackOutput::NearestBlockAfter(const rational &time)
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return this;
|
||||
}
|
||||
|
||||
const QVector<Block *> &TrackOutput::Blocks()
|
||||
|
||||
Reference in New Issue
Block a user