diff options
author | dynaflash <[email protected]> | 2007-04-19 18:35:49 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-04-19 18:35:49 +0000 |
commit | 4c58630085055686e8980c67d12cdde576fdea2f (patch) | |
tree | e020112e5aaf1fccdee73c1d002815b9d9de9df6 | |
parent | d8bb128078f1084446ab1d2616cf02251dc46dca (diff) |
MacGui: Initial implementation of capping avialable bitrates depending on audio track mixdown
- added AudioTrackMixdownChanged method to controller.mm which evaluates other selections and adjusts available bitrates to choose from
- currently just caps bitrates at 160 for anything other than 6 channel discrete
- 6 channel discrete in either audio track mixdown enables bitrates up to 384.
- Will likely need to add other conditions as well
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@533 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/Controller.h | 1 | ||||
-rw-r--r-- | macosx/Controller.mm | 31 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/classes.nib | 1 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/info.nib | 2 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/keyedobjects.nib | bin | 99541 -> 99731 bytes |
5 files changed, 32 insertions, 3 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h index f5a84bbbb..a866d58c7 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -174,6 +174,7 @@ - (IBAction) SelectAudioTrackInPopUp: (id) sender searchPrefixString: (NSString *) searchPrefixString selectIndexIfNotFound: (int) selectIndexIfNotFound; - (IBAction) AudioTrackPopUpChanged: (id) sender; - (IBAction) AudioTrackPopUpChanged: (id) sender mixdownToUse: (int) mixdownToUse; +- (IBAction) AudioTrackMixdownChanged: (id) sender; - (IBAction) BrowseFile: (id) sender; - (void) BrowseFileDone: (NSSavePanel *) sheet diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 530ae7c86..ea00f3a08 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -1603,7 +1603,9 @@ static int FormatSettings[3][4] = /* select the (possibly-amended) preferred mixdown */ [mixdownPopUp selectItemWithTag: useMixdown]; - + + /* lets call the AudioTrackMixdownChanged method here to determine appropriate bitrates, etc. */ + [self AudioTrackMixdownChanged: NULL]; } } @@ -1614,7 +1616,32 @@ static int FormatSettings[3][4] = [self CalculateBitrate: sender]; } - +- (IBAction) AudioTrackMixdownChanged: (id) sender +{ + /* If either mixdown popup includes 6-channel discrete, then allow up to 384 kbps*/ + if ([[fAudTrack1MixPopUp selectedItem] tag] == HB_AMIXDOWN_6CH || [[fAudTrack2MixPopUp selectedItem] tag] == HB_AMIXDOWN_6CH) + { + [fAudBitratePopUp removeAllItems]; + for( int i = 0; i < hb_audio_bitrates_count; i++ ) + { + [fAudBitratePopUp addItemWithTitle: + [NSString stringWithCString: hb_audio_bitrates[i].string]]; + } + [fAudBitratePopUp selectItemAtIndex: 14]; + } + /* Otherwise, cap the bitrate dropdown at 160 which is 9 in the array and use + the default bitrate from common.c*/ + else + { + [fAudBitratePopUp removeAllItems]; + for( int i = 0; i < 10; i++ ) + { + [fAudBitratePopUp addItemWithTitle: + [NSString stringWithCString: hb_audio_bitrates[i].string]]; + } + [fAudBitratePopUp selectItemAtIndex: hb_audio_bitrates_default]; + } +} /* lets set the picture size back to the max from right after title scan Lets use an IBAction here as down the road we could always use a checkbox in the gui to easily take the user back to max. Remember, the compiler diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib index f8a322a43..64874fea7 100644 --- a/macosx/English.lproj/MainMenu.nib/classes.nib +++ b/macosx/English.lproj/MainMenu.nib/classes.nib @@ -6,6 +6,7 @@ AddPreset = id; AddToQueue = id; AddUserPreset = id; + AudioTrackMixdownChanged = id; AudioTrackPopUpChanged = id; BrowseFile = id; CalculateBitrate = id; diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index 7697e335e..4c6bad6db 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -19,7 +19,7 @@ </array> <key>IBOpenObjects</key> <array> - <integer>29</integer> + <integer>21</integer> </array> <key>IBSystem Version</key> <string>8P2137</string> diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib Binary files differindex ef7530316..8ae8d0aa2 100644 --- a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib +++ b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib |