Changeset 543 for trunk/Cocoa/Pester/Source/PSMovieAlertController.m
- Timestamp:
- 06/15/09 06:16:52 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cocoa/Pester/Source/PSMovieAlertController.m
r133 r543 10 10 #import "PSMovieAlertController.h" 11 11 #import "PSMovieAlert.h" 12 #import " NSMovie-NJRExtensions.h"12 #import "QTMovie-NJRExtensions.h" 13 13 #import "NJRSoundManager.h" 14 14 #import <QuickTime/Movies.h> … … 38 38 repetitionsRemaining--; 39 39 [movieView gotoBeginning: self]; 40 [movieView start: self];40 [movieView play: self]; 41 41 } 42 42 delay = (GetMovieDuration((Movie)theMovie) - GetMovieTime((Movie)theMovie, NULL)) / (double)GetMovieTimeScale((Movie)theMovie); … … 48 48 { 49 49 if ([self initWithWindowNibName: @"Movie alert"]) { 50 NSMovie *movie = [anAlert movie];50 QTMovie *movie = [anAlert movie]; 51 51 NSWindow *window = [self window]; // connect outlets 52 52 alarm = anAlarm; 53 53 alert = anAlert; 54 theMovie = [movie quickTimeMovie]; 54 55 [movieView setMovie: movie]; 55 theMovie = [movie QTMovie];56 56 if ([alert hasVideo]) { 57 57 NSRect screenRect = [[window screen] visibleFrame]; 58 float magnification = 1.0; 59 NSSize movieSize; 58 NSSize movieSize = [[movie attributeForKey: QTMovieNaturalSizeAttribute] sizeValue]; 60 59 NSSize minSize = [window minSize]; 61 60 float windowFrameHeight = [window frame].size.height - [[window contentView] frame].size.height; … … 63 62 screenRect.size.height -= windowFrameHeight; 64 63 minSize.height -= windowFrameHeight; 65 while (1) { 66 movieSize = [movieView sizeForMagnification: magnification]; 67 movieSize.height -= 16; // controller is hidden, but its size is included (documented, ergh) 68 if (movieSize.width > screenRect.size.width || movieSize.height > screenRect.size.height) 69 magnification /= 2; 70 else 71 break; 64 while (movieSize.width > screenRect.size.width || movieSize.height > screenRect.size.height) { 65 movieSize.width /= 2; 66 movieSize.height /= 2; 72 67 } 73 68 if (movieSize.width < minSize.width) movieSize.width = minSize.width; … … 94 89 repetitions = [alert repetitions]; 95 90 repetitionsRemaining = repetitions; 96 if ([movie hasAudio] && [NJRSoundManager volumeIsNotMutedOrInvalid: [alert outputVolume]] && [NJRSoundManager saveDefaultOutputVolume]) {91 if ([movie NJR_hasAudio] && [NJRSoundManager volumeIsNotMutedOrInvalid: [alert outputVolume]] && [NJRSoundManager saveDefaultOutputVolume]) { 97 92 [NJRSoundManager setDefaultOutputVolume: [alert outputVolume]]; 98 93 } 99 if (![movie isStatic]) [self play]; // if it's an image, don't close the window automatically94 if (![movie NJR_isStatic]) [self play]; // if it's an image, don't close the window automatically 100 95 } 101 96 return self; … … 115 110 { 116 111 repetitions = 0; 117 [movieView stop: self];112 [movieView pause: self]; 118 113 [alert completedForAlarm: alarm]; 119 114 [self autorelease];
Note:
See TracChangeset
for help on using the changeset viewer.