MusicSequencerSetUserCallback doesn't work
MusicSequencerSetUserCallback doesn't work
- Subject: MusicSequencerSetUserCallback doesn't work
- From: MF <email@hidden>
- Date: Mon, 22 Dec 2008 00:04:53 +0100
Hello List,
I am trying to set up the MusicSequencerUserCallback specified in MusicPlayer. The following is my implementation...
MusicSequenceUserCallback CallbackTest::getUserCallback() {
return &hit;
}
void CallbackTest::hit ( void *inClientData,
MusicSequence inSequence,
MusicTrack inTrack,
MusicTimeStamp inEventTime,
const MusicEventUserData *inEventData,
MusicTimeStamp inStartSliceBeat,
MusicTimeStamp inEndSliceBeat)
{
printf ("hit call back");
}
In the main function, I create a Track with an arbitrary event to test if the call back would work
MusicTrack inTrack;
ParameterEvent e;
e.parameterID = kAudioUnitProperty_ScheduledFileRegion;
e.scope = kAudioUnitScope_Global;
e.element = 0;
e.value = 5;
MusicTrackNewParameterEvent(inTrack, 5, &e);
MusicPlayerSetTime(inPlayer, 0.0);
MusicPlayerPreroll(inPlayer);
And I register the callback here...
MusicSequenceSetUserCallback(inSequence, getUserCallback(), NULL);
MusicPlayerStart(inPlayer);
However, my custom 'hit' callback function doesn't get called. Is there anything wrong with my setting? Could anyone please give me a simple example to get this call back work? Could not find any example anywhere... Thank you!
mf
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden