void TrackList::RecalcPositions(TrackNodePointer node) { if (isNull(node)) { return; } Track *t; int i = 0; int y = 0; #ifdef EXPERIMENTAL_OUTPUT_DISPLAY int cnt = 0; if (node->prev) { t = node->prev->t; i = t->GetIndex() + 1; if(MONO_WAVE_PAN(t)) y = t->GetY(true) + t->GetHeight(true); else y = t->GetY() + t->GetHeight(); } for (const TrackListNode *n = node; n; n = n->next) { t = n->t; if(MONO_WAVE_PAN(t)) cnt++; if(cnt != 2){ t->SetIndex(i++); t->SetY(y); y += t->GetHeight(); } if(cnt != 0){ t->SetY(y,true); y += t->GetHeight(true); } cnt = 0; } #else // EXPERIMENTAL_OUTPUT_DISPLAY if (hasPrev(node)) { auto prev = node; --prev; t = prev->get(); i = t->GetIndex() + 1; y = t->GetY() + t->GetHeight(); } const auto theEnd = end(); for (auto n = node; n != theEnd; ++n) { t = n->get(); t->SetIndex(i++); t->SetY(y); y += t->GetHeight(); } #endif // EXPERIMENTAL_OUTPUT_DISPLAY }
void TrackList::RecalcPositions(const TrackListNode *node) { Track *t; int i = 0; int y = 0; if (!node) { return; } #ifdef EXPERIMENTAL_OUTPUT_DISPLAY int cnt = 0; if (node->prev) { t = node->prev->t; i = t->GetIndex() + 1; if(MONO_WAVE_PAN(t)) y = t->GetY(true) + t->GetHeight(true); else y = t->GetY() + t->GetHeight(); } for (const TrackListNode *n = node; n; n = n->next) { t = n->t; if(MONO_WAVE_PAN(t)) cnt++; if(cnt != 2){ t->SetIndex(i++); t->SetY(y); y += t->GetHeight(); } if(cnt != 0){ t->SetY(y,true); y += t->GetHeight(true); } cnt = 0; } #else // EXPERIMENTAL_OUTPUT_DISPLAY if (node->prev) { t = node->prev->t; i = t->GetIndex() + 1; y = t->GetY() + t->GetHeight(); } for (const TrackListNode *n = node; n; n = n->next) { t = n->t; t->SetIndex(i++); t->SetY(y); y += t->GetHeight(); } #endif // EXPERIMENTAL_OUTPUT_DISPLAY }
void TrackList::RecalcPositions(TrackNodePointer node) { if ( isNull( node ) ) return; Track *t; int i = 0; int y = 0; auto prev = getPrev( node ); if ( !isNull( prev ) ) { t = prev.first->get(); i = t->GetIndex() + 1; y = t->GetY() + t->GetHeight(); } const auto theEnd = end(); for (auto n = Find( node.first->get() ); n != theEnd; ++n) { t = *n; t->SetIndex(i++); t->DoSetY(y); y += t->GetHeight(); } UpdatePendingTracks(); }