Changeset 541 for trunk/Cocoa


Ignore:
Timestamp:
06/15/09 06:16:28 (16 years ago)
Author:
Nicholas Riley
Message:

Finish migrating NJRQTMediaPopUpButton to QTKit. The alert still needs to be migrated.

Location:
trunk/Cocoa/Pester/Source
Files:
2 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/Pester/Source/NJRQTMediaPopUpButton.m

    r537 r541  
    99#import "NJRQTMediaPopUpButton.h"
    1010#import "NJRSoundManager.h"
    11 #import "NSMovie-NJRExtensions.h"
     11#import "QTMovie-NJRExtensions.h"
    1212#import "NSMenuItem-NJRExtensions.h"
    13 
    14 #import <QTKit/QTKit.h>
    1513
    1614#include <limits.h>
     
    372370        }
    373371    } else {
    374         NSMovie *movie = [[NSMovie alloc] initWithURL: [NSURL fileURLWithPath: [selectedAlias fullPath]] byReference: YES];
    375         movieCanRepeat = ![movie isStatic];
    376         if (movieHasAudio = [movie hasAudio]) {
    377             [preview setMovie: doPreview ? [QTMovie movieWithURL: [NSURL fileURLWithPath: [selectedAlias fullPath]] error: NULL] : nil]; // XXX handle errors; fix
     372        NSError *error;
     373        QTMovie *movie = [[QTMovie alloc] initWithFile: [selectedAlias fullPath] error: &error];
     374        movieCanRepeat = ![movie NJR_isStatic];
     375        if (movieHasAudio = [movie NJR_hasAudio]) {
     376            [preview setMovie: doPreview ? movie : nil];
    378377        } else {
    379378            [self _resetPreview];
    380379            doPreview = NO;
    381380            if (movie == nil) {
    382                 NSBeginAlertSheet(@"Format not recognized", nil, nil, nil, [self window], nil, nil, nil, nil, NSLocalizedString(@"The item you selected isn't a sound or movie recognized by QuickTime.  Please select a different item.", "Message displayed in alert sheet when media document is not recognized by QuickTime"));
     381                NSBeginAlertSheet(@"Format not recognized", nil, nil, nil, [self window], nil, nil, nil, nil, [NSString stringWithFormat: NSLocalizedString(@"The item you selected isn't an image, sound or movie recognized by QuickTime. (%@)\n\nPlease select a different item.", "Message displayed in alert sheet when media document is not recognized by QuickTime"), [error localizedDescription]]);
    383382                [self _invalidateSelection];
    384383                return NO;
    385384            }
    386             if (![movie hasAudio] && ![movie hasVideo]) {
    387                 NSBeginAlertSheet(@"No video or audio", nil, nil, nil, [self window], nil, nil, nil, nil, NSLocalizedString(@"'%@' contains neither audio nor video content playable by QuickTime.  Please select a different item.", "Message displayed in alert sheet when media document is readable, but has neither audio nor video tracks"), [[NSFileManager defaultManager] displayNameAtPath: [selectedAlias fullPath]]);
     385            if (![movie NJR_hasAudio] && ![movie NJR_hasVideo]) {
     386                NSBeginAlertSheet(@"No video or audio", nil, nil, nil, [self window], nil, nil, nil, nil, NSLocalizedString(@"'%@' contains neither audio nor video content playable by QuickTime.\n\nPlease select a different item.", "Message displayed in alert sheet when media document is readable, but has neither audio nor video tracks"), [[NSFileManager defaultManager] displayNameAtPath: [selectedAlias fullPath]]);
    388387                [self _invalidateSelection];
    389388                [movie release];
  • trunk/Cocoa/Pester/Source/Pester.xcodeproj/project.pbxproj

    r532 r541  
    5959                E1B11F4D0CF5F30F004975AA /* NSCharacterSet-NJRExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = F5B79865038865B30136A8DD /* NSCharacterSet-NJRExtensions.m */; };
    6060                E1B11F4E0CF5F30F004975AA /* NSDictionary-NJRExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = F5EE8DB9038A76AC0134BEAC /* NSDictionary-NJRExtensions.m */; };
    61                 E1B11F500CF5F30F004975AA /* NSMovie-NJRExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = F59E4C0D036B43D2016B311C /* NSMovie-NJRExtensions.m */; };
     61                E1B11F500CF5F30F004975AA /* QTMovie-NJRExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = F59E4C0D036B43D2016B311C /* QTMovie-NJRExtensions.m */; };
    6262                E1B11F510CF5F30F004975AA /* NSString-NJRExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = E1F0B14F03ADBE3800AEFBE0 /* NSString-NJRExtensions.m */; };
    6363                E1B11F520CF5F30F004975AA /* NSTableView-NJRExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = E162698303B6189000000028 /* NSTableView-NJRExtensions.m */; };
     
    309309                F59E4BE7036B2E5E016B311C /* PSScriptAlert.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PSScriptAlert.h; sourceTree = "<group>"; };
    310310                F59E4BEA036B33EC016B311C /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
    311                 F59E4C0D036B43D2016B311C /* NSMovie-NJRExtensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "NSMovie-NJRExtensions.m"; sourceTree = "<group>"; };
    312                 F59E4C0E036B43D2016B311C /* NSMovie-NJRExtensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "NSMovie-NJRExtensions.h"; sourceTree = "<group>"; };
     311                F59E4C0D036B43D2016B311C /* QTMovie-NJRExtensions.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = "QTMovie-NJRExtensions.m"; sourceTree = "<group>"; };
     312                F59E4C0E036B43D2016B311C /* QTMovie-NJRExtensions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "QTMovie-NJRExtensions.h"; sourceTree = "<group>"; };
    313313                F59F6CB40354E7DA01AEEDB1 /* PSAlarm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PSAlarm.h; sourceTree = "<group>"; };
    314314                F59F6CB50354E7DA01AEEDB1 /* PSAlarm.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PSAlarm.m; sourceTree = "<group>"; };
     
    491491                                E1B1219C0CF63858004975AA /* NSImage-NJRExtensions.m */,
    492492                                E1B1219D0CF63858004975AA /* NSImage-NJRExtensions.h */,
    493                                 F59E4C0E036B43D2016B311C /* NSMovie-NJRExtensions.h */,
    494                                 F59E4C0D036B43D2016B311C /* NSMovie-NJRExtensions.m */,
     493                                F59E4C0E036B43D2016B311C /* QTMovie-NJRExtensions.h */,
     494                                F59E4C0D036B43D2016B311C /* QTMovie-NJRExtensions.m */,
    495495                                E1F0B14E03ADBE3800AEFBE0 /* NSString-NJRExtensions.h */,
    496496                                E1F0B14F03ADBE3800AEFBE0 /* NSString-NJRExtensions.m */,
     
    869869                                E1B11F4D0CF5F30F004975AA /* NSCharacterSet-NJRExtensions.m in Sources */,
    870870                                E1B11F4E0CF5F30F004975AA /* NSDictionary-NJRExtensions.m in Sources */,
    871                                 E1B11F500CF5F30F004975AA /* NSMovie-NJRExtensions.m in Sources */,
     871                                E1B11F500CF5F30F004975AA /* QTMovie-NJRExtensions.m in Sources */,
    872872                                E1B11F510CF5F30F004975AA /* NSString-NJRExtensions.m in Sources */,
    873873                                E1B11F520CF5F30F004975AA /* NSTableView-NJRExtensions.m in Sources */,
Note: See TracChangeset for help on using the changeset viewer.