Changeset 569


Ignore:
Timestamp:
07/20/09 06:03:15 (10 years ago)
Author:
Nicholas Riley
Message:

Remove last bits of QuickTime? usage.

Location:
trunk/Cocoa/Pester
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/PSMovieAlertController.h

    r554 r569  
    1717    PSMovieAlert *alert;
    1818    IBOutlet QTMovieView *movieView;
    19     void *theMovie; /* Movie */
    2019    unsigned short repetitions;
    2120    unsigned short repetitionsRemaining;
  • trunk/Cocoa/Pester/Source/PSMovieAlertController.m

    r554 r569  
    1212#import "QTMovie-NJRExtensions.h"
    1313#import "NJRSoundManager.h"
    14 #import <QuickTime/Movies.h>
    1514
    1615@implementation PSMovieAlertController
     
    2827}
    2928
     29- (void)_movieRateDidChange:(NSNotification *)notification;
     30{
     31    float newRate = [[[notification userInfo] objectForKey: QTMovieRateDidChangeNotificationParameter]
     32                     floatValue];
     33    if (newRate != 0)
     34        return;
     35   
     36    if (repetitions == 0 || repetitionsRemaining == 0) {
     37        [[NSNotificationCenter defaultCenter] removeObserver: self
     38                                                        name: QTMovieRateDidChangeNotification
     39                                                      object: [movieView movie]];
     40   
     41        [self close];
     42        return;
     43    }
     44    repetitionsRemaining--;
     45    [movieView gotoBeginning: self];
     46    [movieView play: self];
     47}
     48
    3049- (void)play;
    3150{
    32     NSTimeInterval delay;
    33     if (repetitions == 0) return;
    34     if (IsMovieDone((Movie)theMovie) || repetitionsRemaining == repetitions) {
    35         if (repetitionsRemaining == 0) {
    36             [self close];
    37             return;
    38         }
    39         repetitionsRemaining--;
    40         [movieView gotoBeginning: self];
    41         [movieView play: self];
    42     }
    43     delay = (GetMovieDuration((Movie)theMovie) - GetMovieTime((Movie)theMovie, NULL)) / (double)GetMovieTimeScale((Movie)theMovie);
    44     // XXX should use a timebase callback for this instead (see NJRQTMediaPopUpButton); also, use QuickTimeÕs built-in loop functionality instead of rolling our own?
    45     [self performSelector: @selector(play) withObject: nil afterDelay: delay inModes: [NSArray arrayWithObject: NSDefaultRunLoopMode]];
     51    repetitionsRemaining = repetitions - 1;
     52
     53    [[NSNotificationCenter defaultCenter] addObserver: self
     54                                             selector: @selector(_movieRateDidChange:)
     55                                                 name: QTMovieRateDidChangeNotification
     56                                               object: [movieView movie]];
     57    [movieView play: self];
    4658}
    4759
     
    5365        alarm = anAlarm;
    5466        alert = anAlert;
    55         theMovie = [movie quickTimeMovie];
    5667        [movieView setMovie: movie];
    5768        if ([alert hasVideo]) {
     
    89100        [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(close) name: PSAlarmAlertStopNotification object: nil];
    90101        repetitions = [alert repetitions];
    91         repetitionsRemaining = repetitions;
    92102        if ([movie NJR_hasAudio] && [NJRSoundManager volumeIsNotMutedOrInvalid: [alert outputVolume]] && [NJRSoundManager saveDefaultOutputVolume]) {
    93103            [NJRSoundManager setDefaultOutputVolume: [alert outputVolume]];
  • trunk/Cocoa/Pester/Source/Pester.xcodeproj/project.pbxproj

    r553 r569  
    105105                E1B11F7F0CF5F30F004975AA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
    106106                E1B11F800CF5F30F004975AA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5F240D0036A87E301FE7503 /* Carbon.framework */; };
    107                 E1B11F820CF5F30F004975AA /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F59E4BEA036B33EC016B311C /* QuickTime.framework */; };
    108107                E1B11F830CF5F30F004975AA /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E14DB31203B8038300000028 /* IOKit.framework */; };
    109108                E1B11F840CF5F30F004975AA /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E18DAAEE0442D02500050002 /* CoreAudio.framework */; };
     
    302301                F59E4BE6036B2E5E016B311C /* PSScriptAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSScriptAlert.m; sourceTree = "<group>"; };
    303302                F59E4BE7036B2E5E016B311C /* PSScriptAlert.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PSScriptAlert.h; sourceTree = "<group>"; };
    304                 F59E4BEA036B33EC016B311C /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
    305303                F59E4C0D036B43D2016B311C /* QTMovie-NJRExtensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "QTMovie-NJRExtensions.m"; sourceTree = "<group>"; };
    306304                F59E4C0E036B43D2016B311C /* QTMovie-NJRExtensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "QTMovie-NJRExtensions.h"; sourceTree = "<group>"; };
     
    353351                                E1B11F7F0CF5F30F004975AA /* Cocoa.framework in Frameworks */,
    354352                                E1B11F800CF5F30F004975AA /* Carbon.framework in Frameworks */,
    355                                 E1B11F820CF5F30F004975AA /* QuickTime.framework in Frameworks */,
    356353                                E1B11F830CF5F30F004975AA /* IOKit.framework in Frameworks */,
    357354                                E1B11F840CF5F30F004975AA /* CoreAudio.framework in Frameworks */,
     
    387384                                E18DAAEE0442D02500050002 /* CoreAudio.framework */,
    388385                                E1B121B30CF639A1004975AA /* QTKit.framework */,
    389                                 F59E4BEA036B33EC016B311C /* QuickTime.framework */,
    390386                                E14DB31203B8038300000028 /* IOKit.framework */,
    391387                        );
Note: See TracChangeset for help on using the changeset viewer.