summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-06-03 21:56:10 +0000
committerjstebbins <[email protected]>2011-06-03 21:56:10 +0000
commit769ae8079fb560e598babf54e20eefca332b37d5 (patch)
treec7689e07101982244ece2a2c7dec0cb0074b5360 /gtk/src
parent3a6f545a6bd88001c994383b32e9560000111899 (diff)
LinGui: Add support for naming audio tracks.
Also fix hb_audio_add. It was not copying the audio name. And fix audio track name parsing in the CLI. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4020 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/audiohandler.c9
-rw-r--r--gtk/src/ghb.ui63
-rw-r--r--gtk/src/hb-backend.c12
-rw-r--r--gtk/src/internal_defaults.xml2
4 files changed, 71 insertions, 15 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index 0e809ebcb..f6dfbf19e 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -572,7 +572,7 @@ G_MODULE_EXPORT gchar*
format_gain_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud)
{
if ( val >= 21.0 )
- return g_strdup_printf("*11*", (int)val);
+ return g_strdup_printf("*11*");
return g_strdup_printf("%ddB", (int)val);
}
@@ -701,6 +701,7 @@ audio_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t
ghb_settings_set_value(ud->settings, "AudioEncoderActual", ghb_settings_get_value(asettings, "AudioEncoderActual"));
ghb_check_dependency(ud, NULL, "AudioEncoderActual");
ghb_ui_update(ud, "AudioBitrate", ghb_settings_get_value(asettings, "AudioBitrate"));
+ ghb_ui_update(ud, "AudioTrackName", ghb_settings_get_value(asettings, "AudioTrackName"));
ghb_ui_update(ud, "AudioSamplerate", ghb_settings_get_value(asettings, "AudioSamplerate"));
ghb_ui_update(ud, "AudioMixdown", ghb_settings_get_value(asettings, "AudioMixdown"));
ghb_ui_update(ud, "AudioTrackDRCSlider", ghb_settings_get_value(asettings, "AudioTrackDRCSlider"));
@@ -726,6 +727,12 @@ ghb_add_audio(signal_user_data_t *ud, GValue *settings)
track = ghb_settings_combo_option(settings, "AudioTrack");
ghb_settings_set_string(settings, "AudioTrackDescription", track);
+ GValue *aname;
+ aname = ghb_dict_lookup(settings, "AudioTrackName");
+ if (aname == NULL)
+ {
+ ghb_settings_set_string(settings, "AudioTrackName", "");
+ }
audio_list = ghb_settings_get_value(ud->settings, "audio_list");
if (audio_list == NULL)
{
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 7c61f92e1..729880e15 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -3869,14 +3869,14 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property>
<object class="GtkTable" id="table14">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="n_rows">3</property>
+ <property name="n_rows">4</property>
<property name="n_columns">3</property>
<property name="row_spacing">5</property>
<child>
- <object class="GtkLabel" id="sr_label">
+ <object class="GtkLabel" id="audio_name_label">
<property name="visible">True</property>
<property name="xalign">1</property>
- <property name="label" translatable="yes">Sample Rate:</property>
+ <property name="label" translatable="yes">Audio Track Name:</property>
<property name="use_markup">True</property>
</object>
<packing>
@@ -3888,16 +3888,51 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property>
</packing>
</child>
<child>
- <object class="GtkComboBox" id="AudioSamplerate">
+ <object class="GtkEntry" id="AudioTrackName">
<property name="visible">True</property>
+ <property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip-text" translatable="yes">Set the sample rate of the output audio track.</property>
+ <property name="max_length">40</property>
+ <property name="activates_default">True</property>
+ <property name="width_chars">30</property>
+ <property name="truncate_multiline">True</property>
+ <property name="tooltip-text" translatable="yes">Set the audio track name. Players may use this in the audio selection list.</property>
<signal handler="audio_widget_changed_cb" name="changed"/>
</object>
<packing>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
- <property name="left_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="sr_label">
+ <property name="visible">True</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">Sample Rate:</property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="AudioSamplerate">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip-text" translatable="yes">Set the sample rate of the output audio track.</property>
+ <signal handler="audio_widget_changed_cb" name="changed"/>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
@@ -3910,8 +3945,8 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property>
<property name="use_markup">True</property>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="x_options">GTK_FILL</property>
@@ -3930,8 +3965,8 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property>
<signal name="format_value" handler="format_gain_cb"/>
</object>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="x_options">GTK_FILL|GTK_EXPAND</property>
@@ -3945,8 +3980,8 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property>
<property name="use_markup">True</property>
</object>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="x_options">GTK_FILL</property>
@@ -3967,8 +4002,8 @@ For source audio that has a wide dynamic range (very loud and very soft sequence
<signal name="format_value" handler="format_drc_cb"/>
</object>
<packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="x_options">GTK_FILL|GTK_EXPAND</property>
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 2d17a7c32..39c8cbd70 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -4698,6 +4698,18 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
audio.in.track = ghb_settings_get_int(asettings, "AudioTrack");
audio.out.track = tcount;
+ char * aname = ghb_settings_get_string(asettings, "AudioTrackName");
+ if (aname && *aname)
+ {
+ // This leaks, but there is no easy way to clean up
+ // presently
+ audio.out.name = aname;
+ }
+ else
+ {
+ g_free(aname);
+ }
+
aconfig = (hb_audio_config_t *) hb_list_audio_config_item(
title->list_audio, audio.in.track );
diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml
index c4792efa3..e4a4a72b6 100644
--- a/gtk/src/internal_defaults.xml
+++ b/gtk/src/internal_defaults.xml
@@ -4,6 +4,8 @@
<dict>
<key>Initialization</key>
<dict>
+ <key>AudioTrackName</key>
+ <string></string>
<key>AudioEncoderActual</key>
<string></string>
<key>angle_count</key>