source: releases/Pester/1.1a2/Source/PSMovieAlert.m@ 632

Last change on this file since 632 was 45, checked in by Nicholas Riley, 22 years ago

Pester 1.1a2.

English.lproj/Credits.html: Fixed some HTML formatting issues, added Ben Hines to credits (thanks for helping out with 1.1a1 testing!)

English.lproj/InfoPlist.strings: Updated for 1.1a2.

English.lproj/MainMenu.nib: Reconnected initialFirstResponder outlet on the window; somehow it became disconnected. Fixed keyboard navigation loop. Removed formatters from date/time fields which were causing crashes on launch on 10.2 (they're instantiated from code in any case). Removed text from date field because it didn't work without the formatter.

NJRDateFormatter: Workaround for 10.2 NSScanner bug [Ben Hines].

NJRQTMediaPopUpButton: Remove corrupt JPEG note, can no longer reproduce. Removed -validateRecentMedia invocation, debug code shouldn't have been left in.

PSAlarmSetController: Set alerts before setting alarm, otherwise alarm in bogus state remains. Set date to today in awakeFromNib, moved from the nib. Disconnect initial first responder to work around 10.1 bug so keyboard focus is set properly when the window opens.

Pester.pbproj: Added VERSION.

Read Me.rtfd: Updated for 1.1a2.

VERSION: Updated for 1.1a2.

File size: 1.6 KB
Line 
1//
2// PSMovieAlert.m
3// Pester
4//
5// Created by Nicholas Riley on Sat Oct 26 2002.
6// Copyright (c) 2002 Nicholas Riley. All rights reserved.
7//
8
9#import <QuickTime/Movies.h>
10#import "PSMovieAlert.h"
11#import "PSMovieAlertController.h"
12#import "NSMovie-NJRExtensions.h"
13
14@implementation PSMovieAlert
15
16+ (PSMovieAlert *)alertWithMovieFileAlias:(BDAlias *)anAlias repetitions:(unsigned short)numReps;
17{
18 return [[[self alloc] initWithAlias: anAlias repetitions: numReps] autorelease];
19}
20
21- (id)initWithAlias:(BDAlias *)anAlias repetitions:(unsigned int) numReps;
22{
23 if ( (self = [super init]) != nil) {
24 alias = [anAlias retain];
25 repetitions = numReps;
26 movie = [[NSMovie alloc] initWithURL: [NSURL fileURLWithPath: [anAlias fullPath]] byReference: YES];
27 if (movie == nil) {
28 [self release];
29 self = nil;
30 } else {
31 hasAudio = [movie hasAudio];
32 hasVideo = [movie hasVideo];
33
34 if (!hasAudio && !hasVideo) {
35 [self release]; self = nil;
36 }
37 }
38 }
39
40 return self;
41}
42
43- (BOOL)hasVideo;
44{
45 return hasVideo;
46}
47
48- (NSMovie *)movie;
49{
50 return movie;
51}
52
53- (unsigned short)repetitions;
54{
55 return repetitions;
56}
57
58- (void)dealloc;
59{
60 [alias release];
61 [movie release];
62 [super dealloc];
63}
64
65- (NSString *)description;
66{
67 return [NSString stringWithFormat: @"PSMovieAlert (%@%@): %@, repeats %hu times", hasAudio ? @"A" : @"", hasVideo ? @"V" : @"", [alias fullPath], repetitions];
68}
69
70- (void)triggerForAlarm:(PSAlarm *)alarm;
71{
72 [PSMovieAlertController controllerWithAlarm: alarm movieAlert: self];
73}
74
75@end
Note: See TracBrowser for help on using the repository browser.