Re: MusicEventIteratorSetEventTime
Re: MusicEventIteratorSetEventTime
- Subject: Re: MusicEventIteratorSetEventTime
- From: Art Gillespie <email@hidden>
- Date: Wed, 12 Nov 2003 19:57:01 -0500
- Mail-followup-to: email@hidden
On Wed, Nov 12, 2003 at 06:17:26PM -0500, Craig Bakalian wrote:
>
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?
NewMusicEventIterator/MusicEventIteratorSeek/MusicEventIteratorSetEventTime
works as expected here.
In reading your code, I assume you didn't want to update the
MidiEventInfo's that you're getting from the selectedEvents collection
with the new value returned by MusicEventIteratorGetEventInfo?
>
>
-(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];
>
}
>
}
_______________________________________________
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.