added basic razor tool
This commit is contained in:
@@ -327,6 +327,23 @@ Block* TrackOutput::SplitBlock(Block *block, rational time)
|
||||
return copy;
|
||||
}
|
||||
|
||||
void TrackOutput::SplitAtTime(rational time)
|
||||
{
|
||||
// Find Block that contains this time
|
||||
for (int i=0;i<block_cache_.size();i++) {
|
||||
Block* b = block_cache_.at(i);
|
||||
|
||||
if (b->out() == time) {
|
||||
// This time is between blocks, no split needs to occur
|
||||
return;
|
||||
} else if (b->in() < time && b->out() > time) {
|
||||
// We found the Block, split it
|
||||
SplitBlock(b, time);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TrackOutput::RippleRemoveArea(rational in, rational out, Block *insert)
|
||||
{
|
||||
// Block that needs to be split to remove this area
|
||||
|
||||
@@ -116,6 +116,13 @@ public:
|
||||
*/
|
||||
Block *SplitBlock(Block* block, rational time);
|
||||
|
||||
/**
|
||||
* @brief Attempt to split at a certain time
|
||||
*
|
||||
* Finds the Block that surrounds this time and splits it. If there is no Block there, this is a no-op.
|
||||
*/
|
||||
void SplitAtTime(rational time);
|
||||
|
||||
/**
|
||||
* @brief Clears the area between in and out
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user