本文整理汇总了C++中Track::GetIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ Track::GetIndex方法的具体用法?C++ Track::GetIndex怎么用?C++ Track::GetIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track::GetIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RecalcPositions
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
}
示例2: RecalcPositions
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
}
示例3: RecalcPositions
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();
}