added audio codec option

This commit is contained in:
DYefremov
2020-07-16 20:45:27 +03:00
parent eaf5e39458
commit faf228fa6f
2 changed files with 19 additions and 16 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1
<!-- Generated with glade 3.22.2
The MIT License (MIT)
@@ -1829,21 +1829,6 @@ Author: Dmitriy Yefremov
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="h246_radio_button1">
<property name="label">mp3</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">center</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="sample_rate_label">
<property name="visible">True</property>
@@ -1889,6 +1874,21 @@ Author: Dmitriy Yefremov
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="audio_codec_combo_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="active_id">mp3</property>
<items>
<item id="mp3" translatable="yes">mp3</item>
<item id="a52" translatable="yes">AC3</item>
</items>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
</child>
<child type="label">

View File

@@ -124,6 +124,7 @@ class SettingsDialog:
self._audio_bitrate_field = builder.get_object("audio_bitrate_field")
self._audio_channels_combo_box = builder.get_object("audio_channels_combo_box")
self._audio_sample_rate_combo_box = builder.get_object("audio_sample_rate_combo_box")
self._audio_codec_combo_box = builder.get_object("audio_codec_combo_box")
self._apply_presets_button.bind_property("visible", header_separator, "visible")
self._transcoding_switch.bind_property("active", builder.get_object("record_box"), "sensitive")
self._edit_preset_switch.bind_property("active", self._apply_presets_button, "sensitive")
@@ -633,6 +634,7 @@ class SettingsDialog:
self._audio_bitrate_field.set_text(prs.get("ab", "0"))
self._audio_channels_combo_box.set_active_id(prs.get("channels", "2"))
self._audio_sample_rate_combo_box.set_active_id(prs.get("samplerate", "44100"))
self._audio_codec_combo_box.set_active_id(prs.get("acodec", "mp3"))
def on_apply_presets(self, item):
if not self.is_data_correct(self._digit_elems):
@@ -650,6 +652,7 @@ class SettingsDialog:
prs["ab"] = self._audio_bitrate_field.get_text()
prs["channels"] = self._audio_channels_combo_box.get_active_id()
prs["samplerate"] = self._audio_sample_rate_combo_box.get_active_id()
prs["acodec"] = self._audio_codec_combo_box.get_active_id()
self._ext_settings.transcoding_presets = presets
self._edit_preset_switch.set_active(False)