• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Adding UserEvent to Track
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: MusicDevicePrepareInstrument safety
  • Next by Date: unable to populate MusicTrack
  • Previous by thread: AIFF/AIFC current documentation?
  • Next by thread: unable to populate MusicTrack
  • Index(es):
    • Date
    • Thread