• 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
Using the MusicEventUserData structure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using the MusicEventUserData structure


  • Subject: Using the MusicEventUserData structure
  • From: Brian Sheehan <email@hidden>
  • Date: Wed, 15 Feb 2006 18:05:46 +0000

Hi,

I am wondering how I should use user defined events in a sequence. It
all seems fairly straightforward, except I'm a little confused about
the MusicEventUserData structure:

typedef struct MusicEventUserData {
UInt32 length;
UInt8 data[1];
} MusicEventUserData;

How exactly should I use the "data" member of the above struct? It's
probably clearer if I give some psuedo code to put across how I
imagine things should/could work (I'm obviously missing something
along the way, please tell me where):

//First I define a struct representing some custom music event
typedef struct MyMusicEvent {
<some type> eventID;
<some other type> eventParam1;
<yet another type> eventParam2;
.......... and whatever other  members I need
} MyMusicEvent;

//Now I declare and initialize a MusicEventUserData structure

MusicEventUserData userData;

userData.length = sizeof(MyMusicEvent);
userData.data = (UInt8 *) malloc(userData.length);

//Now I'd like to do something like:

userData.data = (UInt8 *) &MyMusicEvent; ??? not sure will this work,
casting at arbitrary pointer type to a (UInt8 *)

Why is a UInt8 [] is being used for the "data" member? I would have
expected a void * to be used. I suppose my code above is wishful
thinking, but in what ways could I use the MyMusicEvent structure?

Thanks for all and any help,  I couldn't find anything on the lists
about the above - any pointers to code examples would be great.

Brian
 _______________________________________________
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

  • Follow-Ups:
    • Re: Using the MusicEventUserData structure
      • From: William Stewart <email@hidden>
  • Prev by Date: Looking for beta testers for ABL Pro AU
  • Next by Date: Re: Do any hosts support the "interesting" parts of the AU API?
  • Previous by thread: Looking for beta testers for ABL Pro AU
  • Next by thread: Re: Using the MusicEventUserData structure
  • Index(es):
    • Date
    • Thread