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:
Wim Taymans 2022-01-10 17:55:02 +01:00
parent 5bf5b95127
commit a400e057d1
3 changed files with 49 additions and 1 deletions

View File

@ -581,6 +581,32 @@
<property name="top_attach">1</property> <property name="top_attach">1</property>
</packing> </packing>
</child> </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> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>

View File

@ -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->signal_toggled().connect(sigc::mem_fun(*this, &SinkWidget::onEncodingsChange));
encodings[i].widget->set_sensitive(true); 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
#endif #endif
} }

View File

@ -27,7 +27,7 @@
#if HAVE_EXT_DEVICE_RESTORE_API #if HAVE_EXT_DEVICE_RESTORE_API
# include <pulse/format.h> # include <pulse/format.h>
# define PAVU_NUM_ENCODINGS 6 # define PAVU_NUM_ENCODINGS 8
typedef struct { typedef struct {
pa_encoding encoding; pa_encoding encoding;