Index: trunk/Cocoa/Pester/Source/PSMovieAlertController.h
===================================================================
--- trunk/Cocoa/Pester/Source/PSMovieAlertController.h	(revision 568)
+++ trunk/Cocoa/Pester/Source/PSMovieAlertController.h	(revision 569)
@@ -17,5 +17,4 @@
     PSMovieAlert *alert;
     IBOutlet QTMovieView *movieView;
-    void *theMovie; /* Movie */
     unsigned short repetitions;
     unsigned short repetitionsRemaining;
Index: trunk/Cocoa/Pester/Source/PSMovieAlertController.m
===================================================================
--- trunk/Cocoa/Pester/Source/PSMovieAlertController.m	(revision 568)
+++ trunk/Cocoa/Pester/Source/PSMovieAlertController.m	(revision 569)
@@ -12,5 +12,4 @@
 #import "QTMovie-NJRExtensions.h"
 #import "NJRSoundManager.h"
-#import <QuickTime/Movies.h>
 
 @implementation PSMovieAlertController
@@ -28,20 +27,33 @@
 }
 
+- (void)_movieRateDidChange:(NSNotification *)notification;
+{
+    float newRate = [[[notification userInfo] objectForKey: QTMovieRateDidChangeNotificationParameter]
+		     floatValue];
+    if (newRate != 0)
+	return;
+    
+    if (repetitions == 0 || repetitionsRemaining == 0) {
+	[[NSNotificationCenter defaultCenter] removeObserver: self
+							name: QTMovieRateDidChangeNotification
+						      object: [movieView movie]];
+    
+	[self close];
+	return;
+    }
+    repetitionsRemaining--;
+    [movieView gotoBeginning: self];
+    [movieView play: self];
+}
+
 - (void)play;
 {
-    NSTimeInterval delay;
-    if (repetitions == 0) return;
-    if (IsMovieDone((Movie)theMovie) || repetitionsRemaining == repetitions) {
-        if (repetitionsRemaining == 0) {
-            [self close];
-            return;
-        }
-        repetitionsRemaining--;
-        [movieView gotoBeginning: self];
-        [movieView play: self];
-    }
-    delay = (GetMovieDuration((Movie)theMovie) - GetMovieTime((Movie)theMovie, NULL)) / (double)GetMovieTimeScale((Movie)theMovie);
-    // XXX should use a timebase callback for this instead (see NJRQTMediaPopUpButton); also, use QuickTimeÕs built-in loop functionality instead of rolling our own?
-    [self performSelector: @selector(play) withObject: nil afterDelay: delay inModes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
+    repetitionsRemaining = repetitions - 1;
+
+    [[NSNotificationCenter defaultCenter] addObserver: self
+					     selector: @selector(_movieRateDidChange:)
+						 name: QTMovieRateDidChangeNotification
+					       object: [movieView movie]];
+    [movieView play: self];
 }
 
@@ -53,5 +65,4 @@
         alarm = anAlarm;
         alert = anAlert;
-        theMovie = [movie quickTimeMovie];
         [movieView setMovie: movie];
         if ([alert hasVideo]) {
@@ -89,5 +100,4 @@
         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(close) name: PSAlarmAlertStopNotification object: nil];
         repetitions = [alert repetitions];
-        repetitionsRemaining = repetitions;
         if ([movie NJR_hasAudio] && [NJRSoundManager volumeIsNotMutedOrInvalid: [alert outputVolume]] && [NJRSoundManager saveDefaultOutputVolume]) {
             [NJRSoundManager setDefaultOutputVolume: [alert outputVolume]];
Index: trunk/Cocoa/Pester/Source/Pester.xcodeproj/project.pbxproj
===================================================================
--- trunk/Cocoa/Pester/Source/Pester.xcodeproj/project.pbxproj	(revision 568)
+++ trunk/Cocoa/Pester/Source/Pester.xcodeproj/project.pbxproj	(revision 569)
@@ -105,5 +105,4 @@
 		E1B11F7F0CF5F30F004975AA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
 		E1B11F800CF5F30F004975AA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5F240D0036A87E301FE7503 /* Carbon.framework */; };
-		E1B11F820CF5F30F004975AA /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F59E4BEA036B33EC016B311C /* QuickTime.framework */; };
 		E1B11F830CF5F30F004975AA /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E14DB31203B8038300000028 /* IOKit.framework */; };
 		E1B11F840CF5F30F004975AA /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E18DAAEE0442D02500050002 /* CoreAudio.framework */; };
@@ -302,5 +301,4 @@
 		F59E4BE6036B2E5E016B311C /* PSScriptAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSScriptAlert.m; sourceTree = "<group>"; };
 		F59E4BE7036B2E5E016B311C /* PSScriptAlert.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PSScriptAlert.h; sourceTree = "<group>"; };
-		F59E4BEA036B33EC016B311C /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
 		F59E4C0D036B43D2016B311C /* QTMovie-NJRExtensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "QTMovie-NJRExtensions.m"; sourceTree = "<group>"; };
 		F59E4C0E036B43D2016B311C /* QTMovie-NJRExtensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "QTMovie-NJRExtensions.h"; sourceTree = "<group>"; };
@@ -353,5 +351,4 @@
 				E1B11F7F0CF5F30F004975AA /* Cocoa.framework in Frameworks */,
 				E1B11F800CF5F30F004975AA /* Carbon.framework in Frameworks */,
-				E1B11F820CF5F30F004975AA /* QuickTime.framework in Frameworks */,
 				E1B11F830CF5F30F004975AA /* IOKit.framework in Frameworks */,
 				E1B11F840CF5F30F004975AA /* CoreAudio.framework in Frameworks */,
@@ -387,5 +384,4 @@
 				E18DAAEE0442D02500050002 /* CoreAudio.framework */,
 				E1B121B30CF639A1004975AA /* QTKit.framework */,
-				F59E4BEA036B33EC016B311C /* QuickTime.framework */,
 				E14DB31203B8038300000028 /* IOKit.framework */,
 			);
