[pulseaudio-commits] [Git][pulseaudio/pavucontrol][master] sink-widget: add support for TrueHD and DTS-HD formats

PulseAudio Marge Bot (@pulseaudio-merge-bot) gitlab at gitlab.freedesktop.org
Mon Jan 10 18:59:42 UTC 2022



PulseAudio Marge Bot pushed to branch master at PulseAudio / pavucontrol


Commits:
a400e057 by Wim Taymans at 2022-01-10T17:55:02+01:00
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>

- - - - -


3 changed files:

- src/pavucontrol.glade
- src/sinkwidget.cc
- src/sinkwidget.h


Changes:

=====================================
src/pavucontrol.glade
=====================================
@@ -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>


=====================================
src/sinkwidget.cc
=====================================
@@ -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
 }


=====================================
src/sinkwidget.h
=====================================
@@ -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;



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/commit/a400e057d182391f51cd7ab5078b9c5818efd7e8

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/-/commit/a400e057d182391f51cd7ab5078b9c5818efd7e8
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20220110/61f377bb/attachment-0001.htm>


More information about the pulseaudio-commits mailing list