base pointer movement in timeline
This commit is contained in:
@@ -245,12 +245,12 @@ void TrackOutput::AddBlockToGraph(Block *block)
|
||||
|
||||
void TrackOutput::PlaceBlock(Block *block, rational start)
|
||||
{
|
||||
AddBlockToGraph(block);
|
||||
|
||||
if (block->in() == start) {
|
||||
if (block_cache_.contains(block) && block->in() == start) {
|
||||
return;
|
||||
}
|
||||
|
||||
AddBlockToGraph(block);
|
||||
|
||||
// Check if the placement location is past the end of the timeline
|
||||
if (start >= in()) {
|
||||
if (start > in()) {
|
||||
@@ -408,3 +408,22 @@ void TrackOutput::RippleRemoveArea(rational in, rational out, Block *insert)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TrackOutput::ReplaceBlock(Block *old, Block *replace)
|
||||
{
|
||||
Block* previous = old->previous();
|
||||
Block* next = old->next();
|
||||
|
||||
AddBlockToGraph(replace);
|
||||
|
||||
// Disconnect old block from its surroundings
|
||||
if (previous != nullptr) {
|
||||
Block::DisconnectBlocks(previous, old);
|
||||
Block::ConnectBlocks(previous, replace);
|
||||
}
|
||||
|
||||
if (next != nullptr) {
|
||||
Block::DisconnectBlocks(old, next);
|
||||
Block::ConnectBlocks(replace, next);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user