• 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
Re: Proper use of MIDIPacketListAdd
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper use of MIDIPacketListAdd


  • Subject: Re: Proper use of MIDIPacketListAdd
  • From: Douglas Scott <email@hidden>
  • Date: Thu, 11 Apr 2013 09:57:55 -0700

Here is the logic used by the code, stripped down:

if (curPacket->length == 0) {
curPacket->timeStamp = time;
// try to start new packet
} else if (time == curPacket->timeStamp && data[0] >= 0x80 && data[0] < 0xF0
           && curPacket->data[0] >= 0x80 && curPacket->data[0] < 0xF0) {
// try to add to this packet
} else {
// need to add new packet
}

I don't have time to figure out what the else if() case is checking for right now, but 'data' is your passed-in data, and 'time' and 'curPacket' are also passed in args.
In the whichever case is used from above, the passed-in time is later assigned to the packet's timestamp, so subsequent calls to this with the same packet will have
non-zero timestamps.  Does your data match the second case above?

-DS

On Apr 10, 2013, at 7:14 PM, Pier <email@hidden> wrote:

Hi Douglas, 

Thanks for the reply. 
I'm doing this :


- (void) addPacketToPacketList:(Byte*) data ofLength:(int) len {
    
    NSLog(@"%lld", mach_absolute_time());
    currentPacket = MIDIPacketListAdd(packetList, PACKETLIST_SIZE, currentPacket, mach_absolute_time, len, data);

    if (!currentPacket) exit(1);

}
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
References: 
 >Re: Coreaudio-api Digest, Vol 10, Issue 120 (From: Pier <email@hidden>)

  • Prev by Date: AUGraph and understanding channels
  • Next by Date: Re: Internal Speaker stop work when i plug out the Headphones from audio jack
  • Previous by thread: Re: Coreaudio-api Digest, Vol 10, Issue 120
  • Next by thread: PCM data convesion from byte to short
  • Index(es):
    • Date
    • Thread