Smooth callbacks

This commit is contained in:
Matthias Neeracher 2008-07-05 13:56:12 +00:00
parent 80d43bc102
commit f31c878e9b

View File

@ -28,7 +28,7 @@
} }
- (VLPlaybackEditable *)initWithView:(VLSheetView *)view; - (VLPlaybackEditable *)initWithView:(VLSheetView *)view;
- (void) userEvent:(VLMIDIUserEvent *)event; - (void) userEvent:(NSValue *)event;
- (void) highlightCursor; - (void) highlightCursor;
@end @end
@ -45,8 +45,9 @@
return self; return self;
} }
- (void) userEvent:(VLMIDIUserEvent *)event - (void) userEvent:(NSValue *)ev
{ {
VLMIDIUserEvent * event = (VLMIDIUserEvent *)[ev pointerValue];
if (event->fPitch) { if (event->fPitch) {
fNotePitch = event->fPitch; fNotePitch = event->fPitch;
fNoteMeasure = event->fMeasure; fNoteMeasure = event->fMeasure;
@ -96,7 +97,9 @@ VLSequenceCallback(
MusicTimeStamp inEventTime, const MusicEventUserData *inEventData, MusicTimeStamp inEventTime, const MusicEventUserData *inEventData,
MusicTimeStamp inStartSliceBeat, MusicTimeStamp inEndSliceBeat) MusicTimeStamp inStartSliceBeat, MusicTimeStamp inEndSliceBeat)
{ {
[(id)inClientData userEvent:(VLMIDIUserEvent *)inEventData]; [(id)inClientData performSelectorOnMainThread:@selector(userEvent:)
withObject:[NSValue valueWithPointer:inEventData]
waitUntilDone:NO];
} }
@implementation VLSheetView (Selection) @implementation VLSheetView (Selection)