Adding UserEvent to Track
Adding UserEvent to Track
- Subject: Adding UserEvent to Track
- From: Craig Bakalian <email@hidden>
- Date: Wed, 26 Nov 2003 12:30:43 -0500
Hi,
When I add this to a track
MusicEventUserData trackTypeID;
int size = sizeof(int);
trackTypeID.length = size;
trackTypeID.data[0] = 1;
MusicTrackNewUserEvent(track, 0.0, &trackTypeID);
and then try to retrieve it like this,
-(int)getTrackTypeUserEventForTrack: (MusicTrack)track
{
MusicEventIterator iter;
Boolean b;
NewMusicEventIterator(track, &iter);
MusicEventIteratorHasNextEvent(iter, &b);
while(b)
{
MidiEventInfo info;
MusicEventIteratorGetEventInfo(iter, &info.stamp, &info.type,
(const void **) &info.data, &info.size);
if(info.stamp == 0.0)
{
if(info.type == kMusicEventType_User)
{
MusicEventUserData *userData = (MusicEventUserData
*)info.data;
return userData->data[0];
}
}
MusicEventIteratorHasNextEvent(iter, &b);
MusicEventIteratorNextEvent(iter);
}
return 0;
DisposeMusicEventIterator(iter);
}
I get junk. What am I doing wrong? The iterator is not even return in
the test for if(info.type == kMusicEventType_User).
Craig Bakalian
www.eThinkingCap.com
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.