sink-widget: add support for TrueHD and DTS-HD formats
Also add toggles for TrueHD and DTS-HD formats in the sink widget. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/merge_requests/71>
This commit is contained in:
parent
5bf5b95127
commit
a400e057d1
|
@ -581,6 +581,32 @@
|
|||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="encodingFormatTRUEHD">
|
||||
<property name="label" translatable="yes">TrueHD</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="encodingFormatDTSHD">
|
||||
<property name="label" translatable="yes">DTS-HD</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
|
@ -73,6 +73,28 @@ SinkWidget::SinkWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
|
|||
encodings[i].widget->signal_toggled().connect(sigc::mem_fun(*this, &SinkWidget::onEncodingsChange));
|
||||
encodings[i].widget->set_sensitive(true);
|
||||
}
|
||||
#endif
|
||||
++i;
|
||||
encodings[i].encoding = PA_ENCODING_INVALID;
|
||||
x->get_widget("encodingFormatTRUEHD", encodings[i].widget);
|
||||
encodings[i].widget->set_sensitive(false);
|
||||
#ifdef PA_ENCODING_TRUEHD_IEC61937
|
||||
if (pa_context_get_server_protocol_version(get_context()) >= 33) {
|
||||
encodings[i].encoding = PA_ENCODING_TRUEHD_IEC61937;
|
||||
encodings[i].widget->signal_toggled().connect(sigc::mem_fun(*this, &SinkWidget::onEncodingsChange));
|
||||
encodings[i].widget->set_sensitive(true);
|
||||
}
|
||||
#endif
|
||||
++i;
|
||||
encodings[i].encoding = PA_ENCODING_INVALID;
|
||||
x->get_widget("encodingFormatDTSHD", encodings[i].widget);
|
||||
encodings[i].widget->set_sensitive(false);
|
||||
#ifdef PA_ENCODING_DTSHD_IEC61937
|
||||
if (pa_context_get_server_protocol_version(get_context()) >= 33) {
|
||||
encodings[i].encoding = PA_ENCODING_DTSHD_IEC61937;
|
||||
encodings[i].widget->signal_toggled().connect(sigc::mem_fun(*this, &SinkWidget::onEncodingsChange));
|
||||
encodings[i].widget->set_sensitive(true);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#if HAVE_EXT_DEVICE_RESTORE_API
|
||||
# include <pulse/format.h>
|
||||
|
||||
# define PAVU_NUM_ENCODINGS 6
|
||||
# define PAVU_NUM_ENCODINGS 8
|
||||
|
||||
typedef struct {
|
||||
pa_encoding encoding;
|
||||
|
|
Loading…
Reference in New Issue