OSDN Git Service

MacGui: Enable 5.1 6 channel audio extraction for OGM with Vorbis audio
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 28 Mar 2007 18:06:50 +0000 (18:06 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 28 Mar 2007 18:06:50 +0000 (18:06 +0000)
- also, some internal changes to controller.mm for upcoming appleTV preset capabilities in gui.

git-svn-id: svn://localhost/HandBrake/trunk@461 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
macosx/Controller.mm
macosx/English.lproj/MainMenu.nib/info.nib
macosx/English.lproj/MainMenu.nib/keyedobjects.nib
macosx/HandBrake.xcodeproj/project.pbxproj

index 9d69694..37d2791 100644 (file)
@@ -95,7 +95,9 @@
        IBOutlet NSTextField         * fPicLabelPAROutputX;
        IBOutlet NSTextField         * fPicSettingPARWidth;
        IBOutlet NSTextField         * fPicSettingPARHeight;
-       
+    /* Picture variables */
+       int                        PicOrigOutputWidth;
+       int                        PicOrigOutputHeight;
        
     /* Subtitles box */
     IBOutlet NSTextField         * fSubField;
index 71d0654..e1cea51 100644 (file)
@@ -829,7 +829,7 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
     job->abitrate = hb_audio_bitrates[[fAudBitratePopUp
                         indexOfSelectedItem]].rate;
        /* have we selected that 5.1 should be extracted as AAC? */
-       if (job->acodec == HB_ACODEC_FAAC && [fAudLang1SurroundCheck isEnabled] && [fAudLang1SurroundCheck state] == NSOnState) {
+       if ((job->acodec == HB_ACODEC_FAAC || job->acodec == HB_ACODEC_VORBIS) && [fAudLang1SurroundCheck isEnabled] && [fAudLang1SurroundCheck state] == NSOnState) {
                job->surround = 1;
        } else {
                job->surround = 0;
@@ -1009,6 +1009,8 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
     hb_list_t  * list  = hb_get_titles( fHandle );
     hb_title_t * title = (hb_title_t*)
         hb_list_item( list, [fSrcTitlePopUp indexOfSelectedItem] );
+               
+               
     /* If Auto Naming is on. We create an output filename of dvd name - title number */
     if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultAutoNaming"] > 0)
        {
@@ -1042,6 +1044,10 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                                                         @"%d", fTitle->width]];
        [fPicSrcHeight setStringValue: [NSString stringWithFormat:
                                                         @"%d", fTitle->height]];
+       /* We get the originial output picture width and height and put them
+       in variables for use with some presets later on */
+       PicOrigOutputWidth = title->job->width;
+       PicOrigOutputHeight = title->job->height;
        /* Turn Deinterlace on/off depending on the preference */
        if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultDeinterlaceOn"] > 0)
        {
@@ -1338,8 +1344,8 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
     int codecs = [fDstCodecsPopUp indexOfSelectedItem];
        int acodec = FormatSettings[format][codecs] & HB_ACODEC_MASK;
 
-       /* we only offer the option to extract 5.1 to 6-channel if the selected audio codec is AAC */
-       if (acodec == HB_ACODEC_FAAC) {
+       /* we only offer the option to extract 5.1 to 6-channel if the selected audio codec is AAC or Vorbis*/
+       if (acodec == HB_ACODEC_FAAC || acodec == HB_ACODEC_VORBIS) {
 
                bool doneaudios = false;
                int thisaudio = 0;
@@ -1362,7 +1368,7 @@ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow
                }
        }
 
-    /* If we are extracting to AAC, and any of our soundtracks were 5.1, then enable the checkbox  */
+    /* If we are extracting to AAC or Vorbis, and any of our soundtracks were 5.1, then enable the checkbox  */
        if (foundfiveoneaudio) {
                [fAudLang1SurroundCheck setEnabled: YES];
                /* Check default surround sound pref and if it is YES, lets also check the checkbox */
@@ -1701,7 +1707,7 @@ the user is using "Custom" settings by determining the sender*/
        /*Set whether or not this is default, at creation set to 0*/
        [preset setObject:[NSNumber numberWithInt:0] forKey:@"Default"];
        /*Get the whether or not to apply pic settings in the AddPresetPanel*/
-       [preset setObject:[NSNumber numberWithInt:0] forKey:@"UsesPictureSettings"];
+       [preset setObject:[NSNumber numberWithInt:1] forKey:@"UsesPictureSettings"];
        /* File Format */
     [preset setObject:@"MP4 file" forKey:@"FileFormat"];
        /* Chapter Markers*/
@@ -1724,13 +1730,15 @@ the user is using "Custom" settings by determining the sender*/
        [preset setObject:[NSNumber numberWithInt:0] forKey:@"VideoTwoPass"];
        
        /*Picture Settings*/
-       //hb_job_t * job = fTitle->job;
+       hb_job_t * job = fTitle->job;
+       //hb_job_t * job = title->job;
        /* Basic Picture Settings */
-       //[preset setObject:[NSNumber numberWithInt:fTitle->job->width] forKey:@"PictureWidth"];
-       //[preset setObject:[NSNumber numberWithInt:fTitle->job->height] forKey:@"PictureHeight"];
-       //[preset setObject:[NSNumber numberWithInt:fTitle->job->keep_ratio] forKey:@"PictureKeepRatio"];
-       //[preset setObject:[NSNumber numberWithInt:fTitle->job->deinterlace] forKey:@"PictureDeinterlace"];
-       //[preset setObject:[NSNumber numberWithInt:fTitle->job->pixel_ratio] forKey:@"PicturePAR"];
+       
+       //[preset setObject:[NSNumber numberWithInt:PicOrigOutputWidth] forKey:@"PictureWidth"];
+       //[preset setObject:[NSNumber numberWithInt:PicOrigOutputHeight] forKey:@"PictureHeight"];
+       //[preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureKeepRatio"];
+       //[preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureDeinterlace"];
+       //[preset setObject:[NSNumber numberWithInt:1] forKey:@"PicturePAR"];
        /* Set crop settings here */
        /* The Auto Crop Matrix in the Picture Window autodetects differences in crop settings */
        //[preset setObject:[NSNumber numberWithInt:job->crop[0]] forKey:@"PictureTopCrop"];
index 079775a..892e946 100644 (file)
@@ -21,6 +21,7 @@
        <array>
                <integer>21</integer>
                <integer>29</integer>
+               <integer>1438</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8P2137</string>
index 0b02921..578d278 100644 (file)
Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ
index a4d0f7c..2a5b575 100644 (file)
 /* Begin PBXFileReference section */
                089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
                0D096DFF0B707D1200A845D4 /* libhb.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libhb.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
-               0D6E35760B6BD4F0005AABB3 /* HandBrake.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HandBrake.app; sourceTree = BUILT_PRODUCTS_DIR; };
+               0D6E35760B6BD4F0005AABB3 /* HandBrake.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = HandBrake.app; sourceTree = BUILT_PRODUCTS_DIR; };
                0DF377970B7BF99A00115CB0 /* fakexcode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = fakexcode.cpp; path = ../test/fakexcode.cpp; sourceTree = SOURCE_ROOT; };
                0DFA5C7A0B8DD1E90020BC09 /* HandBrake.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = HandBrake.icns; sourceTree = "<group>"; };
                0DFA5C7E0B8DD3B60020BC09 /* declpcm.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = declpcm.c; path = ../libhb/declpcm.c; sourceTree = SOURCE_ROOT; };