Changeset 693
- Timestamp:
- 12/03/08 15:03:43 (1 month ago)
- Files:
-
- trunk/SapphireFrappliance/Sapphire.xcodeproj/project.pbxproj (modified) (3 diffs)
- trunk/SapphireFrappliance/SapphireApplianceController.m (modified) (4 diffs)
- trunk/SapphireFrappliance/SapphireBrowser.m (modified) (4 diffs)
- trunk/SapphireFrappliance/SapphireImporterDataMenu.h (modified) (3 diffs)
- trunk/SapphireFrappliance/SapphireImporterDataMenu.m (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphireMarkMenu.m (modified) (4 diffs)
- trunk/SapphireFrappliance/SapphireMedia.h (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireMedia.m (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireMediaPreview.h (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireMovieChooser.h (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphireMovieChooser.m (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphireMovieImporter.h (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireMovieImporter.m (modified) (6 diffs)
- trunk/SapphireFrappliance/SapphirePosterChooser.h (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphirePosterChooser.m (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphireSettings.m (modified) (4 diffs)
- trunk/SapphireFrappliance/SapphireShowChooser.h (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphireShowChooser.m (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphireTVShowImporter.h (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphireTVShowImporter.m (modified) (6 diffs)
- trunk/SapphireFrappliance/SapphireVideoPlayer.h (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireVideoPlayer.m (modified) (4 diffs)
- trunk/SapphireFrappliance/SapphireVideoPlayerController.h (modified) (2 diffs)
- trunk/SapphireFrappliance/SapphireVideoPlayerController.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/SapphireFrappliance/Sapphire.xcodeproj/project.pbxproj
r680 r693 160 160 containerPortal = F51BFD2D0D26BDF300E22363 /* SapphireCompatibilityClasses.xcodeproj */; 161 161 proxyType = 2; 162 remoteGlobalIDString = F571B4B90E96F62C00B7FD9D /* SapphireTakeTwoPointTwoCompatClasses.framework */;162 remoteGlobalIDString = F571B4B90E96F62C00B7FD9D; 163 163 remoteInfo = SapphireTakeTwoPointTwoCompatClasses; 164 164 }; … … 167 167 containerPortal = F51BFD2D0D26BDF300E22363 /* SapphireCompatibilityClasses.xcodeproj */; 168 168 proxyType = 1; 169 remoteGlobalIDString = F571B4B80E96F62C00B7FD9D /* SapphireTakeTwoPointTwoCompatClasses */;169 remoteGlobalIDString = F571B4B80E96F62C00B7FD9D; 170 170 remoteInfo = SapphireTakeTwoPointTwoCompatClasses; 171 171 }; … … 769 769 isa = PBXReferenceProxy; 770 770 fileType = wrapper.framework; 771 name = SapphireTakeTwoPointTwoCompatClasses.framework; 772 path = ../../../../build/Release/SapphireTakeTwoPointTwoCompatClasses.framework; 771 path = SapphireTakeTwoPointTwoCompatClasses.framework; 773 772 remoteRef = F571B4BE0E96F62C00B7FD9D /* PBXContainerItemProxy */; 774 773 sourceTree = BUILT_PRODUCTS_DIR; trunk/SapphireFrappliance/SapphireApplianceController.m
r635 r693 141 141 [ret appendFormat:@"\n0x%X\t%@", [key pointerValue], [mapping objectForKey:key]]; 142 142 } 143 NSLog(@"%@", ret);144 143 } 145 144 … … 302 301 } 303 302 304 - (void) w illBePushed305 { 306 // We' re about to be placed on screen, but we're not yet there303 - (void) wasPushed 304 { 305 // We've just been put on screen, the user can see this controller's content now 307 306 [self recreateMenu]; 308 307 [[self list] reload]; 309 308 // always call super 310 [super willBePushed];311 }312 313 - (void) wasPushed314 {315 // We've just been put on screen, the user can see this controller's content now316 317 // always call super318 309 [super wasPushed]; 319 }320 321 - (void) willBePopped322 {323 // The user pressed Menu, but we've not been removed from the screen yet324 325 // always call super326 [super willBePopped];327 310 } 328 311 … … 335 318 } 336 319 337 - (void) willBeBuried338 {339 // The user just chose an option, and we will be taken off the screen340 341 // always call super342 [super willBeBuried];343 }344 345 320 - (void) wasBuriedByPushingController: (BRLayerController *) controller 346 321 { … … 351 326 } 352 327 353 - (void) w illBeExhumed354 { 355 // the user pressed Menu, but we've not been revealed yet328 - (void) wasExhumedByPoppingController: (BRLayerController *) controller 329 { 330 // handle being revealed when the user presses Menu 356 331 357 // always call super358 [super willBeExhumed];359 332 [self setMenuFromSettings]; 360 333 [[self list] reload]; 361 334 [SapphireFrontRowCompat renderScene:[self scene]]; 362 } 363 364 - (void) wasExhumedByPoppingController: (BRLayerController *) controller 365 { 366 // handle being revealed when the user presses Menu 367 335 368 336 // always call super 369 337 [super wasExhumedByPoppingController: controller]; trunk/SapphireFrappliance/SapphireBrowser.m
r675 r693 169 169 } 170 170 171 - (void) willBePushed 172 { 173 // We're about to be placed on screen, but we're not yet there 174 175 // always call super 176 [super willBePushed]; 171 - (void) wasPushed 172 { 173 // We've just been put on screen, the user can see this controller's content now 177 174 /*Reload upon display*/ 178 [metaData setDelegate:self]; 179 [self setNewPredicate:[SapphireApplianceController predicate]]; 180 } 181 182 - (void) wasPushed 183 { 184 // We've just been put on screen, the user can see this controller's content now 185 175 @try { 176 [metaData setDelegate:self]; 177 [self setNewPredicate:[SapphireApplianceController predicate]]; 178 } 179 @catch (NSException * e) { 180 [SapphireApplianceController logException:e]; 181 } 186 182 // always call super 187 183 [super wasPushed]; … … 190 186 } 191 187 192 - (void) willBePopped 193 { 194 // The user pressed Menu, but we've not been removed from the screen yet 195 188 - (void) wasPopped 189 { 190 // The user pressed Menu, removing us from the screen 196 191 // always call super 197 [super willBePopped]; 192 193 [super wasPopped]; 198 194 /*Cancel everything we were doing*/ 199 195 [metaData cancelImport]; … … 202 198 } 203 199 204 - (void) wasPopped 205 { 206 // The user pressed Menu, removing us from the screen 207 // always call super 208 [super wasPopped]; 209 } 210 211 - (void) willBeBuried 212 { 213 // The user just chose an option, and we will be taken off the screen 214 200 - (void) wasBuriedByPushingController: (BRLayerController *) controller 201 { 202 // The user chose an option and this controller is no longer on screen 203 215 204 /*Cancel everything we were doing*/ 216 205 [metaData cancelImport]; 217 206 cancelScan = YES; 218 // always call super 219 [super willBeBuried]; 220 } 221 222 - (void) wasBuriedByPushingController: (BRLayerController *) controller 223 { 224 // The user chose an option and this controller is no longer on screen 225 207 226 208 // always call super 227 209 [super wasBuriedByPushingController: controller]; 228 210 } 229 211 230 - (void) w illBeExhumed231 { 232 // the user pressed Menu, but we've not been revealed yet233 212 - (void) wasExhumedByPoppingController: (BRLayerController *) controller 213 { 214 // handle being revealed when the user presses Menu 215 234 216 /*Reload our display*/ 235 217 [self setNewPredicate:[SapphireApplianceController predicate]]; 236 // always call super 237 [super willBeExhumed]; 238 } 239 240 - (void) wasExhumedByPoppingController: (BRLayerController *) controller 241 { 242 // handle being revealed when the user presses Menu 243 218 244 219 // always call super 245 220 [super wasExhumedByPoppingController: controller]; … … 557 532 558 533 /*and go*/ 559 SapphireVideoPlayerController *controller = [[SapphireVideoPlayerController alloc] initWithScene:[self scene] ];534 SapphireVideoPlayerController *controller = [[SapphireVideoPlayerController alloc] initWithScene:[self scene] player:player]; 560 535 [controller setPlayFile:currentPlayFile]; 561 536 [controller setAllowsResume:YES]; 562 [controller setVideoPlayer:player];563 537 [[self stack] pushController:controller]; 564 538 trunk/SapphireFrappliance/SapphireImporterDataMenu.h
r504 r693 21 21 #import "SapphireMetaData.h" 22 22 #import <SapphireCompatClasses/SapphireCenteredMenuController.h> 23 #import <SapphireCompatClasses/SapphireLayoutManager.h> 23 24 24 25 @protocol SapphireFileMetaDataProtocol; … … 109 110 * This class creates the importer UI. It handles all the user interaction and passes commands on to its subordinates. 110 111 */ 111 @interface SapphireImporterDataMenu : SapphireCenteredMenuController <SapphireMetaDataScannerDelegate, SapphireImporterBackgroundProtocol >112 @interface SapphireImporterDataMenu : SapphireCenteredMenuController <SapphireMetaDataScannerDelegate, SapphireImporterBackgroundProtocol, SapphireLayoutDelegate> 112 113 { 113 114 BRTextControl *text; /*!< @brief The informative text*/ … … 131 132 SEL action; /*!< @brief The action selector when the button is hit*/ 132 133 NSString *buttonTitle; /*!< @brief The fake button title*/ 134 BOOL layoutDone; /*!< @brief YES if layout already done, NO otherwise*/ 133 135 } 134 136 /*! trunk/SapphireFrappliance/SapphireImporterDataMenu.m
r675 r693 67 67 [self addControl: currentFile] ; 68 68 [SapphireFrontRowCompat addSublayer:bar toControl:self]; 69 69 70 [SapphireLayoutManager setCustomLayoutOnControl:self]; 71 70 72 return ( self ); 71 73 } … … 412 414 } 413 415 416 - (void)doMyLayout 417 { 418 if(!layoutDone) 419 { 420 [self layoutFrame]; 421 [self resetUIElements]; 422 layoutDone = YES; 423 } 424 } 425 414 426 - (void)wasPushed 415 427 { trunk/SapphireFrappliance/SapphireMarkMenu.m
r635 r693 266 266 } 267 267 268 - (void) willBePushed269 {270 // We're about to be placed on screen, but we're not yet there271 272 // always call super273 [super willBePushed];274 }275 276 268 - (void) wasPushed 277 269 { … … 282 274 } 283 275 284 - (void) willBePopped285 {286 // The user pressed Menu, but we've not been removed from the screen yet287 288 // always call super289 [super willBePopped];290 }291 292 276 - (void) wasPopped 293 277 { … … 298 282 } 299 283 300 - (void) willBeBuried301 {302 // The user just chose an option, and we will be taken off the screen303 304 // always call super305 [super willBeBuried];306 }307 308 284 - (void) wasBuriedByPushingController: (BRLayerController *) controller 309 285 { … … 312 288 // always call super 313 289 [super wasBuriedByPushingController: controller]; 314 }315 316 - (void) willBeExhumed317 {318 // the user pressed Menu, but we've not been revealed yet319 320 // always call super321 [super willBeExhumed];322 290 } 323 291 trunk/SapphireFrappliance/SapphireMedia.h
r461 r693 25 25 * This class is designed to allow the custom settings of resume time as well as a custom image path. It extends from BRSimpleMediaAsset, so it can be used whenever a URL based asset is needed. 26 26 */ 27 @interface SapphireMedia : BR SimpleMediaAsset {27 @interface SapphireMedia : BRXMLMediaAsset { 28 28 unsigned int resumeTime; /*!< @brief The resume time to use, 0 to use super*/ 29 29 NSString *imagePath; /*!< @brief The cover art path to use, nil to use super*/ 30 30 } 31 32 /*! 33 * @brief Creates a media with a URL. Compatibility with old calling mechanism 34 * 35 * @param url The url to use for this media. 36 * @return The media 37 */ 38 - (id)initWithMediaURL:(NSURL *)url; 31 39 32 40 /*! trunk/SapphireFrappliance/SapphireMedia.m
r461 r693 23 23 24 24 @implementation SapphireMedia 25 26 - (id)initWithMediaURL:(NSURL *)url 27 { 28 //This is here to fix 2.2 29 self = [super initWithMediaProvider:nil]; 30 NSString *urlString = [url absoluteString]; 31 NSString *filename = [url path]; 32 [self setObject:[filename lastPathComponent] forKey:@"id"]; 33 [self setObject:[BRMediaType movie] forKey:@"mediaType"]; 34 [self setObject:urlString forKey:@"mediaURL"]; 35 36 return self; 37 } 25 38 26 39 - (void)dealloc trunk/SapphireFrappliance/SapphireMediaPreview.h
r496 r693 29 29 */ 30 30 @interface SapphireMediaPreview : BRMetadataPreviewController{ 31 int padding[ 16]; /*!< @brief The classes are of different sizes. This padding prevents a class compiled with one size to overlap when used with a class of a different size*/31 int padding[32]; /*!< @brief The classes are of different sizes. This padding prevents a class compiled with one size to overlap when used with a class of a different size*/ 32 32 SapphireMetaData *meta; /*!< @brief The metadata to display in the preview*/ 33 33 SapphireDirectoryMetaData *dirMeta; /*!< @brief The directory containing the metadata*/ trunk/SapphireFrappliance/SapphireMovieChooser.h
r461 r693 20 20 21 21 #import <SapphireCompatClasses/SapphireCenteredMenuController.h> 22 #import <SapphireCompatClasses/SapphireLayoutManager.h> 22 23 23 24 #define MOVIE_CHOOSE_CANCEL -2 … … 29 30 * This class presents the user with a list of possible movies to match a file and asks the user to choose its name. 30 31 */ 31 @interface SapphireMovieChooser : SapphireCenteredMenuController {32 @interface SapphireMovieChooser : SapphireCenteredMenuController <SapphireLayoutDelegate> { 32 33 NSArray *movies; /*!< @brief The list of possible movies*/ 33 34 NSString *fileName; /*!< @brief The filename of the current file*/ trunk/SapphireFrappliance/SapphireMovieChooser.m
r505 r693 43 43 [self addControl: fileNameText]; 44 44 [[self list] setDatasource:self]; 45 46 [SapphireLayoutManager setCustomLayoutOnControl:self]; 45 47 46 48 return self; … … 89 91 } 90 92 91 - (void)willBePushed92 {93 [super willBePushed];94 [(BRListControl *)[self list] setSelection:1];95 }96 97 93 - (void)wasPushed 98 94 { 95 [(BRListControl *)[self list] setSelection:1]; 99 96 [self doMyLayout]; 100 97 [super wasPushed]; trunk/SapphireFrappliance/SapphireMovieImporter.h
r461 r693 33 33 NSString *settingsPath; /*!< @brief The persistent store of translations*/ 34 34 SapphirePosterChooser *posterChooser; /*!< @brief The poster chooser (if exists) (not retained)*/ 35 BRLayerController *childController; /*!< @brief The controller we push on top of us*/ 35 36 } 36 37 trunk/SapphireFrappliance/SapphireMovieImporter.m
r682 r693 197 197 [movieTranslations release]; 198 198 [settingsPath release]; 199 [childController release]; 199 200 [super dealloc]; 200 201 } … … 729 730 [chooser setListTitle:BRLocalizedString(@"Select Movie Title", @"Prompt the user for title of movie")]; 730 731 /*And display prompt*/ 732 childController = [chooser retain]; 731 733 [[dataMenu stack] pushController:chooser]; 732 734 [chooser release]; … … 788 790 [posterChooser setFile:(SapphireFileMetaData *)metaData]; 789 791 [posterChooser setListTitle:BRLocalizedString(@"Select Movie Poster", @"Prompt the user for poster selection")]; 792 childController = [posterChooser retain]; 790 793 [[dataMenu stack] pushController:posterChooser]; 791 794 [posterChooser release]; … … 896 899 { 897 900 /*See if it was a movie chooser*/ 898 if([c ontroller isKindOfClass:[SapphireMovieChooser class]])901 if([childController isKindOfClass:[SapphireMovieChooser class]]) 899 902 { 900 903 /*Get the user's selection*/ 901 SapphireMovieChooser *chooser = (SapphireMovieChooser *)c ontroller;904 SapphireMovieChooser *chooser = (SapphireMovieChooser *)childController; 902 905 int selection = [chooser selection]; 903 906 if(selection == MOVIE_CHOOSE_CANCEL) … … 932 935 [dataMenu resume]; 933 936 } 934 else if([c ontroller isKindOfClass:[SapphirePosterChooser class]])937 else if([childController isKindOfClass:[SapphirePosterChooser class]]) 935 938 { 936 939 int selectedPoster = [posterChooser selectedPoster]; … … 958 961 else 959 962 return; 963 964 [childController release]; 965 childController = nil; 960 966 } 961 967 trunk/SapphireFrappliance/SapphirePosterChooser.h
r504 r693 20 20 21 21 #import <SapphireCompatClasses/SapphireMediaMenuController.h> 22 #import <SapphireCompatClasses/SapphireLayoutManager.h> 22 23 23 24 #define POSTER_CHOOSE_CANCEL -1 … … 31 32 * This class provides a menu and maching icons to display posters for the user to choose. 32 33 */ 33 @interface SapphirePosterChooser : SapphireMediaMenuController <BRIconSourceProtocol, BRMenuListItemProvider > {34 @interface SapphirePosterChooser : SapphireMediaMenuController <BRIconSourceProtocol, BRMenuListItemProvider, SapphireLayoutDelegate> { 34 35 NSArray *posters; /*!< @brief The array of poster paths*/ 35 36 NSMutableArray *posterLayers; /*!< @brief The image layers of posters*/ trunk/SapphireFrappliance/SapphirePosterChooser.m
r518 r693 71 71 /* Setup posterMarch controls */ 72 72 posterMarch = [SapphireFrontRowCompat newMarchingIconLayerWithScene:scene]; 73 [SapphireLayoutManager setCustomLayoutOnControl:self]; 73 74 74 75 return self; … … 100 101 { 101 102 // We're about to be placed on screen, but we're not yet there 102 // add the icon march layer to the scene103 [self showIconMarch];104 103 105 104 // always call super trunk/SapphireFrappliance/SapphireSettings.m
r516 r693 309 309 } 310 310 311 - (void) willBePushed312 {313 // We're about to be placed on screen, but we're not yet there314 315 // always call super316 [super willBePushed];317 }318 319 311 - (void) wasPushed 320 312 { … … 325 317 } 326 318 327 - (void) willBePopped328 {329 // The user pressed Menu, but we've not been removed from the screen yet330 331 // always call super332 [super willBePopped];333 }334 335 319 - (void) wasPopped 336 320 { … … 341 325 } 342 326 343 - (void) willBeBuried344 {345 // The user just chose an option, and we will be taken off the screen346 347 // always call super348 [super willBeBuried];349 }350 351 327 - (void) wasBuriedByPushingController: (BRLayerController *) controller 352 328 { … … 355 331 // always call super 356 332 [super wasBuriedByPushingController: controller]; 357 }358 359 - (void) willBeExhumed360 {361 // the user pressed Menu, but we've not been revealed yet362 363 // always call super364 [super willBeExhumed];365 333 } 366 334 trunk/SapphireFrappliance/SapphireShowChooser.h
r461 r693 20 20 21 21 #import <SapphireCompatClasses/SapphireCenteredMenuController.h> 22 #import <SapphireCompatClasses/SapphireLayoutManager.h> 22 23 23 24 #define SHOW_CHOOSE_CANCEL -2 … … 29 30 * This class presents the user with a list of possible shows to match a file and asks the user to choose its name. 30 31 */ 31 @interface SapphireShowChooser : SapphireCenteredMenuController {32 @interface SapphireShowChooser : SapphireCenteredMenuController <SapphireLayoutDelegate> { 32 33 NSArray *shows; /*!< @brief The list of possible shows*/ 33 34 NSString *searchStr; /*!< @brief The string we searched for*/ trunk/SapphireFrappliance/SapphireShowChooser.m
r505 r693 44 44 [self addControl: fileName]; 45 45 [[self list] setDatasource:self]; 46 47 [SapphireLayoutManager setCustomLayoutOnControl:self]; 46 48 47 49 return self; … … 94 96 } 95 97 96 - (void)willBePushed97 {98 [super willBePushed];99 [(BRListControl *)[self list] setSelection:1];100 }101 102 98 - (void)wasPushed 103 99 { 100 [(BRListControl *)[self list] setSelection:1]; 104 101 [self doMyLayout]; 105 102 [super wasPushed]; trunk/SapphireFrappliance/SapphireTVShowImporter.h
r461 r693 22 22 #include <regex.h> 23 23 24 @class SapphireShowChooser; 25 24 26 /*! 25 27 * @brief The importer of TV data … … 36 38 regex_t seasonByEpisode; /*!< @brief Regex for matching #x##*/ 37 39 regex_t seasonEpisodeTriple; /*!< @brief Regex for matching ###*/ 40 SapphireShowChooser *chooser; /*!< @brief The TV Show chooser*/ 38 41 } 39 42 trunk/SapphireFrappliance/SapphireTVShowImporter.m
r654 r693 120 120 regfree(&seasonByEpisode); 121 121 regfree(&seasonEpisodeTriple); 122 [chooser release]; 122 123 [super dealloc]; 123 124 } … … 532 533 NSArray *shows = [self searchResultsForSeries:searchStr]; 533 534 /*Bring up the prompt*/ 534 SapphireShowChooser *chooser = [[SapphireShowChooser alloc] initWithScene:[dataMenu scene]];535 chooser = [[SapphireShowChooser alloc] initWithScene:[dataMenu scene]]; 535 536 [chooser setShows:shows]; 536 537 [chooser setFileName:fileName]; … … 539 540 /*And display prompt*/ 540 541 [[dataMenu stack] pushController:chooser]; 541 [chooser release];542 542 return IMPORT_STATE_NEEDS_SUSPEND; 543 543 } … … 595 595 /*Match on show title*/ 596 596 NSString *showTitle = nil; 597 [scanner scanUpToCharactersFromSet:[NSCharacterSet letterCharacterSet] intoString:nil];597 [scanner scanUpToCharactersFromSet:[NSCharacterSet alphanumericCharacterSet] intoString:nil]; 598 598 if([scanner scanUpToString:@"." intoString:&showTitle]) 599 599 info = [self getInfo:show forSeason:season episodeTitle:showTitle]; … … 663 663 { 664 664 /*See if it was a show chooser*/ 665 if( ![controller isKindOfClass:[SapphireShowChooser class]])665 if(chooser == nil) 666 666 return; 667 667 668 668 /*Get the user's selection*/ 669 SapphireShowChooser *chooser = (SapphireShowChooser *)controller;670 669 int selection = [chooser selection]; 671 670 if(selection == SHOW_CHOOSE_CANCEL) … … 686 685 [self writeSettings]; 687 686 } 687 [chooser release]; 688 chooser = nil; 688 689 /*We can resume now*/ 689 690 [dataMenu resume]; trunk/SapphireFrappliance/SapphireVideoPlayer.h
r523 r693 42 42 double skipTime; /*!< @brief Time by which next skip should advance/reverse*/ 43 43 SkipState state; /*!< @brief Current state we are in*/ 44 BOOL enabledChecked; /*!< @brief YES if we checked to enable, NO otherwise*/ 44 45 BOOL enabled; /*!< @brief YES if we are enabled, NO if we behave the same as the super class*/ 45 46 NSTimer *resetTimer; /*!< @brief Timer to reset our state machine to default (not retained)*/ trunk/SapphireFrappliance/SapphireVideoPlayer.m
r523 r693 61 61 @end 62 62 63 typedef enum 64 { 65 kBRMediaPlayerStateStopped = 0, 66 kBRMediaPlayerStatePaused, 67 kBRMediaPlayerStateLoading, 68 kBRMediaPlayerStatePlaying, 69 kBRMediaPlayerStateFastForwardLevel1, 70 kBRMediaPlayerStateFastForwardLevel2, 71 kBRMediaPlayerStateFastForwardLevel3, 72 kBRMediaPlayerStateRewindLevel1, 73 kBRMediaPlayerStateRewindLevel2, 74 kBRMediaPlayerStateRewindLevel3, 75 kBRMediaPlayerStateSlowForwardLevel1, 76 kBRMediaPlayerStateSlowForwardLevel2, 77 kBRMediaPlayerStateSlowForwardLevel3, 78 kBRMediaPlayerStateSlowRewindLevel1, 79 kBRMediaPlayerStateSlowRewindLevel2, 80 kBRMediaPlayerStateSlowRewindLevel3, 81 82 kBRMediaPlayerStateRewind = kBRMediaPlayerStateRewindLevel1, // default 83 kBRMediaPlayerStateFastForward = kBRMediaPlayerStateFastForwardLevel1, // default 84 85 kBRMediaPlayerStateRESERVED = 20, 86 87 // Individual player subclasses may create their own states beyond the 88 // reserved states. For instance, the DVD player may want to create states 89 // for when it's in menus. 90 91 } BRMediaPlayerState; 92 93 @interface BRQTKitVideoPlayer (compat) 94 -(BOOL)setState:(BRMediaPlayerState)state error:(NSError **)error; 95 -(BOOL)setMedia:(BRBaseMediaAsset *)asset inTrackList:(NSArray *)tracklist error:(NSError **)error; 96 -(BOOL)setMediaAtIndex:(long)index inTrackList:(NSArray *)tracklist error:(NSError **)error; 97 -(double)duration; 98 -(double)elapsedTime; 99 @end 100 101 63 102 #define LOW_SKIP_TIME 5.0f 64 103 … … 107 146 } 108 147 148 - (void)checkIfCanEnable 149 { 150 /*Check to see if the movie has any chapters by default*/ 151 Movie myMovie = [[self gimmieVideo] gimmieMovie]; 152 153 BOOL hasChapters = [self movieHasChapters:myMovie]; 154 duration = ((double)GetMovieDuration(myMovie)) / ((double)GetMovieTimeScale(myMovie)); 155 156 if(!hasChapters) 157 enabled = TRUE; 158 NSLog(@"Enabled is %d", enabled); 159 } 160 109 161 - (BOOL)prerollMedia:(NSError * *)fp8 110 162 { … … 114 166 return ret; 115 167 116 /*Check to see if the movie has any chapters by default*/ 117 Movie myMovie = [[self gimmieVideo] gimmieMovie]; 118 119 BOOL hasChapters = [self movieHasChapters:myMovie]; 120 duration = ((double)GetMovieDuration(myMovie)) / ((double)GetMovieTimeScale(myMovie)); 121 122 if(!hasChapters) 123 enabled = TRUE; 124 168 [self checkIfCanEnable]; 169 170 return ret; 171 } 172 173 -(BOOL)setState:(BRMediaPlayerState)playState error:(NSError **)error; 174 { 175 BOOL ret = [super setState:playState error:error]; 176 177 if(!ret) 178 return ret; 179 180 if(!enabledChecked) 181 { 182 [self checkIfCanEnable]; 183 enabledChecked = YES; 184 } 185 125 186 return ret; 126 187 } … … 262 323 } 263 324 264 @end 325 - (BOOL)setMedia:(BRBaseMediaAsset *)asset error:(NSError **)error 326 { 327 if([SapphireFrontRowCompat usingTakeTwoDotTwo]) 328 { 329 if([[SapphireVideoPlayer superclass] instancesRespondToSelector:@selector(setMedia:inTrackList:error:)]) 330 return [super setMedia:asset inTrackList:[NSArray arrayWithObject:asset] error:error]; 331 else 332 return [super setMediaAtIndex:0 inTrackList:[NSArray arrayWithObject:asset] error:error]; 333 } 334 return [super setMedia:asset error:error]; 335 } 336 337 - (double)elapsedPlaybackTime 338 { 339 if([[SapphireVideoPlayer superclass] instancesRespondToSelector:@selector(elapsedPlaybackTime)]) 340 return [super elapsedPlaybackTime]; 341 return [super elapsedTime]; 342 } 343 344 - (double)trackDuration 345 { 346 if([[SapphireVideoPlayer superclass] instancesRespondToSelector:@selector(trackDuration)]) 347 return [super trackDuration]; 348 return [super duration]; 349 } 350 351 @end trunk/SapphireFrappliance/SapphireVideoPlayerController.h
r524 r693 19 19 */ 20 20 21 @class SapphireFileMetaData ;21 @class SapphireFileMetaData, SapphireVideoPlayer; 22 22 23 23 /*! … … 33 33 34 34 /*! 35 * @brief Creates the controller for a player 36 * 37 * @param scene The scene 38 * @param player The player 39 * @return the controller 40 */ 41 - (id)initWithScene:(BRRenderScene *)scene player:(SapphireVideoPlayer *)player; 42 43 /*! 35 44 * @brief Set the currently playing file metadata 36 45 * trunk/SapphireFrappliance/SapphireVideoPlayerController.m
r638 r693 32 32 #define SOUND_STATE_SOUND_PASSTHROUGH 2 33 33 34 @interface BRVideoPlayerController (compat) 35 - (id)initWithPlayer:(SapphireVideoPlayer *)player; 36 @end 37 38 34 39 @implementation SapphireVideoPlayerController 35 40 36 - (id)initWithScene:(BRRenderScene *)scene 41 - (id)initWithScene:(BRRenderScene *)scene player:(SapphireVideoPlayer *)player; 37 42 { 38 43 if([[BRVideoPlayerController class] instancesRespondToSelector:@selector(initWithScene:)]) 39 44 self = [super initWithScene:scene]; 45 else if([[BRVideoPlayerController class] instancesRespondToSelector:@selector(initWithPlayer:)]) 46 self = [super initWithPlayer:player]; 40 47 else 41 48 self = [super init]; 42 49 50 [self setVideoPlayer:player]; 43 51 return self; 44 52 } … … 201 209 } 202 210 203 - (void)w
