Changeset 523
- Timestamp:
- 04/26/08 02:51:19 (9 months ago)
- Files:
-
- trunk/SapphireFrappliance/SapphireVideoPlayer.h (modified) (1 diff)
- trunk/SapphireFrappliance/SapphireVideoPlayer.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/SapphireFrappliance/SapphireVideoPlayer.h
r498 r523 39 39 */ 40 40 @interface SapphireVideoPlayer : BRQTKitVideoPlayer { 41 int padding[ 4]; /*!< @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*/41 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*/ 42 42 double skipTime; /*!< @brief Time by which next skip should advance/reverse*/ 43 43 SkipState state; /*!< @brief Current state we are in*/ 44 44 BOOL enabled; /*!< @brief YES if we are enabled, NO if we behave the same as the super class*/ 45 45 NSTimer *resetTimer; /*!< @brief Timer to reset our state machine to default (not retained)*/ 46 NSTimeIntervalduration; /*!< @brief Total length of the movie*/46 double duration; /*!< @brief Total length of the movie*/ 47 47 } 48 48 trunk/SapphireFrappliance/SapphireVideoPlayer.m
r508 r523 35 35 36 36 @interface BRVideo (privateFunctions) 37 - ( QTMovie *)gimmieMovie;37 - (Movie)gimmieMovie; 38 38 @end 39 39 … … 49 49 50 50 @implementation BRVideo (privateFunctions) 51 - ( QTMovie *)gimmieMovie51 - (Movie)gimmieMovie 52 52 { 53 53 Class myClass = [self class]; 54 54 Ivar ret = class_getInstanceVariable(myClass, "_movie"); 55 55 56 if( ![SapphireFrontRowCompat usingTakeTwo])57 return *( QTMovie **)(((char *)self)+ret->ivar_offset);58 Movie mov = *(Movie*)(((char *)self)+ret->ivar_offset);59 return [ QTMovie movieWithQuickTimeMovie:mov disposeWhenDone:NO error:nil];56 if([SapphireFrontRowCompat usingTakeTwo]) 57 return *(Movie *)(((char *)self)+ret->ivar_offset); 58 QTMovie *qtmov = *(QTMovie * *)(((char *)self)+ret->ivar_offset); 59 return [qtmov quickTimeMovie]; 60 60 } 61 61 @end … … 86 86 - (void)dealloc 87 87 { 88 [resetTimer invalidate];88 // [resetTimer invalidate]; 89 89 [super dealloc]; 90 } 91 92 - (BOOL)movieHasChapters:(Movie)mov 93 { 94 int tkCount = GetMovieTrackCount(mov); 95 int i; 96 for(i=0; i<tkCount; i++) 97 { 98 Track track = GetMovieIndTrack(mov, i); 99 if(!GetTrackEnabled(track)) 100 continue; 101 102 if(GetTrackReference(track, 'chap', 1) != NULL) 103 return YES; 104 } 105 106 return NO; 90 107 } 91 108 … … 98 115 99 116 /*Check to see if the movie has any chapters by default*/ 100 QTMovie *myMovie = [[self gimmieVideo] gimmieMovie]; 101 if(![myMovie hasChapters]) 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) 102 123 enabled = TRUE; 103 104 QTGetTimeInterval([myMovie duration], &duration); 105 124 106 125 return ret; 107 126 }
