added function for returning a block at a time
Assists with certain timeline-related functions.
This commit is contained in:
@@ -137,6 +137,19 @@ NodeOutput* TrackOutput::track_output()
|
||||
return track_output_;
|
||||
}
|
||||
|
||||
Block *TrackOutput::BlockContainingTime(const rational &time)
|
||||
{
|
||||
foreach (Block* block, block_cache_) {
|
||||
if (block->in() < time && block->out() > time) {
|
||||
return block;
|
||||
} else if (block->out() == time) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Block *TrackOutput::NearestBlockBefore(const rational &time)
|
||||
{
|
||||
foreach (Block* block, block_cache_) {
|
||||
|
||||
@@ -56,6 +56,8 @@ public:
|
||||
|
||||
NodeOutput* track_output();
|
||||
|
||||
Block* BlockContainingTime(const rational& time);
|
||||
|
||||
Block* NearestBlockBefore(const rational& time);
|
||||
|
||||
Block* NearestBlockAfter(const rational& time);
|
||||
|
||||
Reference in New Issue
Block a user