本文整理汇总了C++中SynthGroupElement::ResetAllControllers方法的典型用法代码示例。如果您正苦于以下问题:C++ SynthGroupElement::ResetAllControllers方法的具体用法?C++ SynthGroupElement::ResetAllControllers怎么用?C++ SynthGroupElement::ResetAllControllers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SynthGroupElement
的用法示例。
在下文中一共展示了SynthGroupElement::ResetAllControllers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetElForGroupID
void AUInstrumentBase::PerformEvents(const AudioTimeStamp& inTimeStamp)
{
#if DEBUG_PRINT_RENDER
printf("AUInstrumentBase::PerformEvents\n");
#endif
SynthEvent *event;
SynthGroupElement *group;
while ((event = mEventQueue.ReadItem()) != NULL)
{
#if DEBUG_PRINT_RENDER
printf("event %08X %d\n", event, event->GetEventType());
#endif
switch(event->GetEventType())
{
case SynthEvent::kEventType_NoteOn :
RealTimeStartNote(GetElForGroupID (event->GetGroupID()), event->GetNoteID(),
event->GetOffsetSampleFrame(), *event->GetParams());
break;
case SynthEvent::kEventType_NoteOff :
RealTimeStopNote(GetElForGroupID (event->GetGroupID()), event->GetNoteID(),
event->GetOffsetSampleFrame());
break;
case SynthEvent::kEventType_SustainOn :
group = GetElForGroupID (event->GetGroupID());
group->SustainOn(event->GetOffsetSampleFrame());
break;
case SynthEvent::kEventType_SustainOff :
group = GetElForGroupID (event->GetGroupID());
group->SustainOff(event->GetOffsetSampleFrame());
break;
case SynthEvent::kEventType_SostenutoOn :
group = GetElForGroupID (event->GetGroupID());
group->SostenutoOn(event->GetOffsetSampleFrame());
break;
case SynthEvent::kEventType_SostenutoOff :
group = GetElForGroupID (event->GetGroupID());
group->SostenutoOff(event->GetOffsetSampleFrame());
break;
case SynthEvent::kEventType_AllNotesOff :
group = GetElForGroupID (event->GetGroupID());
group->AllNotesOff(event->GetOffsetSampleFrame());
break;
case SynthEvent::kEventType_AllSoundOff :
group = GetElForGroupID (event->GetGroupID());
group->AllSoundOff(event->GetOffsetSampleFrame());
break;
case SynthEvent::kEventType_ResetAllControllers :
group = GetElForGroupID (event->GetGroupID());
group->ResetAllControllers(event->GetOffsetSampleFrame());
break;
}
mEventQueue.AdvanceReadPtr();
}
}
示例2: GetElForGroupID
OSStatus AUInstrumentBase::SendPedalEvent(MusicDeviceGroupID inGroupID, UInt32 inEventType, UInt32 inOffsetSampleFrame)
{
if (InRenderThread ())
{
SynthGroupElement *group = GetElForGroupID(inGroupID);
if (!group)
return kAudioUnitErr_InvalidElement;
switch (inEventType)
{
case SynthEvent::kEventType_SustainOn :
group->SustainOn(inOffsetSampleFrame);
break;
case SynthEvent::kEventType_SustainOff :
group->SustainOff(inOffsetSampleFrame);
break;
case SynthEvent::kEventType_SostenutoOn :
group->SostenutoOn(inOffsetSampleFrame);
break;
case SynthEvent::kEventType_SostenutoOff :
group->SostenutoOff(inOffsetSampleFrame);
break;
case SynthEvent::kEventType_AllNotesOff :
group->AllNotesOff(inOffsetSampleFrame);
mNumActiveNotes = CountActiveNotes();
break;
case SynthEvent::kEventType_AllSoundOff :
group->AllSoundOff(inOffsetSampleFrame);
mNumActiveNotes = CountActiveNotes();
break;
case SynthEvent::kEventType_ResetAllControllers :
group->ResetAllControllers(inOffsetSampleFrame);
break;
}
}
else
{
SynthEvent *event = mEventQueue.WriteItem();
if (!event) return -1; // queue full
event->Set(inEventType, inGroupID, 0, 0, NULL);
mEventQueue.AdvanceWritePtr();
}
return noErr;
}