From f73206bf585737a16706b7445a7add49959bc6a3 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Wed, 24 Aug 2011 20:11:53 +0000 Subject: MacGui: Live Preview ... - Use the first subs track that has been specified to display in the live preview. -- Tested against TX3G (3GPP) subs in mp4 and vobsubs in mkv. - Also change Live Preview durations to less granular yet longer durations to: (seconds) 15, 30, 45, 60 90, 105 and 120. - Subs patch by Rodeo. Thanks! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4193 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/English.lproj/PicturePreview.xib | 29 +++++++++++++---------------- macosx/HBPreviewController.m | 31 +++++++++++++++++++++++-------- 2 files changed, 36 insertions(+), 24 deletions(-) diff --git a/macosx/English.lproj/PicturePreview.xib b/macosx/English.lproj/PicturePreview.xib index 030fa9e7e..56ad6bec0 100644 --- a/macosx/English.lproj/PicturePreview.xib +++ b/macosx/English.lproj/PicturePreview.xib @@ -2,9 +2,9 @@ 1050 - 10F569 - 788 - 1038.29 + 10K549 + 851 + 1038.36 461.00 YES @@ -15,13 +15,13 @@ YES - 788 - 1742 + 851 + 1783 YES - + YES @@ -29,13 +29,8 @@ com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -242,7 +237,7 @@ 289 - {{119, 14}, {75, 11}} + {{101, 14}, {75, 11}} YES @@ -273,7 +268,7 @@ 289 - {{198, 11}, {45, 15}} + {{184, 11}, {58, 15}} YES @@ -1118,7 +1113,9 @@ YES 0 - + + YES + diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m index adacb8bf1..4d0826b1d 100644 --- a/macosx/HBPreviewController.m +++ b/macosx/HBPreviewController.m @@ -183,18 +183,13 @@ /* we set the preview length popup in seconds */ [fPreviewMovieLengthPopUp removeAllItems]; - [fPreviewMovieLengthPopUp addItemWithTitle: @"5"]; - [fPreviewMovieLengthPopUp addItemWithTitle: @"10"]; [fPreviewMovieLengthPopUp addItemWithTitle: @"15"]; - [fPreviewMovieLengthPopUp addItemWithTitle: @"20"]; - [fPreviewMovieLengthPopUp addItemWithTitle: @"25"]; [fPreviewMovieLengthPopUp addItemWithTitle: @"30"]; - [fPreviewMovieLengthPopUp addItemWithTitle: @"35"]; - [fPreviewMovieLengthPopUp addItemWithTitle: @"40"]; [fPreviewMovieLengthPopUp addItemWithTitle: @"45"]; - [fPreviewMovieLengthPopUp addItemWithTitle: @"50"]; - [fPreviewMovieLengthPopUp addItemWithTitle: @"55"]; [fPreviewMovieLengthPopUp addItemWithTitle: @"60"]; + [fPreviewMovieLengthPopUp addItemWithTitle: @"90"]; + [fPreviewMovieLengthPopUp addItemWithTitle: @"105"]; + [fPreviewMovieLengthPopUp addItemWithTitle: @"120"]; /* adjust the preview slider length */ /* We use our advance pref to determine how many previews we scanned */ @@ -1206,6 +1201,26 @@ [fMoviePlaybackControlBox setHidden: NO]; [fPictureControlBox setHidden: YES]; + // get and enable subtitles + NSArray *subtitlesArray; + subtitlesArray = [aMovie tracksOfMediaType: @"sbtl"]; + if( subtitlesArray && [subtitlesArray count] ) + { + // enable the first TX3G subtitle track + [[subtitlesArray objectAtIndex: 0] setEnabled: YES]; + } + else + { + // Perian subtitles + subtitlesArray = [aMovie tracksOfMediaType: QTMediaTypeVideo]; + if( subtitlesArray && ( [subtitlesArray count] >= 2 ) ) + { + // track 0 should be video, other video tracks should + // be subtitles; force-enable the first subs track + [[subtitlesArray objectAtIndex: 1] setEnabled: YES]; + } + } + // to actually play the movie [self initPreviewScrubberForMovie]; -- cgit v1.2.3