• 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
MusicEventIteratorGetEventInfo void **outEventData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MusicEventIteratorGetEventInfo void **outEventData


  • Subject: MusicEventIteratorGetEventInfo void **outEventData
  • From: Craig Bakalian <email@hidden>
  • Date: Tue, 4 Nov 2003 15:27:26 -0500

Hi,
I am actually making a midi sequencer in objective C and Cocoa! There
is a problem, how does one get the data out of the pointer to a point
in the MusicEventIteratorGetEventInfo. Here is my objective C code. I
need to get at the data of the MidiEventInfo structure which is wrapped
in an objective C object called MidiEvent. I don't know how to
dereference the pointer to the pointer. I can access the info.stamp
and info.type and info.size.


#import <Foundation/Foundation.h>
#import <CoreMIDI/MIDIServices.h>
#import <AudioToolbox/AudioToolbox.h>

typedef struct
{
MusicTimeStamp stamp;
MusicEventType type;
UInt32 size;
void* data;
} MidiEventInfo;

@interface MidiEvent : NSObject
{
MidiEventInfo info;
}
-(id)initWithMidiEvent: (MidiEventInfo)val;
-(MidiEventInfo)info;

@end

-(NSArray *)getMidiEventsForTrack: (MusicTrack) track
{
MusicEventIterator events;
NewMusicEventIterator(track, &events);
Boolean b;
NSMutableArray *eventArray = [NSMutableArray array];
MusicEventIteratorHasNextEvent(events, &b);
while(b)
{
MidiEventInfo info;
MusicEventIteratorGetEventInfo(events, &info.stamp, &info.type,
(const void **) &info.data, &info.size);
MidiEvent *me = [[[MidiEvent alloc] initWithMidiEvent: info]
autorelease];
[eventArray addObject: me];
MusicEventIteratorHasNextEvent(events, &b);
MusicEventIteratorNextEvent(events);
}
return eventArray;
}
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.

  • Follow-Ups:
    • Re: MusicEventIteratorGetEventInfo void **outEventData
      • From: Philippe Wicker <email@hidden>
  • Prev by Date: Re: AU latency compensation "look-ahead"
  • Next by Date: HAL, AU or streams?
  • Previous by thread: Re: AU latency compensation "look-ahead"
  • Next by thread: Re: MusicEventIteratorGetEventInfo void **outEventData
  • Index(es):
    • Date
    • Thread