当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectList::GetNext方法代码示例

本文整理汇总了C++中ObjectList::GetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectList::GetNext方法的具体用法?C++ ObjectList::GetNext怎么用?C++ ObjectList::GetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectList的用法示例。


在下文中一共展示了ObjectList::GetNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FreeObjectList

void MManager::FreeObjectList( ObjectList* a_List )
{
	ObjectList* list = a_List;
	while (list->GetNext()) list = list->GetNext();
	list->SetNext( m_OList );
	m_OList = a_List;
}
开发者ID:iwillburnyou,项目名称:raytracer7,代码行数:7,代码来源:memory.cpp

示例2: DrawVoice

//--------------------------------------------------------------------------
void PianoRollTrajectory::DrawVoice(ARMusicalVoice* v, DrawParams &drawParams)
{
    if (fVoicesColors != NULL) {
        int voiceNum = v->getVoiceNum();
        
        for (unsigned int i = 0; i < fVoicesColors->size() && fColors->empty(); i++) {
            std::pair<int, VGColor *> pair = fVoicesColors->at(i);

            if (pair.first == voiceNum)
                fColors->push(pair.second);
        }
    }
    
    if (!fColors->empty() || fVoicesAutoColored) {
        if (fColors->empty()) {
            int r, g, b;

            drawParams.colorHue += kGoldenRatio;
            drawParams.colorHue  = fmod(drawParams.colorHue, 1);

            HSVtoRGB((float) drawParams.colorHue, 0.5f, 0.9f, r, g, b);

            fColors->push(new VGColor(r, g, b, 255));
        }
        
        drawParams.dev->PushFillColor(*fColors->top());
    }

    fChord              = false;
	ObjectList   *ol    = (ObjectList *) v;
	GuidoPos      pos   = ol->GetHeadPosition();
    TYPE_DURATION finalDur;

	while(pos)
	{
		ARMusicalObject  *e    = ol->GetNext(pos);
		TYPE_DURATION     dur  = e->getDuration();
		TYPE_TIMEPOSITION date = e->getRelativeTimePosition();

        finalDur = (dur ? dur : finalDur);

        if (fChord) {
            dur   = fChordDuration;
            date -= dur;
        }

		TYPE_TIMEPOSITION end = date + dur;

		if (date >= fStartDate) {
            if (date < fEndDate) {
                if (end > fEndDate)
                    dur = fEndDate - date;

                DrawMusicalObject(e, date, dur, drawParams);
            }
		}
		else if (end > fStartDate) { // to make the note end appear
			date = fStartDate;	
			
            if (end > fEndDate)
                dur = fEndDate - date;
			else
                dur = end - date;
			
            DrawMusicalObject(e, date, dur, drawParams);
		}

        if (static_cast<ARRest *>(e->isARRest())) {
            handleRest(date, drawParams);
			fChord = false;
        }
        else if (static_cast<ARChordComma *>(e->isARChordComma()))
			fChord = true;
        else if (static_cast<ARNoteFormat *>(e->isARNoteFormat()))
            handleColor(static_cast<ARNoteFormat *>(e->isARNoteFormat()), drawParams);
        else if (static_cast<ARBar *>(e->isARBar()) && fMeasureBarsEnabled)
            DrawMeasureBar(date, drawParams);
	}

    DrawLinks(drawParams);                // Draws link to final event
    DrawFinalEvent(finalDur, drawParams); // Draws link after final event

    while (!fColors->empty())
        popColor(drawParams);

    previousEventInfos->clear();
    currentEventInfos->clear();
    fCurrentDate = 0;
}
开发者ID:anttirt,项目名称:guidolib,代码行数:90,代码来源:PianoRollTrajectory.cpp


注:本文中的ObjectList::GetNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。