libhb: ui: add new presets key for track names (#6840)

Add AudioTrackNamePassthru and SubtitleTrackNamePassthru preset key to
preserve the existing track names, and AudioAutomaticNamingBehavior to
disable or enable the audio track automatic names.

Co-authored-by: sr55 <sr55.code@outlook.com>
This commit is contained in:
Damiano Galassi 2025-06-03 08:48:59 +02:00 committed by GitHub
parent 67485ebddf
commit 66fe47c548
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
45 changed files with 1571 additions and 167 deletions

View File

@ -550,11 +550,18 @@ audio_add_track(
if (atrack != NULL)
{
int layout = ghb_dict_get_int(atrack, "ChannelLayout");
const char * name = ghb_dict_get_string(atrack, "Name");
mix = ghb_get_best_mix(layout, encoder, mix);
if (name != NULL)
int keep_name = ghb_dict_get_int(settings, "AudioTrackNamePassthru");
const char * behavior_name = ghb_dict_get_string(settings, "AudioAutomaticNamingBehavior");
int behavior = hb_audio_autonaming_behavior_get_from_name(behavior_name);
const char * name = ghb_dict_get_string(atrack, "Name");
const char * generated_name = hb_audio_name_generate(name, layout, mix,
keep_name, behavior);
if (generated_name != NULL)
{
ghb_dict_set_string(asettings, "Name", name);
ghb_dict_set_string(asettings, "Name", generated_name);
}
}
ghb_dict_set_string(asettings, "Mixdown", hb_mixdown_get_short_name(mix));
@ -2287,6 +2294,14 @@ audio_fallback_widget_changed_cb (GtkWidget *widget, gpointer data)
ghb_clear_presets_selection(ud);
}
G_MODULE_EXPORT void
audio_autonaming_widget_changed_cb (GtkWidget *widget, gpointer data)
{
signal_user_data_t *ud = ghb_ud();
ghb_widget_to_setting(ud->settings, widget);
ghb_clear_presets_selection(ud);
}
G_MODULE_EXPORT void
audio_def_quality_enable_changed_cb (GtkWidget *widget, gpointer data)
{

View File

@ -49,6 +49,18 @@ typedef struct
options_map_t *map;
} combo_opts_t;
static options_map_t d_audio_autonaming_opts[] =
{
{N_("None"), "none", 0},
{N_("Unnamed"), "unnamed", 1},
{N_("All"), "all", 2},
};
combo_opts_t audio_autonaming_opts =
{
sizeof(d_audio_autonaming_opts)/sizeof(options_map_t),
d_audio_autonaming_opts
};
static options_map_t d_subtitle_track_sel_opts[] =
{
{N_("None"), "none", 0},
@ -575,6 +587,12 @@ combo_name_map_t combo_name_map[] =
small_opts_set,
generic_opt_get
},
{
"AudioAutomaticNamingBehavior",
&audio_autonaming_opts,
small_opts_set,
generic_opt_get
},
{
"AudioTrackSelectionBehavior",
&audio_track_sel_opts,

View File

@ -445,7 +445,12 @@ static GhbValue* subtitle_add_track(
strack = ghb_get_title_subtitle_track(settings, track);
source = ghb_dict_get_int(strack, "Source");
name = ghb_dict_get_string(strack, "Name");
int keep_name = ghb_dict_get_int(settings, "SubtitlesTrackNamePassthru");
if (keep_name)
{
name = ghb_dict_get_string(strack, "Name");
}
}
burn |= !hb_subtitle_can_pass(source, mux);

View File

@ -4767,6 +4767,15 @@ Overrides all other settings.</property>
<signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/>
</object>
</child>
<child>
<object class="GtkCheckButton" id="SubtitleTrackNamePassthru">
<property name="label" translatable="1">Passthru track names</property>
<property name="focusable">1</property>
<property name="tooltip-text" translatable="1">Preserve the source track names</property>
<property name="halign">start</property>
<signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/>
</object>
</child>
<child>
<object class="GtkBox" id="subtitle_burn_box">
<property name="spacing">4</property>
@ -5208,6 +5217,36 @@ This permits Opus passthru to be selected when automatic passthru selection is e
</child>
</object>
</child>
<child>
<object class="GtkCheckButton" id="AudioTrackNamePassthru">
<property name="label" translatable="yes">Passthru track names</property>
<property name="focusable">1</property>
<property name="tooltip-text" translatable="yes">Preserve the source track names.</property>
<property name="halign">start</property>
<property name="active">1</property>
<signal name="toggled" handler="audio_def_widget_changed_cb" swapped="no"/>
</object>
</child>
<child>
<object class="GtkBox" id="auto_autonaming_box">
<property name="spacing">6</property>
<property name="halign">end</property>
<child>
<object class="GtkLabel" id="labela5">
<property name="halign">end</property>
<property name="hexpand">1</property>
<property name="label" translatable="yes">Autonaming:</property>
</object>
</child>
<child>
<object class="GtkComboBox" id="AudioAutomaticNamingBehavior">
<property name="valign">center</property>
<property name="tooltip-text" translatable="yes">Set the automatic naming behaviour.</property>
<signal name="changed" handler="audio_autonaming_widget_changed_cb" swapped="no"/>
</object>
</child>
</object>
</child>
</object>
</child>
</object>

View File

@ -1468,6 +1468,87 @@ const hb_rate_t* hb_audio_bitrate_get_next(const hb_rate_t *last)
return ((hb_rate_internal_t*)last)->next;
}
const char * hb_audio_name_get_default(uint64_t layout, int mixdown)
{
int mix_channels = 2;
if (mixdown != HB_AMIXDOWN_NONE)
{
mix_channels = hb_mixdown_get_discrete_channel_count(mixdown);
}
else
{
mix_channels = hb_layout_get_discrete_channel_count(layout);
}
switch (mix_channels)
{
case 1:
return "Mono";
break;
case 2:
return "Stereo";
break;
default:
return "Surround";
break;
}
}
int hb_audio_autonaming_behavior_get_from_name(const char *name)
{
hb_audio_autonaming_behavior_t behavior = HB_AUDIO_AUTONAMING_NONE;
if (name)
{
if (!strcasecmp(name, "all"))
{
behavior = HB_AUDIO_AUTONAMING_ALL;
}
else if (!strcasecmp(name, "unnamed"))
{
behavior = HB_AUDIO_AUTONAMING_UNNAMED;
}
}
return behavior;
}
const char * hb_audio_name_generate(const char *name,
uint64_t layout, int mixdown, int keep_name,
hb_audio_autonaming_behavior_t behavior)
{
const char *out = NULL;
if (name == NULL || name[0] == 0)
{
name = NULL;
}
if (keep_name)
{
out = name;
}
if (name != NULL &&
(!strcmp(name, "Mono") ||
!strcmp(name, "Stereo") ||
!strcmp(name, "Surround")))
{
out = NULL;
}
if (behavior == HB_AUDIO_AUTONAMING_ALL ||
(behavior == HB_AUDIO_AUTONAMING_UNNAMED && (name == NULL || name[0] == 0)))
{
out = hb_audio_name_get_default(layout, mixdown);
}
return out;
}
// Get limits and hints for the UIs.
//
// granularity sets the minimum step increments that should be used

View File

@ -457,6 +457,22 @@ int hb_audio_bitrate_get_default(uint32_t codec, int samplerate, in
void hb_audio_bitrate_get_limits(uint32_t codec, int samplerate, int mixdown, int *low, int *high);
const hb_rate_t* hb_audio_bitrate_get_next(const hb_rate_t *last);
const char * hb_audio_name_get_default(uint64_t layout, int mixdown);
typedef enum
{
HB_AUDIO_AUTONAMING_NONE,
HB_AUDIO_AUTONAMING_UNNAMED,
HB_AUDIO_AUTONAMING_ALL
} hb_audio_autonaming_behavior_t;
int hb_audio_autonaming_behavior_get_from_name(const char *name);
const char * hb_audio_name_generate(const char *name,
uint64_t layout, int mixdown, int keep_name,
hb_audio_autonaming_behavior_t behaviour);
void hb_video_quality_get_limits(uint32_t codec, float *low, float *high, float *granularity, int *direction);
const char* hb_video_quality_get_name(uint32_t codec);

File diff suppressed because it is too large Load Diff

View File

@ -733,35 +733,17 @@ static int avformatInit( hb_mux_object_t * m )
track->st->codecpar->ch_layout = ch_layout;
}
const char *name;
if (audio->config.out.name == NULL)
{
switch (track->st->codecpar->ch_layout.nb_channels)
{
case 1:
name = "Mono";
break;
case 2:
name = "Stereo";
break;
default:
name = "Surround";
break;
}
}
else
{
name = audio->config.out.name;
}
// Set audio track title
av_dict_set(&track->st->metadata, "title", name, 0);
if (job->mux == HB_MUX_AV_MP4)
const char *name = audio->config.out.name;
if (name != NULL && name[0] != 0)
{
// Some software (MPC, mediainfo) use hdlr description
// for track title
av_dict_set(&track->st->metadata, "handler_name", name, 0);
av_dict_set(&track->st->metadata, "title", name, 0);
if (job->mux == HB_MUX_AV_MP4)
{
// Some software (MPC, mediainfo) use hdlr description
// for track title
av_dict_set(&track->st->metadata, "handler_name", name, 0);
}
}
}

View File

@ -853,15 +853,6 @@ static void add_audio_for_lang(hb_value_array_t *list, const hb_dict_t *preset,
hb_dict_set(audio_dict, "Track", hb_value_int(aconfig->index));
hb_dict_set(audio_dict, "Encoder", hb_value_string(
hb_audio_encoder_get_short_name(out_codec)));
const char * name = hb_dict_get_string(encoder_dict, "AudioTrackName");
if (name != NULL && name[0] != 0)
{
hb_dict_set_string(audio_dict, "Name", name);
}
else if (aconfig->in.name != NULL && aconfig->in.name[0] != 0)
{
hb_dict_set_string(audio_dict, "Name", aconfig->in.name);
}
if (!(out_codec & HB_ACODEC_PASS_FLAG))
{
if (hb_dict_get(encoder_dict, "AudioTrackGainSlider") != NULL)
@ -924,7 +915,34 @@ static void add_audio_for_lang(hb_value_array_t *list, const hb_dict_t *preset,
}
// Sanitize the settings before adding to the audio list
hb_sanitize_audio_settings(title, audio_dict);
hb_sanitize_audio_settings(title, audio_dict);
const char *name = hb_dict_get_string(encoder_dict, "AudioTrackName");
if (name != NULL && name[0] != 0)
{
hb_dict_set_string(audio_dict, "Name", name);
}
else
{
int mixdown = HB_INVALID_AMIXDOWN;
int keep_name = hb_value_get_bool(hb_dict_get(preset, "AudioTrackNamePassthru"));
hb_audio_autonaming_behavior_t behavior = HB_AUDIO_AUTONAMING_NONE;
const char *mixdown_name = hb_dict_get_string(audio_dict, "Mixdown");
mixdown = hb_mixdown_get_from_name(mixdown_name);
const char *behavior_name = hb_dict_get_string(preset, "AudioAutomaticNamingBehavior");
behavior = hb_audio_autonaming_behavior_get_from_name(behavior_name);
name = hb_audio_name_generate(aconfig->in.name,
aconfig->in.channel_layout,
mixdown, keep_name, behavior);
if (name != NULL && name[0] != 0)
{
hb_dict_set_string(audio_dict, "Name", name);
}
}
hb_value_array_append(list, audio_dict);
hb_dict_set(used, key, hb_value_bool(1));
@ -1109,7 +1127,7 @@ static int has_default_subtitle(hb_value_array_t *list)
}
static void add_subtitle_for_lang(hb_value_array_t *list, hb_title_t *title,
int mux, const char *lang,
int mux, const char *lang, int passthru_name,
subtitle_behavior_t *behavior)
{
int t;
@ -1140,7 +1158,8 @@ static void add_subtitle_for_lang(hb_value_array_t *list, hb_title_t *title,
if (!behavior->one_burned || hb_subtitle_can_pass(subtitle->source, mux))
{
add_subtitle(list, t, make_default, 0 /*!force*/, burn, subtitle->name);
add_subtitle(list, t, make_default, 0 /*!force*/, burn,
passthru_name ? subtitle->name : NULL);
}
behavior->burn_first &= !burn;
@ -1273,6 +1292,8 @@ int hb_preset_job_add_subtitles(hb_handle_t *h, int title_index,
const iso639_lang_t * lang_any = lang_get_any();
const char * pref_lang = lang_any->iso639_2;
int passthru_name = hb_value_get_bool(hb_dict_get(preset, "SubtitleTrackNamePassthru"));
count = hb_value_array_len(lang_list);
if (count > 0)
{
@ -1303,7 +1324,7 @@ int hb_preset_job_add_subtitles(hb_handle_t *h, int title_index,
behavior.one = 1;
behavior.burn_foreign = burn_foreign;
behavior.make_default = 1;
add_subtitle_for_lang(list, title, mux, pref_lang, &behavior);
add_subtitle_for_lang(list, title, mux, pref_lang, passthru_name, &behavior);
}
hb_dict_t *search_dict = hb_dict_get(subtitle_dict, "Search");
@ -1339,12 +1360,12 @@ int hb_preset_job_add_subtitles(hb_handle_t *h, int title_index,
{
const char *lang;
lang = hb_value_get_string(hb_value_array_get(lang_list, ii));
add_subtitle_for_lang(list, title, mux, lang, &behavior);
add_subtitle_for_lang(list, title, mux, lang, passthru_name, &behavior);
}
if (count <= 0)
{
// No languages in language list, assume "any"
add_subtitle_for_lang(list, title, mux, "any", &behavior);
add_subtitle_for_lang(list, title, mux, "any", passthru_name, &behavior);
}
}
@ -2974,6 +2995,13 @@ static void und_to_any(hb_value_array_t * list)
}
}
static void import_track_names_preset_settings_64_0_0(hb_value_t *preset)
{
hb_dict_set_string(preset, "AudioAutomaticNamingBehavior", "unnamed");
hb_dict_set_bool(preset, "AudioTrackNamePassthru", 1);
hb_dict_set_bool(preset, "SubtitleTrackNamePassthru", 1);
}
static void import_av1_preset_settings_63_0_0(hb_value_t *preset)
{
const char *enc = hb_dict_get_string(preset, "VideoEncoder");
@ -3766,10 +3794,16 @@ static void import_video_0_0_0(hb_value_t *preset)
}
}
static void import_64_0_0(hb_value_t *preset)
{
import_track_names_preset_settings_64_0_0(preset);
}
static void import_63_0_0(hb_value_t *preset)
{
import_av1_preset_settings_63_0_0(preset);
import_64_0_0(preset);
}
static void import_61_0_0(hb_value_t *preset)
@ -4021,6 +4055,11 @@ static int preset_import(hb_value_t *preset, int major, int minor, int micro)
import_63_0_0(preset);
result = 1;
}
else if (cmpVersion(major, minor, micro, 64, 0, 0) <= 0)
{
import_64_0_0(preset);
result = 1;
}
preset_clean(preset, hb_preset_template);
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23094" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23727" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23094"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23727"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -19,14 +19,14 @@
<window title="Audio Selection Behaviour" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" visibleAtLaunch="NO" animationBehavior="default" id="kwM-lz-5lG">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="54" y="544" width="800" height="474"/>
<rect key="contentRect" x="54" y="544" width="766" height="474"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<view key="contentView" id="ZP2-Cp-K5w">
<rect key="frame" x="0.0" y="0.0" width="828" height="474"/>
<view key="contentView" misplaced="YES" id="ZP2-Cp-K5w">
<rect key="frame" x="0.0" y="0.0" width="766" height="474"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sC2-52-liU">
<rect key="frame" x="750" y="13" width="64" height="27"/>
<rect key="frame" x="689" y="13" width="64" height="27"/>
<buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="kDe-1L-VkD">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu" size="11"/>
@ -40,7 +40,7 @@ DQ
</connections>
</button>
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8Pw-Kq-eMN">
<rect key="frame" x="516" y="292" width="223" height="138"/>
<rect key="frame" x="468" y="295" width="223" height="138"/>
<subviews>
<stackView distribution="fill" orientation="horizontal" alignment="top" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="OkV-lt-k7P">
<rect key="frame" x="0.0" y="24" width="223" height="114"/>
@ -332,7 +332,7 @@ DQ
</customSpacing>
</stackView>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="600" translatesAutoresizingMaskIntoConstraints="NO" id="RtZ-Cz-5mG">
<rect key="frame" x="18" y="264" width="253" height="14"/>
<rect key="frame" x="18" y="223" width="253" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Audio encoder settings for each selected track:" id="007-WM-RmC">
<font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -358,19 +358,19 @@ DQ
</connections>
</segmentedControl>
<scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="26" horizontalPageScroll="10" verticalLineScroll="26" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hGL-Ew-UVJ">
<rect key="frame" x="20" y="75" width="788" height="181"/>
<rect key="frame" x="20" y="75" width="727" height="140"/>
<clipView key="contentView" id="jkU-Fi-GCv">
<rect key="frame" x="1" y="1" width="786" height="179"/>
<rect key="frame" x="1" y="1" width="725" height="138"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" tableStyle="plain" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="24" rowSizeStyle="automatic" headerView="IbE-bD-EWJ" viewBased="YES" id="ZsG-T1-vGv">
<rect key="frame" x="0.0" y="0.0" width="786" height="156"/>
<rect key="frame" x="0.0" y="0.0" width="725" height="115"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="289.5" minWidth="143" maxWidth="1000" id="pR9-d4-SNf">
<tableColumn width="228.5" minWidth="143" maxWidth="1000" id="pR9-d4-SNf">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Codec">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
@ -383,11 +383,11 @@ DQ
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="UBy-AR-7XQ">
<rect key="frame" x="1" y="1" width="290" height="24"/>
<rect key="frame" x="1" y="1" width="228" height="24"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<popUpButton toolTip="Audio encoder." verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6lx-af-rBL">
<rect key="frame" x="-1" y="0.0" width="292" height="22"/>
<rect key="frame" x="-1" y="0.0" width="231" height="22"/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="t8s-X1-tQV">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu" size="11"/>
@ -425,11 +425,11 @@ DQ
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="uS1-Fd-V9I">
<rect key="frame" x="293.5" y="1" width="149" height="24"/>
<rect key="frame" x="232.5" y="1" width="150" height="24"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="igm-hS-rrD">
<rect key="frame" x="-1" y="0.0" width="151" height="22"/>
<rect key="frame" x="-1" y="0.0" width="152" height="22"/>
<string key="toolTip">Mixdown type. Controls how multi-channel audio is mixed into fewer channels, or whether the original channels are preserved.
Dolby Surround and Dolby Pro Logic II convert multi-channel audio to stereo and matrix encode additional channels for surround reproduction on compatible equipment, while maintaining stereo compatibility.</string>
@ -475,7 +475,7 @@ Dolby Surround and Dolby Pro Logic II convert multi-channel audio to stereo and
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="5No-Mm-bpD">
<rect key="frame" x="446" y="1" width="110" height="24"/>
<rect key="frame" x="385" y="1" width="109" height="24"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<popUpButton toolTip="Audio sample rate in kilohertz (kHz). Auto is recommended." verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="r80-yv-59n">
@ -519,11 +519,11 @@ Dolby Surround and Dolby Pro Logic II convert multi-channel audio to stereo and
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="Bxd-gI-dFS">
<rect key="frame" x="558.5" y="1" width="95" height="24"/>
<rect key="frame" x="497.5" y="1" width="96" height="24"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hHP-dw-nba">
<rect key="frame" x="-1" y="0.0" width="97" height="22"/>
<rect key="frame" x="-1" y="0.0" width="98" height="22"/>
<string key="toolTip">Audio bit rate in kilobits per second (kbps). Smaller values reduce audio quality. Larger values use more data and may be less compatible.</string>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="U8n-oy-hkv">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
@ -563,7 +563,7 @@ Dolby Surround and Dolby Pro Logic II convert multi-channel audio to stereo and
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="fhc-Nv-0Oh">
<rect key="frame" x="657" y="1" width="62" height="28"/>
<rect key="frame" x="596" y="1" width="62" height="28"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField toolTip="Audio gain in decibels (dB). Increases or decreases audio volume." focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xnA-03-Bul">
@ -613,7 +613,7 @@ Dolby Surround and Dolby Pro Logic II convert multi-channel audio to stereo and
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="t2K-5D-xsX">
<rect key="frame" x="722" y="1" width="62" height="27"/>
<rect key="frame" x="661" y="1" width="62" height="27"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<slider horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DGi-Dl-5nh">
@ -675,7 +675,7 @@ Values greater than 1 further increase the volume of quiet sounds. Values greate
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="140" id="4LW-Vv-px8"/>
</constraints>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="ToF-HP-PBf">
<rect key="frame" x="1" y="124" width="824" height="15"/>
<rect key="frame" x="1" y="123" width="724" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="Dhw-4v-YLa">
@ -683,7 +683,7 @@ Values greater than 1 further increase the volume of quiet sounds. Values greate
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" wantsLayer="YES" id="IbE-bD-EWJ">
<rect key="frame" x="0.0" y="0.0" width="786" height="23"/>
<rect key="frame" x="0.0" y="0.0" width="725" height="23"/>
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
</scrollView>
@ -699,7 +699,7 @@ Values greater than 1 further increase the volume of quiet sounds. Values greate
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kJY-av-BYf">
<rect key="frame" x="690" y="13" width="64" height="27"/>
<rect key="frame" x="629" y="13" width="64" height="27"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Jn4-1L-J1g">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu" size="11"/>
@ -722,10 +722,10 @@ Gw
</connections>
</button>
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mON-8C-X5t">
<rect key="frame" x="20" y="294" width="440" height="160"/>
<rect key="frame" x="20" y="253" width="392" height="204"/>
<subviews>
<stackView distribution="fill" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dYR-Xt-Vb4">
<rect key="frame" x="0.0" y="144" width="351" height="16"/>
<rect key="frame" x="0.0" y="188" width="351" height="16"/>
<subviews>
<textField focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="fPg-3n-1TN">
<rect key="frame" x="-2" y="1" width="138" height="14"/>
@ -772,10 +772,10 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
</customSpacing>
</stackView>
<stackView distribution="fill" orientation="horizontal" alignment="top" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GSL-ZN-P2c">
<rect key="frame" x="0.0" y="0.0" width="440" height="136"/>
<rect key="frame" x="0.0" y="0.0" width="392" height="180"/>
<subviews>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="Jsz-Er-bsF">
<rect key="frame" x="-2" y="122" width="138" height="14"/>
<rect key="frame" x="-2" y="166" width="138" height="14"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="Languages:" id="mAT-Jp-SG1">
<font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -783,19 +783,19 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
</textFieldCell>
</textField>
<scrollView toolTip="Select the languages to use with the Track Selection Behavior setting." wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="10" verticalLineScroll="16" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aTC-39-h6S">
<rect key="frame" x="142" y="0.0" width="298" height="136"/>
<rect key="frame" x="142" y="0.0" width="250" height="180"/>
<clipView key="contentView" ambiguous="YES" id="TdE-Sh-NcS">
<rect key="frame" x="1" y="1" width="296" height="134"/>
<rect key="frame" x="1" y="1" width="248" height="178"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="plain" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" rowHeight="14" viewBased="YES" id="Of7-71-Ci6">
<rect key="frame" x="0.0" y="0.0" width="296" height="134"/>
<rect key="frame" x="0.0" y="0.0" width="248" height="178"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn identifier="checkBox" width="217" minWidth="16" maxWidth="1000" id="G44-XP-6xE">
<tableColumn identifier="checkBox" width="245" minWidth="16" maxWidth="1000" id="G44-XP-6xE">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.33333298560000002" alpha="1" colorSpace="calibratedWhite"/>
@ -807,7 +807,7 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="haT-6q-XQu">
<rect key="frame" x="1" y="1" width="217" height="17"/>
<rect key="frame" x="1" y="1" width="245" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="F5N-kV-6cy">
@ -822,7 +822,7 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="249" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qqA-7S-cT9">
<rect key="frame" x="17" y="2" width="199" height="14"/>
<rect key="frame" x="17" y="2" width="227" height="14"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="XKL-2e-Dlv">
<font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -861,10 +861,10 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
</clipView>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="250" id="7Rp-Nn-e0h"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="136" id="u5x-I4-dLx"/>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="180" id="u5x-I4-dLx"/>
</constraints>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="bXf-U5-ogz">
<rect key="frame" x="1" y="157" width="258" height="15"/>
<rect key="frame" x="1" y="163" width="247" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="BWM-rq-VTg">
@ -895,27 +895,82 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jVF-av-Sw6">
<rect key="frame" x="571" y="265" width="99" height="16"/>
<buttonCell key="cell" type="check" title="Passthru name" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="XmJ-lo-ciO">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.settings.passthruName" id="Vdb-dy-WkL"/>
</connections>
</button>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bqY-oZ-Dez">
<rect key="frame" x="466" y="266" width="100" height="14"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="clipping" alignment="right" title="Track name:" id="aQn-7q-tQG">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8C3-yX-7tT">
<rect key="frame" x="568" y="238" width="120" height="22"/>
<popUpButtonCell key="cell" type="push" title="Off" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="AaG-rx-x5W" id="Rde-g8-st2">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
<menu key="menu" id="uDn-6R-tds">
<items>
<menuItem title="Off" state="on" id="AaG-rx-x5W"/>
<menuItem title="Unnamed Tracks" id="gjw-kg-H3W"/>
<menuItem title="All Tracks" id="s0U-gp-0sK"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<binding destination="-2" name="selectedIndex" keyPath="self.settings.automaticNamingBehavior" id="8SF-Vd-s3C"/>
</connections>
</popUpButton>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Sl3-PL-ybS">
<rect key="frame" x="466" y="243" width="100" height="14"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="clipping" alignment="right" title="Autonaming:" id="XOM-af-vzp">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="kJY-av-BYf" firstAttribute="width" secondItem="sC2-52-liU" secondAttribute="width" id="3US-QJ-5QL"/>
<constraint firstItem="Tth-IR-7cU" firstAttribute="leading" secondItem="bqY-oZ-Dez" secondAttribute="leading" id="6TO-Se-4Mn"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="RtZ-Cz-5mG" secondAttribute="trailing" constant="20" symbolic="YES" id="7dT-AF-zH9"/>
<constraint firstItem="mON-8C-X5t" firstAttribute="leading" secondItem="ZP2-Cp-K5w" secondAttribute="leading" constant="20" symbolic="YES" id="84z-cH-d09"/>
<constraint firstItem="kJY-av-BYf" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="M11-Ls-RrL" secondAttribute="trailing" constant="12" symbolic="YES" id="864-c4-BeW"/>
<constraint firstItem="M11-Ls-RrL" firstAttribute="top" secondItem="N4q-sT-WgW" secondAttribute="bottom" constant="15" id="AOo-Sb-GZW"/>
<constraint firstItem="8C3-yX-7tT" firstAttribute="leading" secondItem="Sl3-PL-ybS" secondAttribute="trailing" constant="8" symbolic="YES" id="AeR-Ps-v4g"/>
<constraint firstAttribute="trailing" secondItem="sC2-52-liU" secondAttribute="trailing" constant="20" id="B62-ty-pmI"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="8Pw-Kq-eMN" secondAttribute="trailing" constant="20" id="Fu8-nq-Vft"/>
<constraint firstAttribute="bottom" secondItem="M11-Ls-RrL" secondAttribute="bottom" constant="20" id="G1B-eX-eqE"/>
<constraint firstItem="uF5-6E-EIe" firstAttribute="leading" secondItem="N4q-sT-WgW" secondAttribute="trailing" constant="13" id="J0L-CA-XLI"/>
<constraint firstItem="8C3-yX-7tT" firstAttribute="firstBaseline" secondItem="Sl3-PL-ybS" secondAttribute="firstBaseline" id="Kp4-Za-XgQ"/>
<constraint firstItem="kJY-av-BYf" firstAttribute="baseline" secondItem="sC2-52-liU" secondAttribute="baseline" id="LdH-5O-jKo"/>
<constraint firstItem="Sl3-PL-ybS" firstAttribute="top" secondItem="bqY-oZ-Dez" secondAttribute="bottom" constant="9" id="Qq9-ES-dj1"/>
<constraint firstItem="RtZ-Cz-5mG" firstAttribute="leading" secondItem="ZP2-Cp-K5w" secondAttribute="leading" constant="20" id="R53-5h-0vJ"/>
<constraint firstAttribute="bottom" secondItem="sC2-52-liU" secondAttribute="bottom" constant="20" id="RRW-Y5-912"/>
<constraint firstItem="8Pw-Kq-eMN" firstAttribute="leading" secondItem="mON-8C-X5t" secondAttribute="trailing" constant="56" id="Wad-TB-7OD"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="8C3-yX-7tT" secondAttribute="trailing" constant="20" symbolic="YES" id="YpH-o8-mMO"/>
<constraint firstItem="jVF-av-Sw6" firstAttribute="leading" secondItem="bqY-oZ-Dez" secondAttribute="trailing" constant="8" symbolic="YES" id="ZNF-8f-XQc"/>
<constraint firstItem="bqY-oZ-Dez" firstAttribute="top" secondItem="Tth-IR-7cU" secondAttribute="bottom" constant="16" id="amj-wt-gHG"/>
<constraint firstItem="Tth-IR-7cU" firstAttribute="width" secondItem="bqY-oZ-Dez" secondAttribute="width" id="bZu-Zw-J4W"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="uF5-6E-EIe" secondAttribute="trailing" constant="20" symbolic="YES" id="cEr-2s-7rp"/>
<constraint firstItem="M11-Ls-RrL" firstAttribute="leading" secondItem="N4q-sT-WgW" secondAttribute="leading" id="fBT-WX-Q5Z"/>
<constraint firstAttribute="trailing" secondItem="hGL-Ew-UVJ" secondAttribute="trailing" constant="20" id="glz-Tw-AyY"/>
<constraint firstItem="hGL-Ew-UVJ" firstAttribute="top" secondItem="RtZ-Cz-5mG" secondAttribute="bottom" constant="8" id="jhe-0p-LYz"/>
<constraint firstItem="mON-8C-X5t" firstAttribute="top" secondItem="ZP2-Cp-K5w" secondAttribute="top" constant="20" symbolic="YES" id="kni-de-kzf"/>
<constraint firstItem="uF5-6E-EIe" firstAttribute="centerY" secondItem="N4q-sT-WgW" secondAttribute="centerY" id="nJR-6O-xLy"/>
<constraint firstItem="jVF-av-Sw6" firstAttribute="firstBaseline" secondItem="bqY-oZ-Dez" secondAttribute="firstBaseline" id="qco-nx-Mur"/>
<constraint firstItem="Sl3-PL-ybS" firstAttribute="width" secondItem="bqY-oZ-Dez" secondAttribute="width" id="qf8-02-v7L"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="jVF-av-Sw6" secondAttribute="trailing" constant="20" symbolic="YES" id="sOd-JV-Xyo"/>
<constraint firstItem="bqY-oZ-Dez" firstAttribute="leading" secondItem="Sl3-PL-ybS" secondAttribute="leading" id="u0J-Vk-x2O"/>
<constraint firstItem="sC2-52-liU" firstAttribute="leading" secondItem="kJY-av-BYf" secondAttribute="trailing" constant="8" id="vZI-9R-5tO"/>
<constraint firstItem="N4q-sT-WgW" firstAttribute="top" secondItem="hGL-Ew-UVJ" secondAttribute="bottom" constant="8" id="w2O-Xt-Vdr"/>
<constraint firstItem="RtZ-Cz-5mG" firstAttribute="top" secondItem="GSL-ZN-P2c" secondAttribute="bottom" constant="16" id="wcv-WR-Xhf"/>
@ -927,7 +982,7 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
<connections>
<outlet property="initialFirstResponder" destination="oiD-QI-wly" id="Vxi-xi-P0d"/>
</connections>
<point key="canvasLocation" x="-1567" y="-303"/>
<point key="canvasLocation" x="-1557" y="-368"/>
</window>
<arrayController objectClassName="HBLang" id="ZBe-aP-wvq" userLabel="Languages Table Controller" customClass="HBLanguageArrayController">
<declaredKeys>

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23727" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22689"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23727"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@ -17,14 +17,14 @@
<window title="Subtitles Selection Behaviour" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" visibleAtLaunch="NO" animationBehavior="default" id="kwM-lz-5lG">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="283" y="305" width="427" height="422"/>
<rect key="contentRect" x="283" y="305" width="427" height="439"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<view key="contentView" misplaced="YES" id="ZP2-Cp-K5w">
<rect key="frame" x="0.0" y="0.0" width="427" height="422"/>
<rect key="frame" x="0.0" y="0.0" width="427" height="439"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="fPg-3n-1TN">
<rect key="frame" x="18" y="368" width="138" height="14"/>
<rect key="frame" x="18" y="401" width="138" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Track Selection Behavior:" id="GbM-vm-RC2">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -32,7 +32,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="Jsz-Er-bsF">
<rect key="frame" x="18" y="345" width="138" height="14"/>
<rect key="frame" x="18" y="378" width="138" height="14"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" alignment="right" title="Languages:" id="mAT-Jp-SG1">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -40,7 +40,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="Hqz-Lw-gAu">
<rect key="frame" x="18" y="185" width="138" height="14"/>
<rect key="frame" x="18" y="211" width="138" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Options:" id="NJl-q3-zXL">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -48,7 +48,7 @@
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="oiD-QI-wly">
<rect key="frame" x="158" y="363" width="253" height="22"/>
<rect key="frame" x="158" y="396" width="253" height="22"/>
<string key="toolTip">Track Selection Behavior.
None will not select any audio tracks by default.
@ -73,7 +73,7 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
</connections>
</popUpButton>
<button toolTip="Add Closed Caption subtitles as a soft subtitle track (not burned-in)." translatesAutoresizingMaskIntoConstraints="NO" id="uF5-6E-EIe">
<rect key="frame" x="161" y="184" width="246" height="16"/>
<rect key="frame" x="161" y="210" width="246" height="16"/>
<buttonCell key="cell" type="check" title="Add Closed Captions when available" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="66v-2g-DHn">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
@ -83,7 +83,7 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
</connections>
</button>
<button toolTip="Foreign Audio Search scans the source for short sequences of foreign or alien audio that are displayed by default." verticalHuggingPriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="OOC-GZ-OFA">
<rect key="frame" x="161" y="164" width="246" height="16"/>
<rect key="frame" x="161" y="190" width="246" height="16"/>
<buttonCell key="cell" type="check" title="Add Foreign Audio Search" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="vNY-OC-hTJ">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
@ -93,13 +93,13 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
</connections>
</button>
<scrollView toolTip="Select the languages to use with the Track Selection Behavior setting." wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="16" horizontalPageScroll="10" verticalLineScroll="16" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aTC-39-h6S">
<rect key="frame" x="162" y="219" width="245" height="140"/>
<rect key="frame" x="162" y="245" width="245" height="147"/>
<clipView key="contentView" id="TdE-Sh-NcS">
<rect key="frame" x="1" y="1" width="243" height="138"/>
<rect key="frame" x="1" y="1" width="243" height="145"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="plain" columnReordering="NO" columnResizing="NO" autosaveColumns="NO" rowHeight="14" viewBased="YES" id="Of7-71-Ci6">
<rect key="frame" x="0.0" y="0.0" width="243" height="138"/>
<rect key="frame" x="0.0" y="0.0" width="243" height="145"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -181,7 +181,7 @@ All Matching Selected Languages adds all audio tracks matching each of the selec
<accessibility description="Subtitles Track Languages"/>
</scrollView>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Lsa-kB-2BP">
<rect key="frame" x="158" y="130" width="253" height="22"/>
<rect key="frame" x="158" y="156" width="253" height="22"/>
<string key="toolTip">Burn-In Behavior. Select which subtitles to make permanent by overlaying them onto the video track.
Only one subtitles track can be burned in.</string>
@ -203,7 +203,7 @@ Only one subtitles track can be burned in.</string>
</connections>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="qAf-lQ-GN4">
<rect key="frame" x="18" y="135" width="138" height="14"/>
<rect key="frame" x="18" y="161" width="138" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Burn-In Behavior:" id="640-NB-Uby">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -211,7 +211,7 @@ Only one subtitles track can be burned in.</string>
</textFieldCell>
</textField>
<button verticalHuggingPriority="752" translatesAutoresizingMaskIntoConstraints="NO" id="ceZ-On-t5S">
<rect key="frame" x="161" y="111" width="246" height="16"/>
<rect key="frame" x="161" y="137" width="246" height="16"/>
<string key="toolTip">Burn in the first selected DVD subtitle track. All other DVD subtitle tracks will be discarded. Use this option if your playback software or device does not support DVD subtitles.
Only one subtitles track can be burned in.</string>
@ -224,7 +224,7 @@ Only one subtitles track can be burned in.</string>
</connections>
</button>
<button verticalHuggingPriority="752" translatesAutoresizingMaskIntoConstraints="NO" id="Px8-G6-NVX">
<rect key="frame" x="161" y="91" width="246" height="16"/>
<rect key="frame" x="161" y="117" width="246" height="16"/>
<string key="toolTip">Burn in the first selected Blu-ray subtitle track. All other Blu-ray subtitle tracks will be discarded. Use this option if your playback software or device does not support Blu-ray subtitles.
Only one subtitles track can be burned in.</string>
@ -237,7 +237,7 @@ Only one subtitles track can be burned in.</string>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="MlS-tB-pEv">
<rect key="frame" x="160" y="56" width="249" height="28"/>
<rect key="frame" x="160" y="82" width="249" height="28"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="Only one subtitles burn-in option will be applied, starting with the first (top)." id="N4s-K9-RwM">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -280,6 +280,24 @@ Gw
<action selector="openUserGuide:" target="-2" id="xuY-gI-DkB"/>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3vE-dK-KLk">
<rect key="frame" x="161" y="51" width="129" height="16"/>
<buttonCell key="cell" type="check" title="Passthru track name" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="KXY-tz-asI">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.settings.passthruName" id="SKv-zB-Qs7"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="cG8-2W-cdJ">
<rect key="frame" x="18" y="52" width="138" height="14"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="clipping" alignment="right" title="Name:" id="Nks-nt-ePt">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="ceZ-On-t5S" secondAttribute="trailing" constant="20" id="1s9-9K-9py"/>
@ -290,6 +308,8 @@ Gw
<constraint firstAttribute="bottom" secondItem="nfu-VW-cTe" secondAttribute="bottom" constant="18" id="D3B-WT-db0"/>
<constraint firstAttribute="trailing" secondItem="oiD-QI-wly" secondAttribute="trailing" constant="20" id="DCH-xM-c7M"/>
<constraint firstItem="MlS-tB-pEv" firstAttribute="top" secondItem="Px8-G6-NVX" secondAttribute="bottom" constant="8" id="DuC-dI-6lg"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="3vE-dK-KLk" secondAttribute="trailing" constant="20" symbolic="YES" id="Fw1-iS-A7M"/>
<constraint firstItem="3vE-dK-KLk" firstAttribute="firstBaseline" secondItem="cG8-2W-cdJ" secondAttribute="firstBaseline" id="JNR-Jt-OcH"/>
<constraint firstItem="Lsa-kB-2BP" firstAttribute="top" secondItem="OOC-GZ-OFA" secondAttribute="bottom" constant="15" id="Jom-Wb-udi"/>
<constraint firstItem="qAf-lQ-GN4" firstAttribute="baseline" secondItem="Lsa-kB-2BP" secondAttribute="baseline" id="LsD-LD-mET"/>
<constraint firstItem="OOC-GZ-OFA" firstAttribute="top" secondItem="uF5-6E-EIe" secondAttribute="bottom" constant="6" id="Niq-4w-rB0"/>
@ -302,21 +322,25 @@ Gw
<constraint firstItem="AAX-DK-L3G" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="nfu-VW-cTe" secondAttribute="trailing" constant="12" symbolic="YES" id="U3Y-Zd-acm"/>
<constraint firstItem="QdJ-64-GgC" firstAttribute="width" secondItem="AAX-DK-L3G" secondAttribute="width" id="V7Q-Z0-mdN"/>
<constraint firstItem="Jsz-Er-bsF" firstAttribute="top" secondItem="aTC-39-h6S" secondAttribute="top" id="Vjm-7V-1cC"/>
<constraint firstItem="QdJ-64-GgC" firstAttribute="top" secondItem="3vE-dK-KLk" secondAttribute="bottom" constant="16" id="WEY-dd-Wkc"/>
<constraint firstItem="OOC-GZ-OFA" firstAttribute="leading" secondItem="uF5-6E-EIe" secondAttribute="leading" id="WKZ-HH-AyA"/>
<constraint firstItem="fPg-3n-1TN" firstAttribute="baseline" secondItem="oiD-QI-wly" secondAttribute="baseline" id="XJA-tm-IJd"/>
<constraint firstAttribute="bottom" secondItem="QdJ-64-GgC" secondAttribute="bottom" constant="20" id="XzF-Bn-tMl"/>
<constraint firstItem="Hqz-Lw-gAu" firstAttribute="baseline" secondItem="uF5-6E-EIe" secondAttribute="baseline" id="bmT-Td-cBg"/>
<constraint firstItem="qAf-lQ-GN4" firstAttribute="width" secondItem="cG8-2W-cdJ" secondAttribute="width" id="eGt-Fw-FBt"/>
<constraint firstItem="cG8-2W-cdJ" firstAttribute="leading" secondItem="qAf-lQ-GN4" secondAttribute="leading" id="esk-Pa-eI1"/>
<constraint firstItem="ceZ-On-t5S" firstAttribute="top" secondItem="Lsa-kB-2BP" secondAttribute="bottom" constant="8" id="fZD-U2-nWu"/>
<constraint firstItem="Lsa-kB-2BP" firstAttribute="leading" secondItem="qAf-lQ-GN4" secondAttribute="trailing" constant="8" id="fl7-9l-tFW"/>
<constraint firstItem="aTC-39-h6S" firstAttribute="trailing" secondItem="oiD-QI-wly" secondAttribute="trailing" id="hq2-2Y-G4l"/>
<constraint firstAttribute="trailing" secondItem="OOC-GZ-OFA" secondAttribute="trailing" constant="20" id="htF-X4-lpu"/>
<constraint firstItem="Px8-G6-NVX" firstAttribute="top" secondItem="ceZ-On-t5S" secondAttribute="bottom" constant="6" id="iWq-sE-ajq"/>
<constraint firstItem="QdJ-64-GgC" firstAttribute="top" secondItem="MlS-tB-pEv" secondAttribute="bottom" constant="20" id="iyr-A8-UM6"/>
<constraint firstItem="ceZ-On-t5S" firstAttribute="leading" secondItem="Lsa-kB-2BP" secondAttribute="leading" id="koA-TF-GxL"/>
<constraint firstAttribute="trailing" secondItem="uF5-6E-EIe" secondAttribute="trailing" constant="20" id="l0V-di-L2v"/>
<constraint firstItem="3vE-dK-KLk" firstAttribute="top" secondItem="MlS-tB-pEv" secondAttribute="bottom" constant="16" id="md4-pt-JHF"/>
<constraint firstItem="uF5-6E-EIe" firstAttribute="top" secondItem="aTC-39-h6S" secondAttribute="bottom" constant="20" id="nhU-5A-Rap"/>
<constraint firstItem="qAf-lQ-GN4" firstAttribute="leading" secondItem="fPg-3n-1TN" secondAttribute="leading" id="o90-wY-3FL"/>
<constraint firstItem="Hqz-Lw-gAu" firstAttribute="leading" secondItem="fPg-3n-1TN" secondAttribute="leading" id="p6B-ac-s9o"/>
<constraint firstItem="3vE-dK-KLk" firstAttribute="leading" secondItem="cG8-2W-cdJ" secondAttribute="trailing" constant="8" symbolic="YES" id="qUo-3Y-s7Q"/>
<constraint firstItem="aTC-39-h6S" firstAttribute="leading" secondItem="Jsz-Er-bsF" secondAttribute="trailing" constant="8" id="rLi-Pt-pSb"/>
<constraint firstItem="fPg-3n-1TN" firstAttribute="leading" secondItem="ZP2-Cp-K5w" secondAttribute="leading" constant="20" id="rjw-eY-hZF"/>
<constraint firstItem="MlS-tB-pEv" firstAttribute="leading" secondItem="Px8-G6-NVX" secondAttribute="leading" id="sKB-2V-Vpl"/>
@ -329,7 +353,7 @@ Gw
<constraint firstItem="qAf-lQ-GN4" firstAttribute="width" secondItem="fPg-3n-1TN" secondAttribute="width" id="zyM-7a-twX"/>
</constraints>
</view>
<point key="canvasLocation" x="74.5" y="97.5"/>
<point key="canvasLocation" x="0.5" y="98.5"/>
</window>
<arrayController objectClassName="HBLang" id="ZBe-aP-wvq" userLabel="Table Controller" customClass="HBLanguageArrayController">
<declaredKeys>

View File

@ -54,6 +54,18 @@ NSString *HBAudioEncoderChangedNotification = @"HBAudioEncoderChangedNotificatio
#pragma mark - Data Source
- (nullable NSString *)defaultTitleForTrackAtIndex:(NSUInteger)idx mixdown:(int)mixdown
{
HBTitleAudioTrack *track = [self sourceTrackAtIndex:idx];
const char *title = hb_audio_name_generate(track.title.UTF8String,
track.channelLayout, mixdown,
self.defaults.passthruName,
(hb_audio_autonaming_behavior_t)self.defaults.automaticNamingBehavior);
return title ? @(title) : nil;
}
- (HBTitleAudioTrack *)sourceTrackAtIndex:(NSUInteger)idx
{
return self.sourceTracks[idx];
@ -182,6 +194,7 @@ NSString *HBAudioEncoderChangedNotification = @"HBAudioEncoderChangedNotificatio
{
HBAudioTrack *track = [[HBAudioTrack alloc] initWithTrackIdx:trackIndex container:self.container dataSource:self delegate:self];
track.undo = self.undo;
return track;
}
@ -223,6 +236,7 @@ NSString *HBAudioEncoderChangedNotification = @"HBAudioEncoderChangedNotificatio
track.sampleRate = [trackDict[@"Samplerate"] intValue] == -1 ? 0 : [trackDict[@"Samplerate"] intValue];
track.bitRate = [trackDict[@"Bitrate"] intValue];
track.encoder = hb_audio_encoder_get_from_name([trackDict[@"Encoder"] UTF8String]);
track.title = [trackDict[@"Name"] stringValue];
[tracks addObject:track];
}

View File

@ -17,6 +17,12 @@ typedef NS_ENUM(NSUInteger, HBAudioTrackSelectionBehavior) {
HBAudioTrackSelectionBehaviorAll,
};
typedef NS_ENUM(NSUInteger, HBAudioTrackAutomaticNamingBehavior) {
HBAudioTrackAutomaticNamingBehaviorNone,
HBAudioTrackAutomaticNamingBehaviorUnnamed,
HBAudioTrackAutomaticNamingBehaviorAll,
};
/**
* HBAudioSettings
* Stores the audio defaults (selection behavior) settings.
@ -50,6 +56,9 @@ typedef NS_ENUM(NSUInteger, HBAudioTrackSelectionBehavior) {
@property(nonatomic, readonly) NSArray<NSString *> *audioEncoderFallbacks;
@property(nonatomic, readwrite) BOOL passthruName;
@property(nonatomic, readwrite) HBAudioTrackAutomaticNamingBehavior automaticNamingBehavior;
- (void)validateEncoderFallbackForVideoContainer:(int)container;
@property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;

View File

@ -23,12 +23,15 @@
- (instancetype)init
{
self = [super init];
if (self) {
if (self)
{
_encoderFallback = HB_ACODEC_AC3;
_trackSelectionLanguages = [[NSMutableArray alloc] init];
_tracksArray = [[NSMutableArray alloc] init];
_trackSelectionBehavior = HBAudioTrackSelectionBehaviorFirst;
_container = HB_MUX_MKV;
_passthruName = NO;
_automaticNamingBehavior = HBAudioTrackAutomaticNamingBehaviorNone;
}
return self;
}
@ -208,6 +211,24 @@
return fallbacks;
}
- (void)setPassthruName:(BOOL)passthruName
{
if (passthruName != _passthruName)
{
[[self.undo prepareWithInvocationTarget:self] setPassthruName:_passthruName];
}
_passthruName = passthruName;
}
- (void)setautomaticNamingBehavior:(HBAudioTrackAutomaticNamingBehavior)automaticNamingBehavior
{
if (automaticNamingBehavior != _automaticNamingBehavior)
{
[[self.undo prepareWithInvocationTarget:self] setautomaticNamingBehavior:_automaticNamingBehavior];
}
_automaticNamingBehavior = automaticNamingBehavior;
}
#pragma mark - HBPresetCoding
- (BOOL)applyPreset:(HBPreset *)preset error:(NSError * __autoreleasing *)outError
@ -303,6 +324,25 @@
self.encoderFallback = hb_audio_encoder_get_from_name([preset[@"AudioEncoderFallback"] UTF8String]);
}
self.passthruName = [preset[@"AudioTrackNamePassthru"] boolValue];
NSString *automaticNamingBehavior = [preset[@"AudioAutomaticNamingBehavior"] stringValue];
if ([automaticNamingBehavior isKindOfClass:[NSString class]])
{
if ([automaticNamingBehavior isEqualToString:@"none"])
{
self.automaticNamingBehavior = HBAudioTrackAutomaticNamingBehaviorNone;
}
else if ([automaticNamingBehavior isEqualToString:@"unnamed"])
{
self.automaticNamingBehavior = HBAudioTrackAutomaticNamingBehaviorUnnamed;
}
else if ([automaticNamingBehavior isEqualToString:@"all"])
{
self.automaticNamingBehavior = HBAudioTrackAutomaticNamingBehaviorAll;
}
}
while ([self countOfTracksArray])
{
[self removeObjectFromTracksArrayAtIndex:0];
@ -419,6 +459,22 @@
preset[@"AudioSecondaryEncoderMode"] = @(self.secondaryEncoderMode);
preset[@"AudioTrackNamePassthru"] = @(self.passthruName);
switch (self.automaticNamingBehavior)
{
case HBAudioTrackAutomaticNamingBehaviorNone:
preset[@"AudioAutomaticNamingBehavior"] = @"none";
break;
case HBAudioTrackAutomaticNamingBehaviorUnnamed:
preset[@"AudioAutomaticNamingBehavior"] = @"unnamed";
break;
case HBAudioTrackAutomaticNamingBehaviorAll:
default:
preset[@"AudioAutomaticNamingBehavior"] = @"all";
break;
}
NSMutableArray<NSDictionary *> *audioList = [[NSMutableArray alloc] init];
for (HBAudioTrackPreset *track in self.tracksArray)
@ -504,6 +560,9 @@
copy->_encoderFallback = _encoderFallback;
copy->_container = _container;
copy->_secondaryEncoderMode = _secondaryEncoderMode;
copy->_passthruName = _passthruName;
copy->_automaticNamingBehavior = _automaticNamingBehavior;
}
return copy;
@ -539,6 +598,9 @@
encodeInt(_encoderFallback);
encodeInt(_container);
encodeBool(_secondaryEncoderMode);
encodeBool(_passthruName);
encodeInteger(_automaticNamingBehavior);
}
- (instancetype)initWithCoder:(NSCoder *)decoder
@ -569,6 +631,14 @@
decodeInt(_container); if (_container != HB_MUX_MP4 && _container != HB_MUX_MKV && _container != HB_MUX_WEBM) { goto fail; }
decodeBool(_secondaryEncoderMode);
decodeBool(_passthruName);
decodeInt(_automaticNamingBehavior);
if (_automaticNamingBehavior < HBAudioTrackAutomaticNamingBehaviorNone || _automaticNamingBehavior > HBAudioTrackAutomaticNamingBehaviorAll)
{
goto fail;
}
return self;
fail:

View File

@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol HBAudioTrackDataSource <NSObject>
- (HBTitleAudioTrack *)sourceTrackAtIndex:(NSUInteger)idx;
- (NSArray<NSString *> *)sourceTracksArray;
- (nullable NSString *)defaultTitleForTrackAtIndex:(NSUInteger)idx mixdown:(int)mixdown;
@end
@protocol HBAudioTrackDelegate <NSObject>

View File

@ -43,7 +43,6 @@
_dataSource = dataSource;
_sourceTrackIdx = index;
_container = container;
self.title = [dataSource sourceTrackAtIndex:_sourceTrackIdx].title;
[self validateSettings];
@ -90,10 +89,11 @@
if (!(self.undo.isUndoing || self.undo.isRedoing))
{
self.title = [self.dataSource sourceTrackAtIndex:_sourceTrackIdx].title;
[self validateSettings];
self.title = [self.dataSource defaultTitleForTrackAtIndex:_sourceTrackIdx
mixdown:_mixdown];
if (oldIdx != sourceTrackIdx)
{
[self.delegate track:self didChangeSourceFrom:oldIdx];
@ -149,6 +149,15 @@
{
self.validating = YES;
self.bitRate = [self sanitizeBitrateValue:self.bitRate];
if ([self.title isEqualToString:@"Mono"] ||
[self.title isEqualToString:@"Stereo"] ||
[self.title isEqualToString:@"Surround"])
{
self.title = [self.dataSource defaultTitleForTrackAtIndex:_sourceTrackIdx
mixdown:_mixdown];
}
self.validating = NO;
}
}
@ -219,13 +228,6 @@
- (void)setTitle:(NSString *)title
{
if ([title isEqualToString:@"Mono"] ||
[title isEqualToString:@"Stereo"] ||
[title isEqualToString:@"Surround"])
{
title = nil;
}
if (title != _title)
{
[[self.undo prepareWithInvocationTarget:self] setTitle:_title];

View File

@ -22,7 +22,7 @@
#define NONE_TRACK_INDEX 0
#define FOREIGN_TRACK_INDEX 1
@interface HBSubtitles () <HBTrackDataSource, HBTrackDelegate>
@interface HBSubtitles () <HBSubtitlesTrackDataSource, HBSubtitlesTrackDelegate>
@property (nonatomic, readwrite) NSArray<HBTitleSubtitlesTrack *> *sourceTracks;
@ -93,6 +93,19 @@
return sourceNames;
}
- (nullable NSString *)defaultTitleForTrackAtIndex:(NSUInteger)idx
{
NSString *title = nil;
HBTitleSubtitlesTrack *track = [self sourceTrackAtIndex:idx];
if (self.defaults.passthruName)
{
title = track.title;
}
return title;
}
#pragma mark - Delegate
- (void)track:(HBSubtitlesTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx
@ -316,6 +329,7 @@
{
track.burnedIn = [trackDict[@"Burn"] boolValue];
track.forcedOnly = [trackDict[@"Forced"] boolValue];
track.title = [trackDict[@"Name"] stringValue];
[tracks addObject:track];
}

View File

@ -35,6 +35,8 @@ typedef NS_ENUM(NSUInteger, HBSubtitleTrackBurnInBehavior) {
@property (nonatomic, readwrite) BOOL burnInDVDSubtitles;
@property (nonatomic, readwrite) BOOL burnInBluraySubtitles;
@property (nonatomic, readwrite) BOOL passthruName;
@property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;
@end

View File

@ -16,6 +16,7 @@
if (self)
{
_trackSelectionLanguages = [[NSMutableArray alloc] init];
_passthruName = NO;
}
return self;
}
@ -85,6 +86,15 @@
_burnInBluraySubtitles = burnInBluraySubtitles;
}
- (void)setPassthruName:(BOOL)passthruName
{
if (passthruName != _passthruName)
{
[[self.undo prepareWithInvocationTarget:self] setPassthruName:_passthruName];
}
_passthruName = passthruName;
}
#pragma mark - HBPresetCoding
- (BOOL)applyPreset:(HBPreset *)preset error:(NSError * __autoreleasing *)outError
@ -128,6 +138,8 @@
self.burnInDVDSubtitles = [preset[@"SubtitleBurnDVDSub"] boolValue];
self.burnInBluraySubtitles = [preset[@"SubtitleBurnBDSub"] boolValue];
self.passthruName = [preset[@"SubtitleTrackNamePassthru"] boolValue];
return YES;
}
@ -175,6 +187,9 @@
preset[@"SubtitleBurnDVDSub"] = @(self.burnInDVDSubtitles);
preset[@"SubtitleBurnBDSub"] = @(self.burnInBluraySubtitles);
preset[@"SubtitleTrackNamePassthru"] = @(self.passthruName);
}
#pragma mark - NSCopying
@ -195,6 +210,8 @@
copy->_burnInBehavior = _burnInBehavior;
copy->_burnInDVDSubtitles = _burnInDVDSubtitles;
copy->_burnInBluraySubtitles = _burnInBluraySubtitles;
copy->_passthruName = _passthruName;
}
return copy;
@ -221,6 +238,8 @@
encodeInteger(_burnInBehavior);
encodeBool(_burnInDVDSubtitles);
encodeBool(_burnInBluraySubtitles);
encodeBool(_passthruName);
}
- (instancetype)initWithCoder:(NSCoder *)decoder
@ -246,6 +265,8 @@
decodeBool(_burnInDVDSubtitles);
decodeBool(_burnInBluraySubtitles);
decodeBool(_passthruName);
return self;
fail:

View File

@ -14,15 +14,16 @@ NS_ASSUME_NONNULL_BEGIN
/**
* HBTrackDataSource
*/
@protocol HBTrackDataSource <NSObject>
@protocol HBSubtitlesTrackDataSource <NSObject>
- (HBTitleSubtitlesTrack *)sourceTrackAtIndex:(NSUInteger)idx;
- (NSArray<NSString *> *)sourceTracksArray;
- (nullable NSString *)defaultTitleForTrackAtIndex:(NSUInteger)idx;
@end
/**
* HBTrackDelegate
*/
@protocol HBTrackDelegate <NSObject>
@protocol HBSubtitlesTrackDelegate <NSObject>
- (void)track:(HBSubtitlesTrack *)track didChangeSourceFrom:(NSUInteger)oldSourceIdx;
- (BOOL)canSetBurnedInOption:(HBSubtitlesTrack *)track;
@ -35,8 +36,8 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithTrackIdx:(NSUInteger)index
container:(int)container
dataSource:(id<HBTrackDataSource>)dataSource
delegate:(id<HBTrackDelegate>)delegate;
dataSource:(id<HBSubtitlesTrackDataSource>)dataSource
delegate:(id<HBSubtitlesTrackDelegate>)delegate;
/// The index of the source in the data source tracks array.
@property (nonatomic, readwrite) NSUInteger sourceTrackIdx;
@ -65,8 +66,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;
@property (nonatomic, readwrite, weak) id<HBTrackDataSource> dataSource;
@property (nonatomic, readwrite, weak) id<HBTrackDelegate> delegate;
@property (nonatomic, readwrite, weak) id<HBSubtitlesTrackDataSource> dataSource;
@property (nonatomic, readwrite, weak) id<HBSubtitlesTrackDelegate> delegate;
/// A complete list of the possible languages.
- (NSArray<NSString *> *)languages;

View File

@ -46,8 +46,8 @@ static NSArray *_languagesArray = nil;
- (instancetype)initWithTrackIdx:(NSUInteger)index
container:(int)container
dataSource:(id<HBTrackDataSource>)dataSource
delegate:(id<HBTrackDelegate>)delegate
dataSource:(id<HBSubtitlesTrackDataSource>)dataSource
delegate:(id<HBSubtitlesTrackDelegate>)delegate
{
self = [super init];
if (self)
@ -127,10 +127,10 @@ static NSArray *_languagesArray = nil;
if (!(self.undo.isUndoing || self.undo.isRedoing))
{
self.title = [self.dataSource sourceTrackAtIndex:_sourceTrackIdx].title;
[self validateSettings];
self.title = [self.dataSource defaultTitleForTrackAtIndex:_sourceTrackIdx];
if (oldIdx != sourceTrackIdx)
{
[self.delegate track:self didChangeSourceFrom:oldIdx];

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<resources>
<section name="PresetTemplate">
<integer name="VersionMajor" value="64" />
<integer name="VersionMajor" value="65" />
<integer name="VersionMinor" value="0" />
<integer name="VersionMicro" value="0" />
<json name="Preset" file="preset_template.json" />

View File

@ -2,6 +2,7 @@
{
"ChildrenArray": [
{
"AudioAutomaticNamingBehavior": "unnamed",
"AudioCopyMask": [
"copy:aac",
"copy:ac3",
@ -31,6 +32,7 @@
}
],
"AudioSecondaryEncoderMode": true,
"AudioTrackNamePassthru": true,
"AudioTrackSelectionBehavior": "first",
"ChapterMarkers": true,
"ChildrenArray": [
@ -94,6 +96,7 @@
"SubtitleBurnDVDSub": false,
"SubtitleLanguageList": [
],
"SubtitleTrackNamePassthru": true,
"SubtitleTrackSelectionBehavior": "none",
"VideoAvgBitrate": 6000,
"VideoColorMatrixCodeOverride": 0,

View File

@ -1,5 +1,6 @@
{
"AlignAVStart": false,
"AudioAutomaticNamingBehavior": "unnamed",
"AudioCopyMask": [
"copy:aac",
"copy:ac3",
@ -31,6 +32,7 @@
],
"AudioSecondaryEncoderMode": true,
"AudioTrackSelectionBehavior": "first",
"AudioTrackNamePassthru": true,
"ChapterMarkers": true,
"ChildrenArray": [
],
@ -105,6 +107,7 @@
"SubtitleLanguageList": [
],
"SubtitleTrackSelectionBehavior": "none",
"SubtitleTrackNamePassthru": true,
"VideoAvgBitrate": 1800,
"VideoColorMatrixCodeOverride": 0,
"VideoEncoder": "x264",

View File

@ -60,6 +60,7 @@
#define DEBLOCK_DEFAULT_PRESET "medium"
#define COLORSPACE_DEFAULT_PRESET "bt709"
#define HDR_DYNAMIC_METADATA_DEFAULT_PRESET "all"
#define AUDIO_AUTONAMING_BEHAVIOUR_DEFAULT_PRESET "unnamed"
/* Options */
static int debug = HB_DEBUG_ALL;
@ -215,6 +216,9 @@ static int keep_duplicate_titles = 0;
static int hdr_dynamic_metadata_disable = 0;
static char * hdr_dynamic_metadata = NULL;
static int metadata_passthru = -1;
static int audio_name_passthru = -1;
static char * audio_autonaming_behaviour = NULL;
static int sub_name_passthru = -1;
/* Exit cleanly on Ctrl-C */
static volatile hb_error_code done_error = HB_ERROR_NONE;
@ -1675,6 +1679,14 @@ static void ShowHelp(void)
}
}
fprintf(out,
" --keep-aname Passthru the source audio track(s) name(s).\n"
" --no-keep-aname Disable the source audio track(s) name(s) passthru.\n"
" --automatic-naming-behaviour\n"
" Set the audio track(s) automatic naming behaviour:\n"
" off\n"
" unnamed\n"
" all\n"
" Disable the source audio track(s) name(s) passthru.\n"
" -A, --aname <string> Set audio track name(s).\n"
" Separate tracks by commas.\n"
"\n"
@ -1901,6 +1913,8 @@ static void ShowHelp(void)
" or less is selected. This should locate subtitles\n"
" for short foreign language segments. Best used in\n"
" conjunction with --subtitle-forced.\n"
" --keep-subname Passthru the source subtitle track(s) name(s).\n"
" --no-keep-subname Disable the source subtitle track(s) name(s) passthru.\n"
" -S, --subname <string> Set subtitle track name(s).\n"
" Separate tracks by commas.\n"
" -F, --subtitle-forced[=string]\n"
@ -2251,6 +2265,7 @@ static int ParseOptions( int argc, char ** argv )
#define KEEP_DUPLICATE_TITLES 332
#define MAX_DURATION 333
#define HDR_DYNAMIC_METADATA 334
#define AUDIO_AUTONAMING_BEHAVIOUR 335
for( ;; )
{
@ -2429,7 +2444,12 @@ static int ParseOptions( int argc, char ** argv )
{ "preset-export-description", required_argument, NULL, PRESET_EXPORT_DESC },
{ "queue-import-file", required_argument, NULL, QUEUE_IMPORT },
{ "keep-aname", no_argument, &audio_name_passthru, 1 },
{ "no-keep-aname", no_argument, &audio_name_passthru, 0 },
{ "automatic-naming-behaviour", required_argument, NULL, AUDIO_AUTONAMING_BEHAVIOUR },
{ "aname", required_argument, NULL, 'A' },
{ "keep-subname", no_argument, &sub_name_passthru, 1 },
{ "no-keep-subname", no_argument, &sub_name_passthru, 0 },
{ "subname", required_argument, NULL, 'S' },
{ "color-matrix",required_argument, NULL, 'M' },
{ "previews", required_argument, NULL, PREVIEWS },
@ -3277,6 +3297,17 @@ static int ParseOptions( int argc, char ** argv )
hdr_dynamic_metadata = strdup(HDR_DYNAMIC_METADATA_DEFAULT_PRESET);
}
break;
case AUDIO_AUTONAMING_BEHAVIOUR:
free(audio_autonaming_behaviour);
if (optarg != NULL)
{
audio_autonaming_behaviour = strdup(optarg);
}
else
{
audio_autonaming_behaviour = strdup(AUDIO_AUTONAMING_BEHAVIOUR_DEFAULT_PRESET);
}
break;
case ':':
fprintf( stderr, "missing parameter (%s)\n", argv[cur_optind] );
return -1;
@ -3932,6 +3963,10 @@ static hb_dict_t * PreparePreset(const char *preset_name)
hb_dict_set(preset, "SubtitleTrackSelectionBehavior",
hb_value_string(selection));
}
if (sub_name_passthru != -1)
{
hb_dict_set(preset, "SubtitleTrackNamePassthru", hb_value_bool(sub_name_passthru));
}
if (audio_copy_list != NULL)
{
@ -3990,6 +4025,14 @@ static hb_dict_t * PreparePreset(const char *preset_name)
hb_dict_set(preset, "AudioTrackSelectionBehavior",
hb_value_string(audio_all == 1 ? "all" : "first"));
}
if (audio_name_passthru != -1)
{
hb_dict_set(preset, "AudioTrackNamePassthru", hb_value_bool(audio_name_passthru));
}
if (audio_autonaming_behaviour != NULL)
{
hb_dict_set(preset, "AudioAutomaticNamingBehavior", hb_value_string(audio_autonaming_behaviour));
}
// Audio overrides
if (atracks == NULL && audio_all != 1 && (
@ -4805,7 +4848,7 @@ static hb_dict_t * PreparePreset(const char *preset_name)
}
static int add_sub(hb_value_array_t *list, hb_title_t *title, int track, int out_track, int *one_burned)
static int add_sub(hb_value_array_t *list, hb_title_t *title, int track, int out_track, int *one_burned, int keep_name)
{
hb_subtitle_t *subtitle;
// Check that the track exists
@ -4834,11 +4877,18 @@ static int add_sub(hb_value_array_t *list, hb_title_t *title, int track, int out
}
*one_burned = 1;
}
const char *name = keep_name && subtitle->name != NULL && subtitle->name[0] != 0 ? subtitle->name : NULL;
hb_dict_t *subtitle_dict = hb_dict_init();
hb_dict_set(subtitle_dict, "Track", hb_value_int(track));
hb_dict_set(subtitle_dict, "Default", hb_value_bool(def));
hb_dict_set(subtitle_dict, "Forced", hb_value_bool(force));
hb_dict_set(subtitle_dict, "Burn", hb_value_bool(burn));
if (name)
{
hb_dict_set(subtitle_dict, "Name", hb_value_string(name));
}
hb_value_array_append(list, subtitle_dict);
return 0;
}
@ -5411,13 +5461,45 @@ PrepareJob(hb_handle_t *h, hb_title_t *title, hb_dict_t *preset_dict)
fprintf(stderr, "Dropping excess audio track names\n");
}
}
// If exactly one name was specified, apply it to the reset
// If exactly one name was specified, apply it to the rest
// of the tracks
if (ii == 1 && *anames[0]) for (; ii < track_count; ii++)
{
audio_dict = hb_value_array_get(audio_array, ii);
hb_dict_set(audio_dict, "Name", hb_value_string(anames[0]));
}
int keep_name = hb_value_get_bool(hb_dict_get(preset_dict, "AudioTrackNamePassthru"));
hb_audio_autonaming_behavior_t behavior = HB_AUDIO_AUTONAMING_NONE;
const char *behavior_name = hb_value_get_string(hb_dict_get(preset_dict, "AudioAutomaticNamingBehavior"));
behavior = hb_audio_autonaming_behavior_get_from_name(behavior_name);
for (ii = 0; ii < track_count; ii++)
{
audio_dict = hb_value_array_get(audio_array, ii);
if (hb_dict_get(audio_dict, "Name") == NULL)
{
int track = hb_value_get_int(hb_dict_get(audio_dict, "Track"));
hb_audio_config_t *audio = hb_list_audio_config_item(title->list_audio, track);
if (audio != NULL)
{
const char *mixdown_name = hb_dict_get_string(audio_dict, "Mixdown");
int mixdown = hb_mixdown_get_from_name(mixdown_name);
const char *name = hb_audio_name_generate(audio->in.name,
audio->in.channel_layout,
mixdown, keep_name, behavior);
if (name)
{
hb_dict_set(audio_dict, "Name", hb_value_string(name));
}
}
}
}
}
int one_burned = 0;
@ -5446,13 +5528,15 @@ PrepareJob(hb_handle_t *h, hb_title_t *title, hb_dict_t *preset_dict)
continue;
}
int keep_name = hb_value_get_bool(hb_dict_get(preset_dict, "SubtitleTrackNamePassthru"));
int first, last, track;
if (sscanf(subtracks[ii], "%d-%d", &first, &last ) == 2)
{
for (track = first - 1; track < last; track++)
{
if (add_sub(subtitle_array, title, track - 1,
out_track + 1, &one_burned) == 0)
out_track + 1, &one_burned, keep_name) == 0)
{
out_track++;
}
@ -5461,7 +5545,7 @@ PrepareJob(hb_handle_t *h, hb_title_t *title, hb_dict_t *preset_dict)
else if (sscanf(subtracks[ii], "%d", &track) == 1)
{
if (add_sub(subtitle_array, title, track - 1,
out_track + 1, &one_burned) == 0)
out_track + 1, &one_burned, keep_name) == 0)
{
out_track++;
}

View File

@ -12,6 +12,7 @@ namespace HandBrake.Interop.Interop
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using HandBrake.Interop.Interop.HbLib;
using HandBrake.Interop.Interop.Helpers;
@ -784,5 +785,12 @@ namespace HandBrake.Interop.Interop
return new List<int>();
}
public static string GetAutonameAudioTrack(string name, ulong layout, int mixdown, bool keep_name, int behaviour)
{
IntPtr nameptr = Marshal.StringToHGlobalAnsi(name);
return Marshal.PtrToStringUTF8((IntPtr)HBFunctions.hb_audio_name_generate(nameptr, layout, mixdown, keep_name ? 1 : 0, behaviour));
}
}
}

View File

@ -405,8 +405,6 @@ namespace HandBrake.Interop.Interop.HbLib
}
public static IntPtr hb_video_encoder_get_presets(int encoder)
{
return IsArmDevice ? HbFunctionsArm.hb_video_encoder_get_presets(encoder) : HBFunctions64.hb_video_encoder_get_presets(encoder);
@ -652,5 +650,17 @@ namespace HandBrake.Interop.Interop.HbLib
return IsArmDevice ? HbFunctionsArm.hb_get_preview3_json(hbHandle, preview_idx, job_dict)
: HBFunctions64.hb_get_preview3_json(hbHandle, preview_idx, job_dict);
}
public static int hb_audio_autonaming_behavior_get_from_name(IntPtr name)
{
return IsArmDevice ? HbFunctionsArm.hb_audio_autonaming_behavior_get_from_name(name)
: HBFunctions64.hb_audio_autonaming_behavior_get_from_name(name);
}
public static IntPtr hb_audio_name_generate(IntPtr name, ulong layout, int mixdown, int keep_name, int behaviour)
{
return IsArmDevice ? HbFunctionsArm.hb_audio_name_generate(name, layout, mixdown, keep_name, behaviour)
: HBFunctions64.hb_audio_name_generate(name, layout, mixdown, keep_name, behaviour);
}
}
}

View File

@ -140,6 +140,12 @@ namespace HandBrake.Interop.Interop.HbLib
[DllImport("hb", EntryPoint = "hb_audio_bitrate_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_audio_bitrate_get_next(IntPtr last);
[DllImport("hb", EntryPoint = "hb_audio_autonaming_behavior_get_from_name", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_audio_autonaming_behavior_get_from_name(IntPtr name);
[DllImport("hb", EntryPoint = "hb_audio_name_generate", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_audio_name_generate(IntPtr name, ulong layout, int mixdown, int keep_name, int behaviour);
[DllImport("hb", EntryPoint = "hb_video_quality_get_limits", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);
@ -355,5 +361,9 @@ namespace HandBrake.Interop.Interop.HbLib
// hb_get_preview3(hb_handle_t* h, int picture, const char * job_dict)
[DllImport("hb", EntryPoint = "hb_get_preview3_json", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_get_preview3_json(IntPtr hbHandle, int preview_idx, [In][MarshalAs(UnmanagedType.LPStr)] string job_dict);
}
}

View File

@ -140,6 +140,12 @@ namespace HandBrake.Interop.Interop.HbLib
[DllImport("hb_a64", EntryPoint = "hb_audio_bitrate_get_next", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_audio_bitrate_get_next(IntPtr last);
[DllImport("hb_a64", EntryPoint = "hb_audio_autonaming_behavior_get_from_name", CallingConvention = CallingConvention.Cdecl)]
public static extern int hb_audio_autonaming_behavior_get_from_name(IntPtr name);
[DllImport("hb_a64", EntryPoint = "hb_audio_name_generate", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_audio_name_generate(IntPtr name, ulong layout, int mixdown, int keep_name, int behaviour);
[DllImport("hb_a64", EntryPoint = "hb_video_quality_get_limits", CallingConvention = CallingConvention.Cdecl)]
public static extern void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction);

View File

@ -9,7 +9,6 @@
namespace HandBrake.Interop.Interop.Json.Presets
{
using System;
using System.Collections.Generic;
public class HBPreset
@ -46,6 +45,10 @@ namespace HandBrake.Interop.Interop.Json.Presets
/// </summary>
public string AudioTrackSelectionBehavior { get; set; }
public bool AudioTrackNamePassthru { get; set; }
public string AudioAutomaticNamingBehavior { get; set; }
/// <summary>
/// Gets or sets a value indicating whether chapter markers.
/// </summary>
@ -316,6 +319,8 @@ namespace HandBrake.Interop.Interop.Json.Presets
/// </summary>
public string SubtitleTrackSelectionBehavior { get; set; }
public bool SubtitleTrackNamePassthru { get; set; }
/// <summary>
/// Gets or sets the video avg bitrate.
/// </summary>

View File

@ -13,6 +13,7 @@ namespace HandBrakeWPF.Model.Audio
using System.ComponentModel;
using System.Linq;
using HandBrake.App.Core.Utilities;
using HandBrake.Interop.Interop;
using HandBrake.Interop.Interop.Interfaces.Model;
using HandBrake.Interop.Interop.Interfaces.Model.Encoders;
@ -24,7 +25,11 @@ namespace HandBrakeWPF.Model.Audio
private AudioBehaviourModes selectedBehaviour;
private BindingList<Language> selectedLanguages;
private AudioTrackDefaultsMode trackDefaultBehaviour;
private AudioTrackNamingBehaviour audioAutomaticNamingBehavior;
private bool audioTrackNamePassthru;
public AudioBehaviours()
{
this.SelectedBehaviour = AudioBehaviourModes.None;
@ -33,6 +38,7 @@ namespace HandBrakeWPF.Model.Audio
this.BehaviourTracks = new BindingList<AudioBehaviourTrack>();
this.AllowedPassthruOptions = new BindingList<HBAudioEncoder>();
this.AudioFallbackEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(HBAudioEncoder.AvAac);
}
public AudioBehaviours(AudioBehaviours behaviours)
@ -43,6 +49,8 @@ namespace HandBrakeWPF.Model.Audio
this.BehaviourTracks = behaviours.BehaviourTracks;
this.AllowedPassthruOptions = new BindingList<HBAudioEncoder>(behaviours.AllowedPassthruOptions);
this.AudioFallbackEncoder = behaviours.AudioFallbackEncoder;
this.AudioTrackNamePassthru = behaviours.AudioTrackNamePassthru;
this.AudioAutomaticNamingBehavior = behaviours.AudioAutomaticNamingBehavior;
}
public AudioBehaviourModes SelectedBehaviour
@ -102,5 +110,35 @@ namespace HandBrakeWPF.Model.Audio
public IList<HBAudioEncoder> AllowedPassthruOptions { get; set; }
public HBAudioEncoder AudioFallbackEncoder { get; set; }
public bool AudioTrackNamePassthru
{
get => this.audioTrackNamePassthru;
set
{
if (value == this.audioTrackNamePassthru)
{
return;
}
this.audioTrackNamePassthru = value;
this.NotifyOfPropertyChange(() => this.AudioTrackNamePassthru);
}
}
public AudioTrackNamingBehaviour AudioAutomaticNamingBehavior
{
get => this.audioAutomaticNamingBehavior;
set
{
if (value == this.audioAutomaticNamingBehavior)
{
return;
}
this.audioAutomaticNamingBehavior = value;
this.NotifyOfPropertyChange(() => this.AudioAutomaticNamingBehavior);
}
}
}
}

View File

@ -0,0 +1,22 @@
using HandBrakeWPF.Properties;
namespace HandBrakeWPF.Model.Audio
{
using HandBrake.Interop.Attributes;
public enum AudioTrackNamingBehaviour
{
[DisplayName(typeof(Resources), "AudioTrackNaming_None")]
[ShortName("none")]
None,
[DisplayName(typeof(Resources), "AudioTrackNaming_Unnamed")]
[ShortName("unnamed")]
Unnamed,
[DisplayName(typeof(Resources), "AudioTrackNaming_All")]
[ShortName("All")]
All,
}
}

View File

@ -24,6 +24,8 @@ namespace HandBrakeWPF.Model.Subtitles
private bool addClosedCaptions;
private SubtitleBurnInBehaviourModes selectedBurnInBehaviour;
private bool subtitleTrackNamePassthru;
public SubtitleBehaviours()
{
this.SelectedBehaviour = SubtitleBehaviourModes.None;
@ -38,6 +40,7 @@ namespace HandBrakeWPF.Model.Subtitles
this.SelectedLanguages = new BindingList<Language>(behaviours.SelectedLanguages.ToList());
this.AddClosedCaptions = behaviours.AddClosedCaptions;
this.AddForeignAudioScanTrack = behaviours.AddForeignAudioScanTrack;
this.SubtitleTrackNamePassthru = behaviours.SubtitleTrackNamePassthru;
}
public SubtitleBehaviourModes SelectedBehaviour
@ -124,5 +127,20 @@ namespace HandBrakeWPF.Model.Subtitles
this.NotifyOfPropertyChange(() => this.AddClosedCaptions);
}
}
public bool SubtitleTrackNamePassthru
{
get => this.subtitleTrackNamePassthru;
set
{
if (value == this.subtitleTrackNamePassthru)
{
return;
}
this.subtitleTrackNamePassthru = value;
this.NotifyOfPropertyChange(() => this.SubtitleTrackNamePassthru);
}
}
}
}

View File

@ -364,6 +364,15 @@ namespace HandBrakeWPF.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Autonaming:.
/// </summary>
public static string AudioDefaultsView_AutoNaming {
get {
return ResourceManager.GetString("AudioDefaultsView_AutoNaming", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Clear.
/// </summary>
@ -373,6 +382,15 @@ namespace HandBrakeWPF.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Track Naming Behaviour:.
/// </summary>
public static string AudioDefaultsView_NamingBehaviour {
get {
return ResourceManager.GetString("AudioDefaultsView_NamingBehaviour", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Automatic Audio Selections.
/// </summary>
@ -382,6 +400,15 @@ namespace HandBrakeWPF.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Passthru Track Names.
/// </summary>
public static string AudioDefaultsView_PassthruTrackNames {
get {
return ResourceManager.GetString("AudioDefaultsView_PassthruTrackNames", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Source Track Selection.
/// </summary>
@ -391,6 +418,33 @@ namespace HandBrakeWPF.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to All Tracks.
/// </summary>
public static string AudioTrackNaming_All {
get {
return ResourceManager.GetString("AudioTrackNaming_All", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to None.
/// </summary>
public static string AudioTrackNaming_None {
get {
return ResourceManager.GetString("AudioTrackNaming_None", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unnamed Only.
/// </summary>
public static string AudioTrackNaming_Unnamed {
get {
return ResourceManager.GetString("AudioTrackNaming_Unnamed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Allow passthru of:.
/// </summary>
@ -7557,6 +7611,15 @@ namespace HandBrakeWPF.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Passthru Track Names.
/// </summary>
public static string SubtitlesDefaultsView_PassthruTrackName {
get {
return ResourceManager.GetString("SubtitlesDefaultsView_PassthruTrackName", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add Closed Captions when available.
/// </summary>

View File

@ -2977,4 +2977,25 @@ To allow multiple simultaneous encodes, turn on "Process Isolation" in Tools Men
<data name="QueueView_StartQueueNow" xml:space="preserve">
<value>Start Queue (Immediately)</value>
</data>
<data name="AudioTrackNaming_None" xml:space="preserve">
<value>None</value>
</data>
<data name="AudioTrackNaming_Unnamed" xml:space="preserve">
<value>Unnamed Only</value>
</data>
<data name="AudioTrackNaming_All" xml:space="preserve">
<value>All Tracks</value>
</data>
<data name="AudioDefaultsView_NamingBehaviour" xml:space="preserve">
<value>Track Naming Behaviour:</value>
</data>
<data name="AudioDefaultsView_AutoNaming" xml:space="preserve">
<value>Autonaming:</value>
</data>
<data name="AudioDefaultsView_PassthruTrackNames" xml:space="preserve">
<value>Passthru Track Names</value>
</data>
<data name="SubtitlesDefaultsView_PassthruTrackName" xml:space="preserve">
<value>Passthru Track Names</value>
</data>
</root>

View File

@ -62,6 +62,9 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
public AudioTrack(AudioTrack track, bool setScannedTrack)
{
this.PassthruTracks = track.PassthruTracks;
this.TrackNamingBehaviour = track.TrackNamingBehaviour;
this.bitrate = track.Bitrate;
this.drc = track.DRC;
this.encoder = track.Encoder;
@ -90,8 +93,12 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
this.SetupLimits();
}
public AudioTrack(AudioBehaviourTrack track, Audio sourceTrack, IList<HBAudioEncoder> passthruEncoders, HBAudioEncoder fallbackEncoder, OutputFormat container)
public AudioTrack(AudioBehaviourTrack track, Audio sourceTrack, IList<HBAudioEncoder> passthruEncoders, HBAudioEncoder fallbackEncoder, OutputFormat container, Func<bool> passthruTracks,
Func<AudioTrackNamingBehaviour> trackNamingBehaviour)
{
this.PassthruTracks = passthruTracks;
this.TrackNamingBehaviour = trackNamingBehaviour;
HBAudioEncoder validatedEncoder = track.Encoder;
if (track.IsPassthru)
{
@ -140,9 +147,11 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
if (!string.IsNullOrEmpty(this.scannedTrack?.Name))
{
this.TrackName = this.scannedTrack.Name;
this.PassthruTrackName();
}
this.AutoNameTrack();
this.SetupLimits();
}
@ -169,6 +178,9 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
}
this.GetDefaultMixdownIfNull();
this.PassthruTrackName();
this.AutoNameTrack();
}
}
@ -476,7 +488,39 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
}
}
[JsonIgnore]
public Func<bool> PassthruTracks { get; set; }
[JsonIgnore]
public Func<AudioTrackNamingBehaviour> TrackNamingBehaviour { get; set; }
/* Helper Methods */
public void PassthruTrackName()
{
if (PassthruTracks != null)
{
bool passthru = PassthruTracks();
if (this.ScannedTrack != null && passthru)
{
this.TrackName = this.ScannedTrack.Name;
}
}
}
public void AutoNameTrack()
{
if (TrackNamingBehaviour != null)
{
AudioTrackNamingBehaviour behaviour = TrackNamingBehaviour();
if (this.ScannedTrack != null)
{
bool keep = behaviour == AudioTrackNamingBehaviour.Unnamed || behaviour == AudioTrackNamingBehaviour.None;
HBMixdown currentMixdown = HandBrakeEncoderHelpers.GetMixdown(this.mixDown);
this.TrackName = HandBrakeEncoderHelpers.GetAutonameAudioTrack(this.TrackName, 0, currentMixdown.Id, keep, (int)behaviour);
}
}
}
private void SetupLimits()
{
@ -601,7 +645,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
this.MixDown = sanitisedMixdown.ShortName;
}
}
public override string ToString()
{
return string.Format("Audio Track: Title {0}", this.ScannedTrack.ToString());

View File

@ -9,8 +9,9 @@
namespace HandBrakeWPF.Services.Encode.Model.Models
{
using System;
using HandBrake.Interop.Interop.Interfaces.Model;
using HandBrake.Interop.Utilities;
using HandBrakeWPF.Services.Scan.Model;
using HandBrakeWPF.ViewModels;
@ -80,6 +81,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
this.SubtitleType = subtitle.SubtitleType;
this.SourceTrack = subtitle.SourceTrack;
this.Name = subtitle.Name;
this.TrackNamingCallback = subtitle.TrackNamingCallback;
}
#endregion
@ -185,9 +187,13 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
this.Forced = false;
}
if (this.sourceTrack != null)
if (TrackNamingCallback != null)
{
this.Name = !string.IsNullOrEmpty(this.sourceTrack.Name) ? this.sourceTrack.Name : string.Empty;
bool passthruName = TrackNamingCallback();
if (passthruName)
{
this.SetTrackNamePassthru();
}
}
}
}
@ -316,6 +322,16 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
}
}
public void SetTrackNamePassthru()
{
if (this.SourceTrack != null)
{
this.Name = this.SourceTrack.Name;
}
}
public Func<bool> TrackNamingCallback { get; set; }
public override string ToString()
{
return string.Format("Subtitle Track: Title {0}", this.SrtFileName ?? this.SourceTrack.ToString());

View File

@ -350,6 +350,9 @@ namespace HandBrakeWPF.Services.Presets.Factories
? AudioBehaviourModes.AllMatching
: AudioBehaviourModes.FirstMatch;
preset.AudioTrackBehaviours.AudioTrackNamePassthru = importedPreset.AudioTrackNamePassthru;
preset.AudioTrackBehaviours.AudioAutomaticNamingBehavior = EnumHelper<AudioTrackNamingBehaviour>.GetValue(importedPreset.AudioAutomaticNamingBehavior);
preset.AudioTrackBehaviours.SelectedTrackDefaultBehaviour = importedPreset.AudioSecondaryEncoderMode ? AudioTrackDefaultsMode.FirstTrack : AudioTrackDefaultsMode.AllTracks;
if (importedPreset.AudioCopyMask != null)
@ -417,6 +420,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
preset.SubtitleTrackBehaviours = new SubtitleBehaviours();
preset.SubtitleTrackBehaviours.SelectedBehaviour = EnumHelper<SubtitleBehaviourModes>.GetValue(importedPreset.SubtitleTrackSelectionBehavior);
preset.SubtitleTrackBehaviours.SelectedBurnInBehaviour = EnumHelper<SubtitleBurnInBehaviourModes>.GetValue(importedPreset.SubtitleBurnBehavior);
preset.SubtitleTrackBehaviours.SubtitleTrackNamePassthru = importedPreset.SubtitleTrackNamePassthru;
preset.SubtitleTrackBehaviours.AddClosedCaptions = importedPreset.SubtitleAddCC;
preset.SubtitleTrackBehaviours.AddForeignAudioScanTrack = importedPreset.SubtitleAddForeignAudioSearch;
@ -543,6 +547,9 @@ namespace HandBrakeWPF.Services.Presets.Factories
preset.AudioList.Add(track);
}
preset.AudioTrackNamePassthru = export.AudioTrackBehaviours.AudioTrackNamePassthru;
preset.AudioAutomaticNamingBehavior = EnumHelper<AudioTrackNamingBehaviour>.GetShortName(export.AudioTrackBehaviours.AudioAutomaticNamingBehavior);
// Subtitles
preset.SubtitleAddCC = export.SubtitleTrackBehaviours.AddClosedCaptions;
preset.SubtitleAddForeignAudioSearch = export.SubtitleTrackBehaviours.AddForeignAudioScanTrack;
@ -551,6 +558,7 @@ namespace HandBrakeWPF.Services.Presets.Factories
preset.SubtitleBurnBehavior = EnumHelper<SubtitleBurnInBehaviourModes>.GetShortName(export.SubtitleTrackBehaviours.SelectedBurnInBehaviour);
preset.SubtitleLanguageList = HandBrakeLanguagesHelper.GetLanguageCodes(export.SubtitleTrackBehaviours.SelectedLanguages);
preset.SubtitleTrackSelectionBehavior = EnumHelper<SubtitleBehaviourModes>.GetShortName(export.SubtitleTrackBehaviours.SelectedBehaviour);
preset.SubtitleTrackNamePassthru = export.SubtitleTrackBehaviours.SubtitleTrackNamePassthru;
// Chapters
preset.ChapterMarkers = export.Task.IncludeChapterMarkers;

View File

@ -9,19 +9,16 @@
namespace HandBrakeWPF.ViewModels
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using HandBrake.App.Core.Utilities;
using HandBrake.Interop.Interop;
using HandBrake.Interop.Interop.Interfaces.Model;
using HandBrake.Interop.Interop.Interfaces.Model.Encoders;
using HandBrake.Interop.Utilities;
using HandBrakeWPF.Commands;
using HandBrakeWPF.Model.Audio;
@ -216,6 +213,15 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public IList<string> SampleRates { get; set; }
public IList<AudioTrackNamingBehaviour> TrackNamingBehaviours
{
get
{
return new BindingList<AudioTrackNamingBehaviour>(EnumHelper<AudioTrackNamingBehaviour>.GetEnumList().ToList());
}
}
#endregion
#region Public Methods
@ -342,6 +348,9 @@ namespace HandBrakeWPF.ViewModels
}
this.UpdateAvailableLanguages();
this.AudioBehaviours.AudioTrackNamePassthru = behaviours.AudioTrackNamePassthru;
this.AudioBehaviours.AudioAutomaticNamingBehavior = behaviours.AudioAutomaticNamingBehavior;
}
this.CorrectAudioEncoders(this.OutputFormat);

View File

@ -403,7 +403,12 @@ namespace HandBrakeWPF.ViewModels
{
if (!useBehaviourTemplateMode)
{
this.Task.AudioTracks.Add(new AudioTrack { ScannedTrack = track });
this.Task.AudioTracks.Add(new AudioTrack
{
PassthruTracks = this.CheckPassthruTrack,
TrackNamingBehaviour = this.CheckNamingBehaviour,
ScannedTrack = track
});
return;
}
@ -413,7 +418,12 @@ namespace HandBrakeWPF.ViewModels
AudioBehaviourTrack template = this.AudioBehaviours.BehaviourTracks.FirstOrDefault();
if (this.CanAddTrack(template, track, this.AudioBehaviours.AudioFallbackEncoder))
{
this.Task.AudioTracks.Add( template != null ? new AudioTrack(template, track, this.AudioBehaviours.AllowedPassthruOptions, this.AudioBehaviours.AudioFallbackEncoder, this.Task.OutputFormat) : new AudioTrack { ScannedTrack = track });
this.Task.AudioTracks.Add(template != null ? new AudioTrack(template, track, this.AudioBehaviours.AllowedPassthruOptions, this.AudioBehaviours.AudioFallbackEncoder, this.Task.OutputFormat, this.CheckPassthruTrack, this.CheckNamingBehaviour) : new AudioTrack
{
PassthruTracks = this.CheckPassthruTrack,
TrackNamingBehaviour = this.CheckNamingBehaviour,
ScannedTrack = track
});
}
break;
case AudioTrackDefaultsMode.AllTracks:
@ -421,7 +431,12 @@ namespace HandBrakeWPF.ViewModels
{
if (this.CanAddTrack(tmpl, track, this.AudioBehaviours.AudioFallbackEncoder))
{
this.Task.AudioTracks.Add(tmpl != null ? new AudioTrack(tmpl, track, this.AudioBehaviours.AllowedPassthruOptions, this.AudioBehaviours.AudioFallbackEncoder, this.Task.OutputFormat) : new AudioTrack { ScannedTrack = track });
this.Task.AudioTracks.Add(tmpl != null ? new AudioTrack(tmpl, track, this.AudioBehaviours.AllowedPassthruOptions, this.AudioBehaviours.AudioFallbackEncoder, this.Task.OutputFormat, this.CheckPassthruTrack, this.CheckNamingBehaviour) : new AudioTrack
{
PassthruTracks = this.CheckPassthruTrack,
TrackNamingBehaviour = this.CheckNamingBehaviour,
ScannedTrack = track
});
}
}
@ -472,10 +487,10 @@ namespace HandBrakeWPF.ViewModels
Audio sourceTrack = this.GetPreferredAudioTrack();
if (this.CanAddTrack(track, sourceTrack, this.AudioBehaviours.AudioFallbackEncoder))
{
this.Task.AudioTracks.Add(new AudioTrack(track, sourceTrack, this.AudioBehaviours.AllowedPassthruOptions, this.AudioBehaviours.AudioFallbackEncoder, this.Task.OutputFormat));
this.Task.AudioTracks.Add(new AudioTrack(track, sourceTrack, this.AudioBehaviours.AllowedPassthruOptions, this.AudioBehaviours.AudioFallbackEncoder, this.Task.OutputFormat, this.CheckPassthruTrack, this.CheckNamingBehaviour));
}
}
// Step 4, Handle the default selection behaviour.
switch (this.AudioBehaviours.SelectedBehaviour)
{
@ -489,6 +504,12 @@ namespace HandBrakeWPF.ViewModels
this.AddAllRemainingForSelectedLanguages();
break;
}
foreach (AudioTrack track in this.Task.AudioTracks)
{
track.PassthruTrackName();
track.AutoNameTrack();
}
}
/// <summary>
@ -621,6 +642,26 @@ namespace HandBrakeWPF.ViewModels
return orderedTracks;
}
private AudioTrackNamingBehaviour CheckNamingBehaviour()
{
if (this.AudioBehaviours != null)
{
return this.AudioBehaviours.AudioAutomaticNamingBehavior;
}
return AudioTrackNamingBehaviour.None;
}
private bool CheckPassthruTrack()
{
if (this.AudioBehaviours != null)
{
return this.AudioBehaviours.AudioTrackNamePassthru;
}
return false;
}
#endregion
}
}

View File

@ -230,6 +230,7 @@ namespace HandBrakeWPF.ViewModels
this.SubtitleBehaviours.SelectedBurnInBehaviour = behaviours.SelectedBurnInBehaviour;
this.SubtitleBehaviours.AddClosedCaptions = behaviours.AddClosedCaptions;
this.SubtitleBehaviours.AddForeignAudioScanTrack = behaviours.AddForeignAudioScanTrack;
this.SubtitleBehaviours.SubtitleTrackNamePassthru = behaviours.SubtitleTrackNamePassthru;
foreach (Language selectedItem in behaviours.SelectedLanguages)
{

View File

@ -159,7 +159,6 @@ namespace HandBrakeWPF.ViewModels
this.CheckAddState(count);
}
/// <summary>
/// Add a new Track
/// </summary>
@ -659,12 +658,12 @@ namespace HandBrakeWPF.ViewModels
}
}
SubtitleTrack track = new SubtitleTrack
{
SubtitleType = source.SubtitleType,
SourceTrack = source,
};
{
TrackNamingCallback = this.IsTrackNamePassthruEnabled,
SubtitleType = source.SubtitleType,
SourceTrack = source,
};
// Burn-in Behaviours
if (this.SubtitleBehaviours.SelectedBurnInBehaviour == SubtitleBurnInBehaviourModes.ForeignAudio
@ -700,6 +699,12 @@ namespace HandBrakeWPF.ViewModels
}
}
// Default the track name to the source track name, if it exists.
if (SubtitleBehaviours.SubtitleTrackNamePassthru)
{
track.SetTrackNamePassthru();
}
var encodeTask = this.Task;
if (encodeTask != null)
{
@ -776,14 +781,16 @@ namespace HandBrakeWPF.ViewModels
string extension = Path.GetExtension(srtFile);
SubtitleTrack track = new SubtitleTrack
{
SrtFileName = Path.GetFileNameWithoutExtension(srtFile),
SrtOffset = 0,
SrtCharCode = "UTF-8",
SrtLang = HandBrakeLanguagesHelper.GetByName("English"),
SubtitleType = extension.Contains("ass", StringComparison.InvariantCultureIgnoreCase) ? SubtitleType.IMPORTSSA : SubtitleType.IMPORTSRT,
SrtPath = srtFile
};
{
TrackNamingCallback = this.IsTrackNamePassthruEnabled,
SrtFileName = Path.GetFileNameWithoutExtension(srtFile),
SrtOffset = 0,
SrtCharCode = "UTF-8",
SrtLang = HandBrakeLanguagesHelper.GetByName("English"),
SubtitleType = extension.Contains("ass", StringComparison.InvariantCultureIgnoreCase) ? SubtitleType.IMPORTSSA : SubtitleType.IMPORTSRT,
SrtPath = srtFile,
};
this.Task.SubtitleTracks.Add(track);
}
}
@ -799,5 +806,10 @@ namespace HandBrakeWPF.ViewModels
MessageBoxImage.Information);
}
}
public bool IsTrackNamePassthruEnabled()
{
return this.SubtitleBehaviours.SubtitleTrackNamePassthru;
}
}
}

View File

@ -95,7 +95,7 @@
<TextBlock Text="{x:Static Properties:Resources.Shared_AvailableLanguages}" Margin="0,0,0,5"/>
<ListBox Name="availableLanguages" ItemsSource="{Binding AvailableLanguages}" DisplayMemberPath="DisplayNative"
helpers:ListBoxHelper.SelectedItems="{Binding SelectedAvailableToMove}"
SelectionMode="Extended" Width="225" Height="120" />
SelectionMode="Extended" Width="225" Height="150" />
</StackPanel>
<DockPanel Grid.Column="1" Margin="10,0,10,0">
@ -110,7 +110,7 @@
<TextBlock Text="{x:Static Properties:Resources.Shared_ChosenLanguages}" Margin="0,0,0,5"/>
<ListBox Name="selectedLanguages" ItemsSource="{Binding AudioBehaviours.SelectedLanguages}" DisplayMemberPath="DisplayNative"
helpers:ListBoxHelper.SelectedItems="{Binding SelectedLanguagesToMove}"
SelectionMode="Extended" Width="225" Height="120"
SelectionMode="Extended" Width="225" Height="150"
dd:DragDrop.DropHandler="{Binding}"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True"/>
@ -158,8 +158,21 @@
</MultiBinding>
</ComboBox.ItemsSource>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Vertical">
<TextBlock Text="{x:Static Properties:Resources.AudioDefaultsView_NamingBehaviour}" Style="{StaticResource subHeader}" Margin="0,10,0,5" />
<CheckBox Content="{x:Static Properties:Resources.AudioDefaultsView_PassthruTrackNames}" IsChecked="{Binding AudioBehaviours.AudioTrackNamePassthru}" Margin="10,0,0,0" />
<StackPanel Orientation="Horizontal" Margin="10,5,0,0">
<TextBlock Text="{x:Static Properties:Resources.AudioDefaultsView_AutoNaming}" />
<ComboBox ItemsSource="{Binding TrackNamingBehaviours}" SelectedItem="{Binding AudioBehaviours.AudioAutomaticNamingBehavior}"
Margin="5,0,0,0"/>
</StackPanel>
</StackPanel>
</StackPanel>
<!-- Tracks -->

View File

@ -54,6 +54,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -115,11 +116,13 @@
HorizontalAlignment="Left" IsChecked="{Binding SubtitleBehaviours.AddClosedCaptions}"/>
<CheckBox Content="{x:Static Properties:Resources.SubtitlesView_AddForeignAudioSearch}" Grid.Column="1" Grid.Row="4" Margin="0,5,0,0"
HorizontalAlignment="Left" IsChecked="{Binding SubtitleBehaviours.AddForeignAudioScanTrack}"/>
<CheckBox Content="{x:Static Properties:Resources.SubtitlesDefaultsView_PassthruTrackName}" Grid.Column="1" Grid.Row="5" Margin="0,5,0,0"
HorizontalAlignment="Left" IsChecked="{Binding SubtitleBehaviours.SubtitleTrackNamePassthru}"/>
<!-- Burn In Behaviour -->
<TextBlock Text="{x:Static Properties:Resources.SubtitlesView_BurnInBehaviour}" Grid.Column="0" Grid.Row="5" Margin="0,15,5,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
<ComboBox Name="burninBehaviour" Grid.Column="2" Grid.Row="5" HorizontalAlignment="Left"
<TextBlock Text="{x:Static Properties:Resources.SubtitlesView_BurnInBehaviour}" Grid.Column="0" Grid.Row="6" Margin="0,15,5,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
<ComboBox Name="burninBehaviour" Grid.Column="2" Grid.Row="7" HorizontalAlignment="Left"
ItemsSource="{Binding SubtitleBurnInBehaviourModeList, Converter={StaticResource subtitleBurnInBehaviourConverter}}"
SelectedItem="{Binding SubtitleBehaviours.SelectedBurnInBehaviour, Converter={StaticResource subtitleBurnInBehaviourConverter}}" Width="210" Margin="0,15,5,0">
<ComboBox.ToolTip>