Changeset 685
- Timestamp:
- 08/28/07 15:08:12 (1 year ago)
- Files:
-
- trunk/CPFPerianPrefPaneController.h (modified) (2 diffs)
- trunk/CPFPerianPrefPaneController.m (modified) (2 diffs)
- trunk/PerianPrefPane.nib/classes.nib (modified) (2 diffs)
- trunk/PerianPrefPane.nib/keyedobjects.nib (modified) (previous)
- trunk/Subtitles/SubATSUIRenderer.m (modified) (1 diff)
- trunk/Subtitles/SubImport.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/CPFPerianPrefPaneController.h
r607 r685 71 71 IBOutlet NSSlider *slider_ac3DynamicRangeSlider; 72 72 73 IBOutlet NSButton *button_loadExternalSubtitles; 74 73 75 //About 74 76 IBOutlet NSTextView *textView_about; … … 97 99 - (IBAction)updateCheck:(id)sender; 98 100 - (IBAction)setAutoUpdateCheck:(id)sender; 101 - (IBAction)setLoadExternalSubtitles:(id)sender; 99 102 100 103 //AC3 Settings trunk/CPFPerianPrefPaneController.m
r676 r685 6 6 #define LastInstalledVersionKey CFSTR("LastInstalledVersion") 7 7 #define AC3TwoChannelModeKey CFSTR("twoChannelMode") 8 #define ExternalSubtitlesKey CFSTR("LoadExternalSubtitles") 8 9 9 10 //Old … … 893 894 } 894 895 896 #pragma mark Subtitles 897 - (IBAction)setLoadExternalSubtitles:(id)sender 898 { 899 [self setKey:ExternalSubtitlesKey forAppID:perianAppID fromBool:(BOOL)[sender state]]; 900 } 901 895 902 #pragma mark About 896 903 - (IBAction)launchWebsite:(id)sender trunk/PerianPrefPane.nib/classes.nib
r574 r685 14 14 setAC3DynamicRangeValue = id; 15 15 setAutoUpdateCheck = id; 16 setLoadExternalSubtitles = id; 16 17 updateCheck = id; 17 18 }; … … 23 24 "button_forum" = NSButton; 24 25 "button_install" = NSButton; 26 "button_loadExternalSubtitles" = NSButton; 25 27 "button_updateCheck" = NSButton; 26 28 "button_website" = NSButton; trunk/Subtitles/SubATSUIRenderer.m
r675 r685 220 220 static ATSUFontID GetFontIDForSSAName(NSString *name, ATSFontRef *_fontRef) 221 221 { 222 ATSFontRef fontRef = ATSFontFindFromName((CFStringRef)name,kATSOptionFlagsDefault); 223 ATSUFontID font = FMGetFontFromATSFontRef(fontRef); 224 222 ByteCount nlen = [name length]; 223 unichar *uname = (unichar*)[name cStringUsingEncoding:NSUnicodeStringEncoding]; 224 225 ATSFontRef fontRef; 226 ATSUFontID font; 227 228 ATSUFindFontFromName(uname, nlen * sizeof(unichar), kFontFamilyName, kFontNoPlatformCode, kFontNoScript, kFontNoLanguage, &font); 229 225 230 if (font == kATSUInvalidFontID) { 226 const char *utf8 = [name UTF8String]; 227 ATSUFindFontFromName(utf8, strlen(utf8), kFontFamilyName, kFontNoPlatformCode, kFontNoScript, kFontNoLanguage, &font); 228 229 if (font == kATSUInvalidFontID) ATSUFindFontFromName(utf8, strlen(utf8), 18, kFontNoPlatformCode, kFontNoScript, kFontNoLanguage, &font); 231 fontRef = ATSFontFindFromName((CFStringRef)name,kATSOptionFlagsDefault); 232 font = FMGetFontFromATSFontRef(fontRef); 230 233 231 234 if (font == kATSUInvalidFontID) { 232 235 fontRef = ATSFontFindFromName((CFStringRef)@"Helvetica",kATSOptionFlagsDefault); 233 236 font = FMGetFontFromATSFontRef(fontRef); 234 } else fontRef = FMGetATSFontRefFromFont(font);235 } 237 } 238 } else fontRef = FMGetATSFontRefFromFont(font); 236 239 237 240 *_fontRef = fontRef; trunk/Subtitles/SubImport.mm
r680 r685 339 339 } 340 340 341 static Boolean ShouldLoadExternalSubtitles() 342 { 343 Boolean isSet, value; 344 345 value = CFPreferencesGetAppBooleanValue(CFSTR("LoadExternalSubtitles"),CFSTR("org.perian.Perian"),&isSet); 346 347 return isSet ? value : YES; 348 } 349 341 350 ComponentResult LoadExternalSubtitles(const FSRef *theFile, Movie theMovie) 342 351 { … … 350 359 ItemCount filesFound; 351 360 Boolean containerChanged; 361 362 if (!ShouldLoadExternalSubtitles()) return noErr; 352 363 353 364 err = FSGetCatalogInfo(theFile, kFSCatInfoNone, NULL, &hfsFilename, NULL, &parentDir);
