2891858
From cbf3acb54379f3334cf5d7844888536bb54d1c5e Mon Sep 17 00:00:00 2001
2891858
From: Akihiro Tsukada <atsukada@users.sourceforge.net>
2891858
Date: Mon, 25 Feb 2013 01:03:31 +0900
2891858
Subject: [PATCH 1/2] sinkwidget: add support for AAC pass-through
2891858
2891858
---
2891858
 src/pavucontrol.glade | 19 ++++++++++++++++---
2891858
 src/sinkwidget.cc     | 12 ++++++++++++
2891858
 src/sinkwidget.h      |  2 +-
2891858
 3 files changed, 29 insertions(+), 4 deletions(-)
2891858
2891858
diff --git a/src/pavucontrol.glade b/src/pavucontrol.glade
2891858
index 6defb3d..4b3dd01 100644
2891858
--- a/src/pavucontrol.glade
2891858
+++ b/src/pavucontrol.glade
2891858
@@ -427,9 +427,6 @@
2891858
                             <property name="n_rows">2</property>
2891858
                             <property name="n_columns">3</property>
2891858
                             <child>
2891858
-                              <placeholder/>
2891858
-                            </child>
2891858
-                            <child>
2891858
                               <object class="GtkCheckButton" id="encodingFormatPCM">
2891858
                                 <property name="label" translatable="yes">PCM</property>
2891858
                                 <property name="use_action_appearance">False</property>
2891858
@@ -499,6 +496,22 @@
2891858
                                 <property name="bottom_attach">2</property>
2891858
                               </packing>
2891858
                             </child>
2891858
+                            <child>
2891858
+                              <object class="GtkCheckButton" id="encodingFormatAAC">
2891858
+                                <property name="label" translatable="yes">AAC</property>
2891858
+                                <property name="use_action_appearance">False</property>
2891858
+                                <property name="visible">True</property>
2891858
+                                <property name="can_focus">True</property>
2891858
+                                <property name="receives_default">False</property>
2891858
+                                <property name="draw_indicator">True</property>
2891858
+                              </object>
2891858
+                              <packing>
2891858
+                                <property name="left_attach">2</property>
2891858
+                                <property name="right_attach">3</property>
2891858
+                                <property name="top_attach">1</property>
2891858
+                                <property name="bottom_attach">2</property>
2891858
+                              </packing>
2891858
+                            </child>
2891858
                           </object>
2891858
                           <packing>
2891858
                             <property name="expand">False</property>
2891858
diff --git a/src/sinkwidget.cc b/src/sinkwidget.cc
2891858
index 1726550..7f4902c 100644
2891858
--- a/src/sinkwidget.cc
2891858
+++ b/src/sinkwidget.cc
2891858
@@ -62,6 +62,18 @@ SinkWidget::SinkWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
2891858
     encodings[i].encoding = PA_ENCODING_DTS_IEC61937;
2891858
     x->get_widget("encodingFormatDTS", encodings[i].widget);
2891858
     encodings[i].widget->signal_toggled().connect(sigc::mem_fun(*this, &SinkWidget::onEncodingsChange));
2891858
+
2891858
+    ++i;
2891858
+    encodings[i].encoding = PA_ENCODING_INVALID;
2891858
+    x->get_widget("encodingFormatAAC", encodings[i].widget);
2891858
+    encodings[i].widget->set_sensitive(false);
2891858
+#ifdef PA_ENCODING_MPEG2_AAC_IEC61937
2891858
+    if (pa_context_get_server_protocol_version(get_context()) >= 28) {
2891858
+        encodings[i].encoding = PA_ENCODING_MPEG2_AAC_IEC61937;
2891858
+        encodings[i].widget->signal_toggled().connect(sigc::mem_fun(*this, &SinkWidget::onEncodingsChange));
2891858
+        encodings[i].widget->set_sensitive(true);
2891858
+    }
2891858
+#endif
2891858
 #endif
2891858
 }
2891858
 
2891858
diff --git a/src/sinkwidget.h b/src/sinkwidget.h
2891858
index a2fbab9..0044ffc 100644
2891858
--- a/src/sinkwidget.h
2891858
+++ b/src/sinkwidget.h
2891858
@@ -27,7 +27,7 @@
2891858
 #if HAVE_EXT_DEVICE_RESTORE_API
2891858
 #  include <pulse/format.h>
2891858
 
2891858
-#  define PAVU_NUM_ENCODINGS 5
2891858
+#  define PAVU_NUM_ENCODINGS 6
2891858
 
2891858
 typedef struct {
2891858
     pa_encoding encoding;
2891858
-- 
2891858
1.8.4.2
2891858