私は少し壁に当たって本当に助けに感謝します。NSSliderのmouseDownイベント
QTMovieのジョグ速度を制御するために使用しているNSSliderがあります。
スライダの値に応じて、ビデオの再生レートを再生したい。これは簡単です。
問題は、ユーザーのイベント「mouseUp」が完了したときにNSSliderを「0」にリセットすることです。 私はこのイベントを動作させることができないので、NSSliderをサブクラス化し、mousedown & mouseupメソッドを実装し、NSSliderサブクラスに代理人を追加し、それをアプリケーションのコントローラに接続しました。
これはうまく機能しますが、スライダーに大量の遅延がありますが、それはうまくスライドしますが、ビデオレートは変更されず、私は 'mouseUp'のときだけです.-基本的にmouseDownはMouseUp。
私はそれが意味をなさないことを望みます。
うまくいけば、そこに誰かが私を助けることができ、
乾杯、
アダム
enter code here
私NSSliderサブクラス.mファイル:
@implementation TimeScrubberSlider
@synthesize delegate;
- (void)mouseDown:(NSEvent *)theEvent {
// dispatch_queue_t myQueue = dispatch_queue_create("com.mycompany.myqueue", 0);
// dispatch_async(myQueue, ^{
NSLog(@"mouseDown");
[super mouseDown:theEvent];
if ([delegate respondsToSelector: @selector(doScrubTime:)])
{
[delegate doScrubTime:nil];
}
[super mouseDown:theEvent];
//);
// dispatch_release(myQueue);
}
- (void) mouseUp: (NSEvent*) theEvent
{
NSLog(@"mouseUp TimeScrubber");
[super mouseUp:theEvent];
[self setDoubleValue:0];
if ([delegate respondsToSelector: @selector(doScrubTime:)])
{
[delegate doScrubTime:nil];
}
[super mouseUp:theEvent];
}