本文整理汇总了C++中NoteData::startChunk方法的典型用法代码示例。如果您正苦于以下问题:C++ NoteData::startChunk方法的具体用法?C++ NoteData::startChunk怎么用?C++ NoteData::startChunk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NoteData
的用法示例。
在下文中一共展示了NoteData::startChunk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doUpdate
void VibratoTimeAxis::doUpdate()
{
Channel *active = gdata->getActiveChannel();
int myStartChunk = -1;
int myCurrentChunk = -1;
int myEndChunk = -1;
double myNoteLength = 0.0;
int myWindowOffset = -999999;
if (active) {
AnalysisData *data = active->dataAtCurrentChunk();
if(data && active->isVisibleNote(data->getNoteIndex()) && active->isLabelNote(data->getNoteIndex())) {
NoteData *note = new NoteData();
note = &active->noteData[data->getNoteIndex()];
myStartChunk = note->startChunk();
myCurrentChunk = active->chunkAtCurrentTime();
myEndChunk = note->endChunk();
myNoteLength = note->noteLength();
// Calculate windowoffset
if ((myEndChunk - myStartChunk) * zoomFactorX > width() - 2 * noteLabelOffset) {
// The vibrato-polyline doesn't fit in the window
if ((myCurrentChunk - myStartChunk) * zoomFactorX < (width() - 2 * noteLabelOffset)/2) {
// We're at the left side of the vibrato-polyline
myWindowOffset = 0 - noteLabelOffset;
} else if ((myEndChunk - myCurrentChunk) * zoomFactorX < (width() - 2 * noteLabelOffset)/2) {
// We're at the right side of the vibrato-polyline
myWindowOffset = toInt((myEndChunk - myStartChunk) * zoomFactorX - width() + noteLabelOffset + 1);
} else {
// We're somewhere in the middle of the vibrato-polyline
myWindowOffset = toInt((myCurrentChunk - myStartChunk) * zoomFactorX - width()/2);
}
} else {
// The vibrato-polyline does fit in the window
myWindowOffset = 0 - noteLabelOffset;
}
}
}
if (myCurrentChunk == -1) {
// No note
if (prevCurrentChunk == myCurrentChunk) {
// Still no timeaxis needed, no update needed
} else {
// Timeaxis should be erased, update widget
prevCurrentChunk = -1;
prevWindowOffset = -999999;
currentChunkToUse = -1;
}
} else {
// Note
if (prevWindowOffset == myWindowOffset) {
// No movement, don't redraw timeaxis
} else {
// Position in note to draw has changed, so draw the timeaxis
prevCurrentChunk = myCurrentChunk;
prevWindowOffset = myWindowOffset;
startChunkToUse = myStartChunk;
currentChunkToUse = myCurrentChunk;
endChunkToUse = myEndChunk;
noteLengthToUse = myNoteLength;
windowOffsetToUse = myWindowOffset;
}
}
}