track: removed old code
This commit is contained in:
@@ -199,142 +199,13 @@ void Track::SetTrackHeight(const double &height)
|
||||
emit TrackHeightChanged(track_height_);
|
||||
}
|
||||
|
||||
/*void Track::InputConnectedEvent(const QString &input, int element, Node *output)
|
||||
{
|
||||
if (input == kBlockInput) {
|
||||
if (element == -1) {
|
||||
// User has replaced the entire array, we will invalidate everything
|
||||
InvalidateAll(kBlockInput, element);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if a block was connected, if not, ignore
|
||||
Block* block = dynamic_cast<Block*>(output);
|
||||
|
||||
if (!block) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine where in the cache this block will be
|
||||
int cache_index = -1;
|
||||
Block *previous = nullptr, *next = nullptr;
|
||||
|
||||
int arr_sz = InputArraySize(kBlockInput);
|
||||
for (int i=element+1; i<arr_sz; i++) {
|
||||
// Find next block because this will be the index that we want to insert at
|
||||
cache_index = GetCacheIndexFromArrayIndex(i);
|
||||
|
||||
if (cache_index >= 0) {
|
||||
next = blocks_.at(cache_index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If there was no next, this will be inserted at the end
|
||||
if (cache_index == -1) {
|
||||
cache_index = blocks_.size();
|
||||
}
|
||||
|
||||
// Determine previous block, either by using next's previous or the last block if there was no
|
||||
// next. If there are neither, they'll both remain null
|
||||
if (next) {
|
||||
previous = next->previous();
|
||||
} else if (!blocks_.isEmpty()) {
|
||||
previous = blocks_.last();
|
||||
}
|
||||
|
||||
// Insert at index
|
||||
blocks_.insert(cache_index, block);
|
||||
block_array_indexes_.insert(cache_index, element);
|
||||
|
||||
// Update previous/next
|
||||
if (previous) {
|
||||
previous->set_next(block);
|
||||
block->set_previous(previous);
|
||||
}
|
||||
|
||||
if (next) {
|
||||
block->set_next(next);
|
||||
next->set_previous(block);
|
||||
}
|
||||
|
||||
block->set_track(this);
|
||||
|
||||
// Update ins/outs
|
||||
UpdateInOutFrom(cache_index);
|
||||
|
||||
// Connect to the block
|
||||
connect(block, &Block::LengthChanged, this, &Track::BlockLengthChanged);
|
||||
|
||||
// Invalidate cache now that block should have an in point
|
||||
Node::InvalidateCache(TimeRange(block->in(), track_length()), kBlockInput);
|
||||
|
||||
// Emit block added signal
|
||||
emit BlockAdded(block);
|
||||
}
|
||||
}
|
||||
|
||||
void Track::InputDisconnectedEvent(const QString &input, int element, Node *output)
|
||||
{
|
||||
if (input == kBlockInput) {
|
||||
if (element == -1) {
|
||||
// User has replaced the entire array, we will invalidate everything
|
||||
InvalidateAll(kBlockInput, element);
|
||||
return;
|
||||
}
|
||||
|
||||
Block* b = dynamic_cast<Block*>(output);
|
||||
|
||||
if (!b) {
|
||||
return;
|
||||
}
|
||||
|
||||
emit BlockRemoved(b);
|
||||
|
||||
TimeRange invalidate_range(b->in(), track_length());
|
||||
|
||||
// Get cache index
|
||||
int cache_index = GetCacheIndexFromArrayIndex(element);
|
||||
|
||||
// Remove block here
|
||||
blocks_.removeAt(cache_index);
|
||||
block_array_indexes_.removeAt(cache_index);
|
||||
|
||||
// Update previous/nexts
|
||||
Block* previous = b->previous();
|
||||
Block* next = b->next();
|
||||
|
||||
if (previous) {
|
||||
previous->set_next(next);
|
||||
}
|
||||
|
||||
if (next) {
|
||||
next->set_previous(previous);
|
||||
}
|
||||
|
||||
b->set_previous(nullptr);
|
||||
b->set_next(nullptr);
|
||||
b->set_track(nullptr);
|
||||
|
||||
// Update lengths
|
||||
if (next) {
|
||||
UpdateInOutFrom(blocks_.indexOf(next));
|
||||
}
|
||||
emit TrackLengthChanged();
|
||||
|
||||
disconnect(b, &Block::LengthChanged, this, &Track::BlockLengthChanged);
|
||||
|
||||
Node::InvalidateCache(invalidate_range, kBlockInput);
|
||||
}
|
||||
}*/
|
||||
|
||||
void Track::InputValueChangedEvent(const QString &input, int element)
|
||||
{
|
||||
Q_UNUSED(element)
|
||||
|
||||
if (input == kMutedInput) {
|
||||
emit MutedChanged(IsMuted());
|
||||
} else if (input == kArrayMapInput) {
|
||||
} else if (false && input == kArrayMapInput) {
|
||||
if (ignore_arraymap_ > 0) {
|
||||
qDebug() << "ignored our own array map update";
|
||||
ignore_arraymap_--;
|
||||
|
||||
Reference in New Issue
Block a user