[Mod] 再生関連をXspfQTMovieViewControllerに委譲
[FIx] 日本語リソースが腐っていたので修正
@@ -100,8 +100,6 @@ | ||
100 | 100 | - (IBAction)nextTrack:(id)sender; |
101 | 101 | - (IBAction)previousTrack:(id)sender; |
102 | 102 | - (IBAction)gotoBeginningOrPreviousTrack:(id)sender; |
103 | -- (IBAction)gotoBeginning:(id)sender; | |
104 | -- (IBAction)gotoEnd:(id)sender; | |
105 | 103 | - (IBAction)normalSize:(id)sender; |
106 | 104 | - (IBAction)halfSize:(id)sender; |
107 | 105 | - (IBAction)doubleSize:(id)sender; |
@@ -109,8 +107,6 @@ | ||
109 | 107 | |
110 | 108 | - (IBAction)gotoThumbnailFrame:(id)sender; |
111 | 109 | |
112 | -- (void)play; | |
113 | -- (void)stop; | |
114 | 110 | @end |
115 | 111 | |
116 | 112 | extern NSString *XspfQTMovieDidStartNotification; |
@@ -14,6 +14,10 @@ | ||
14 | 14 | |
15 | 15 | @property (readonly) QTMovieView *movieView; |
16 | 16 | |
17 | +- (void)play; | |
18 | +- (void)pause; | |
19 | +- (void)stop; | |
20 | + | |
17 | 21 | - (IBAction)play:(id)sender; |
18 | 22 | - (IBAction)pause:(id)sender; |
19 | 23 |
@@ -157,15 +157,15 @@ | ||
157 | 157 | { |
158 | 158 | _movieViewController = [[XspfQTMovieViewController alloc] init]; |
159 | 159 | NSView *contentView = [movieViewPlaceholder superview]; |
160 | - NSView *movieView = [self.movieViewController view]; | |
161 | - [movieView setFrame:[movieViewPlaceholder frame]]; | |
162 | - [contentView replaceSubview:movieViewPlaceholder with:movieView]; | |
163 | - movieViewPlaceholder = movieView; | |
164 | - [movieViewPlaceholder bind:@"movie" | |
165 | - toObject:self | |
166 | - withKeyPath:@"qtMovie" | |
167 | - options:nil]; | |
160 | + [self.movieViewController.movieView setFrame:[movieViewPlaceholder frame]]; | |
161 | + [contentView replaceSubview:movieViewPlaceholder with:self.movieViewController.movieView]; | |
162 | + [self.movieViewController.movieView bind:@"movie" | |
163 | + toObject:self | |
164 | + withKeyPath:@"qtMovie" | |
165 | + options:nil]; | |
166 | + [self setNextResponder:self.movieViewController]; | |
168 | 167 | |
168 | + | |
169 | 169 | prevMouseMovedDate = [[NSDate dateWithTimeIntervalSinceNow:0.0] retain]; |
170 | 170 | [[self window] setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; |
171 | 171 |
@@ -188,7 +188,7 @@ | ||
188 | 188 | |
189 | 189 | doc.trackList.selectionIndex = 0; |
190 | 190 | [self sizeTofitWidnow]; |
191 | - [self play]; | |
191 | + [self.movieViewController play]; | |
192 | 192 | } |
193 | 193 | |
194 | 194 | - (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName |
@@ -261,7 +261,7 @@ | ||
261 | 261 | |
262 | 262 | [self synchronizeWindowTitleWithDocumentName]; |
263 | 263 | [self sizeTofitWidnow]; |
264 | - [self play]; | |
264 | + [self.movieViewController play]; | |
265 | 265 | } |
266 | 266 | - (QTMovie *)qtMovie |
267 | 267 | { |
@@ -366,18 +366,6 @@ | ||
366 | 366 | NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; |
367 | 367 | [nc postNotificationName:XspfQTMovieDidPauseNotification object:self]; |
368 | 368 | } |
369 | -- (void)play | |
370 | -{ | |
371 | - [self.movieViewController performSelectorOnMainThread:@selector(play:) withObject:self waitUntilDone:NO]; | |
372 | -} | |
373 | -- (void)pause | |
374 | -{ | |
375 | - [self.movieViewController performSelectorOnMainThread:@selector(pause:) withObject:self waitUntilDone:NO]; | |
376 | -} | |
377 | -- (void)stop | |
378 | -{ | |
379 | - [self.movieViewController performSelectorOnMainThread:@selector(pause:) withObject:self waitUntilDone:YES]; | |
380 | -} | |
381 | 369 | - (void)enterFullScreen |
382 | 370 | { |
383 | 371 | NSWindow *fullscreen = [self fullscreenWindow]; |
@@ -505,20 +493,11 @@ | ||
505 | 493 | - (IBAction)togglePlayAndPause:(id)sender |
506 | 494 | { |
507 | 495 | if([[self valueForKeyPath:@"document.trackList.isPlayed"] boolValue]) { |
508 | - [self pause]; | |
496 | + [self.movieViewController pause]; | |
509 | 497 | } else { |
510 | - [self play]; | |
498 | + [self.movieViewController play]; | |
511 | 499 | } |
512 | 500 | } |
513 | -- (IBAction)gotoBeginning:(id)sender | |
514 | -{ | |
515 | - [self.movieViewController gotoBeginning:sender]; | |
516 | -} | |
517 | -- (IBAction)gotoEnd:(id)sender | |
518 | -{ | |
519 | - [self.movieViewController gotoEnd:sender]; | |
520 | -} | |
521 | - | |
522 | 501 | - (IBAction)turnUpVolume:(id)sender |
523 | 502 | { |
524 | 503 | NSNumber *cv = [self valueForKeyPath:kVolumeKeyPath]; |
@@ -596,7 +575,7 @@ | ||
596 | 575 | if(!QTGetTimeInterval(duration, &dur)) return; |
597 | 576 | |
598 | 577 | if(cur > (dur * 0.01)) { |
599 | - [self gotoBeginning:sender]; | |
578 | + [self.movieViewController gotoBeginning:sender]; | |
600 | 579 | } else { |
601 | 580 | [self previousTrack:sender]; |
602 | 581 | } |
@@ -27,6 +27,20 @@ | ||
27 | 27 | return (QTMovieView *)[self view]; |
28 | 28 | } |
29 | 29 | |
30 | + | |
31 | +- (void)play | |
32 | +{ | |
33 | + [self performSelectorOnMainThread:@selector(play:) withObject:self waitUntilDone:NO]; | |
34 | +} | |
35 | +- (void)pause | |
36 | +{ | |
37 | + [self performSelectorOnMainThread:@selector(pause:) withObject:self waitUntilDone:NO]; | |
38 | +} | |
39 | +- (void)stop | |
40 | +{ | |
41 | + [self performSelectorOnMainThread:@selector(pause:) withObject:self waitUntilDone:YES]; | |
42 | +} | |
43 | + | |
30 | 44 | - (IBAction)play:(id)sender |
31 | 45 | { |
32 | 46 | [self.movieView play:sender]; |