• 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
MusicEventIteratorSetEventTime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MusicEventIteratorSetEventTime


  • Subject: MusicEventIteratorSetEventTime
  • From: Craig Bakalian <email@hidden>
  • Date: Wed, 12 Nov 2003 18:17:26 -0500

Hi,
I can't think of another way to edit a music events time stamp. The
below code is not working. How does one get a music event out of an
MusicEventIterator and set it to a new time?

-(void)moveEventsTime: (Float64)amount
{
MusicEventIterator iter;
NewMusicEventIterator([self musicTrack], &iter);
int i;
for(i=0; i< [selectedEvents count]; i++)
{
MidiEvent *me = [selectedEvents objectAtIndex: i];
MidiEventInfo mei = [me info];
MusicTimeStamp mts = mei.stamp;
MusicEventIteratorSeek(iter, mts);
MusicEventIteratorSetEventTime(iter, mts + amount);
MidiEventInfo info;
MusicEventIteratorGetEventInfo(iter, &info.stamp, &info.type,
(const void **) &info.data, &info.size);
}
for(i=0; i<[selectedStrokeNotes count]; i++)
{
MidiNoteStroke *mns = [selectedStrokeNotes objectAtIndex: i];
NSPoint startPoint = NSMakePoint([mns on].x + (amount * 100),
[mns on].y);
NSPoint endPoint = NSMakePoint([mns off].x + (amount * 100),
[mns off].y);
[mns setTimeStamp : [mns timeStamp] + amount];
[mns setOffTimeStamp: [mns offTimeStamp] + amount];
[mns setOn: startPoint];
[mns setOff: endPoint];
}
}

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: MusicEventIteratorSetEventTime
      • From: Art Gillespie <email@hidden>
  • Prev by Date: Re: IO Test sample code
  • Next by Date: Re: in-memory AudioUnit?
  • Previous by thread: Re: Output Audio Devices
  • Next by thread: Re: MusicEventIteratorSetEventTime
  • Index(es):
    • Date
    • Thread