MusicEventIteratorSetEventTime
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.