• 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 solved, I think?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MusicEventIteratorGetEventInfo solved, I think?


  • Subject: MusicEventIteratorGetEventInfo solved, I think?
  • From: Craig Bakalian <email@hidden>
  • Date: Tue, 4 Nov 2003 17:20:17 -0500

I did it, it was pointers to address that worked. And oddly the gcc
compiler complained about the dereferencing with warnings. Is there a
better way to unwrap the data? Well, anyway it does give the proper
midi note and velocity data. I prefer objective C over C.

-(id)tableView: (NSTableView *)tableView objectValueForTableColumn:
(NSTableColumn *)tableColumn row: (int)row
{
MusicTrack track = [[[[NSApp mainWindow] windowController]
document] getSelectedTrack];
NSArray *events = [[[[NSApp mainWindow] windowController]
document]getMidiEventsForTrack: track];
MidiEvent *me = [events objectAtIndex: row];

MidiEventInfo midiInfo = [me info];
MusicTimeStamp mts = midiInfo.stamp;
MusicEventType met = midiInfo.type;
UInt32 size = midiInfo.size;
int i;
void *data1 = midiInfo.data;
UInt8 *p,*q, *r;
r = &data1[0];
p = &data1[1];
q = &data1[2];

if([[tableColumn identifier] isEqualToString: @"time"])
{
return [NSNumber numberWithFloat: mts];
}
else if ([[tableColumn identifier] isEqualToString: @"type"])
{
return [NSNumber numberWithInt: *r];
}
else if ([[tableColumn identifier] isEqualToString: @"value"])
{
return [NSNumber numberWithInt: *p];
}
else if ([[tableColumn identifier] isEqualToString: @"velocity"])
{
return [NSNumber numberWithInt: *q];
}
return 0;
}
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: HAL, AU or streams?
  • Next by Date: Re: MusicEventIteratorGetEventInfo void **outEventData
  • Previous by thread: Re: HAL, AU or streams?
  • Next by thread: Setting buffer size?
  • Index(es):
    • Date
    • Thread