Changeset 873

Show
Ignore:
Timestamp:
05/04/08 20:08:03 (7 months ago)
Author:
astrange
Message:

Hack that kind of allows subtitles in Front Row, maybe.
Patch by capri92

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Subtitles/SubImport.mm

    r872 r873  
    6464} 
    6565 
     66static bool ShouldEngageFrontRowHack(void) 
     67{ 
     68        bool ret; 
     69        Boolean isSet; 
     70         
     71        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
     72        NSString *applicationName = [[NSProcessInfo processInfo] processName]; 
     73        long minorVersion; 
     74        Gestalt(gestaltSystemVersionMinor, &minorVersion); 
     75        CFPreferencesGetAppBooleanValue(CFSTR("PerianFrontRowSubtitleHack"),CFSTR("org.perian.Perian"),&isSet); 
     76         
     77        ret = (minorVersion == 5) && [applicationName isEqualToString:@"Front Row"] && isSet; 
     78        [pool release]; 
     79         
     80        return ret; 
     81} 
     82 
    6683Track CreatePlaintextSubTrack(Movie theMovie, ImageDescriptionHandle imgDesc,  
    6784                              TimeScale timescale, Handle dataRef, OSType dataRefType, FourCharCode subType, Handle imageExtension, Rect movieBox) 
     
    92109                        // finally, say that we're transparent 
    93110                        MediaHandler mh = GetMediaHandler(theMedia); 
    94                         MediaSetGraphicsMode(mh, graphicsModePreBlackAlpha, NULL); 
     111                         
     112                        if (ShouldEngageFrontRowHack()) { 
     113                                RGBColor blendColor = {0x0000, 0x0000, 0x0000}; 
     114                                MediaSetGraphicsMode(mh, transparent, &blendColor); 
     115                        } 
     116                        else MediaSetGraphicsMode(mh, graphicsModePreBlackAlpha, NULL); 
    95117                         
    96118                        // subtitle tracks should be above the video track, which should be layer 0