Skip to content

Commit

Permalink
WinGui: Support for AAC and MP3 Passthru added + change default audio…
Browse files Browse the repository at this point in the history
… mode setting to 0 to prevent crash.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4158 b64f7644-9d1e-0410-96f1-a4d463321fa5
  • Loading branch information
sr55 committed Aug 7, 2011
1 parent c24d8dd commit 439b0a6
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 6 deletions.
26 changes: 24 additions & 2 deletions win/CS/Controls/AudioPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ public void SetContainer(string path)
drp_audioEncoder.Items.Clear();
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.Faac));
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.ffaac));
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.AacPassthru));
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.Lame));
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.Mp3Passthru));
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.Ac3Passthrough));
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.Ac3));

if (path.Contains("MKV"))
{
drp_audioEncoder.Items.Add(EnumHelper<AudioEncoder>.GetDescription(AudioEncoder.DtsPassthrough));
Expand Down Expand Up @@ -162,7 +164,8 @@ public void LoadTracks(List<AudioTrack> tracks)

foreach (AudioTrack track in tracks)
{
if (track.Encoder == AudioEncoder.Ac3Passthrough || track.Encoder == AudioEncoder.DtsPassthrough || track.Encoder == AudioEncoder.DtsHDPassthrough)
if (track.Encoder == AudioEncoder.Ac3Passthrough || track.Encoder == AudioEncoder.DtsPassthrough ||
track.Encoder == AudioEncoder.DtsHDPassthrough || track.Encoder == AudioEncoder.AacPassthru || track.Encoder == AudioEncoder.Mp3Passthru)
{
track.MixDown = HandBrake.ApplicationServices.Model.Encoding.Mixdown.Passthrough;
track.Bitrate = 0;
Expand Down Expand Up @@ -271,6 +274,23 @@ private void ControlChanged(object sender, EventArgs e)
// Switch to AAC
drp_audioEncoder.SelectedIndex = 0;
}

// If the track isn't AAC, and the encoder is, change it.
if (track.Encoder == AudioEncoder.AacPassthru && !track.ScannedTrack.Format.Contains("aac"))
{
// Switch to AAC
drp_audioEncoder.SelectedIndex = 0;
}


// If the track isn't MP3, and the encoder is, change it.
if (track.Encoder == AudioEncoder.Mp3Passthru && !track.ScannedTrack.Format.Contains("mp3"))
{
// Switch to AAC
drp_audioEncoder.SelectedIndex = 0;
}


}
break;
case "drp_audioEncoder":
Expand Down Expand Up @@ -914,6 +934,8 @@ private void SetMixDown(string currentMixdown)
case "AC3 Passthru":
case "DTS Passthru":
case "DTS-HD Passthru":
case "AAC Passthru":
case "MP3 Passthru":
drp_audioMix.SelectedItem = Passthru;
break;
}
Expand Down
16 changes: 16 additions & 0 deletions win/CS/HandBrake.ApplicationServices/Functions/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public static string GetGUIAudioEncoder(string audioEnc)
case "copy:dts":
return "DTS Passthru";
case "copy:dtshd":
return "MP3 Passthru";
case "copy:mp3":
return "AAC Passthru";
case "copy:aac":
return "DTS-HD Passthru";
case "ffaac":
return "AAC (ffmpeg)";
Expand Down Expand Up @@ -181,6 +185,10 @@ public static AudioEncoder GetAudioEncoderFromCliString(string audioEnc)
return AudioEncoder.DtsPassthrough;
case "copy:dtshd":
return AudioEncoder.DtsHDPassthrough;
case "copy:mp3":
return AudioEncoder.Mp3Passthru;
case "copy:aac":
return AudioEncoder.AacPassthru;
default:
return AudioEncoder.Faac;
}
Expand Down Expand Up @@ -213,6 +221,10 @@ public static AudioEncoder GetAudioEncoder(string audioEnc)
return AudioEncoder.DtsPassthrough;
case "DTS-HD Passthru":
return AudioEncoder.DtsHDPassthrough;
case "AAC Passthru":
return AudioEncoder.AacPassthru;
case "MP3 Passthru":
return AudioEncoder.Mp3Passthru;
default:
return AudioEncoder.Faac;
}
Expand Down Expand Up @@ -247,6 +259,10 @@ public static string GetCliAudioEncoder(AudioEncoder selectedEncoder)
return "copy:dtshd";
case AudioEncoder.Ac3:
return "ac3";
case AudioEncoder.AacPassthru:
return "copy:aac";
case AudioEncoder.Mp3Passthru:
return "copy:mp3";

default:
return "faac";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public enum AudioEncoder
[Description("DTS-HD Passthru")]
DtsHDPassthrough,

[Description("AAC Passthru")]
AacPassthru,

[Description("MP3 Passthru")]
Mp3Passthru,

[Description("Vorbis (vorbis)")]
Vorbis
}
Expand Down
16 changes: 14 additions & 2 deletions win/CS/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion win/CS/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,16 @@
&lt;ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /&gt;</Value>
</Setting>
<Setting Name="DubModeAudio" Type="System.Int32" Scope="User">
<Value Profile="(Default)">4</Value>
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="DubModeSubtitle" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="addOnlyOneAudioPerLanguage" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="MinTitleLength" Type="System.String" Scope="User">
<Value Profile="(Default)">10</Value>
</Setting>
</Settings>
</SettingsFile>
2 changes: 1 addition & 1 deletion win/CS/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</value>
</setting>
<setting name="DubModeAudio" serializeAs="String">
<value>4</value>
<value>0</value>
</setting>
<setting name="DubModeSubtitle" serializeAs="String">
<value>0</value>
Expand Down

0 comments on commit 439b0a6

Please sign in to comment.