[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/phonon
From:       Colin Guthrie <kde () colin ! guthr ! ie>
Date:       2010-01-30 11:47:19
Message-ID: 1264852039.360647.685.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1082382 by cguthrie:

pulsesupport: Make the backends explicitly state that they want PA support.

Now that we ask if pulse isactive and bypass asking the backends
for device lists etc if so, we cannot just assume that PA is supported
in the backend itself. So ensure that we enable pulseaudio support
when initialising the backends.

This was not needed before because we used to always go via the backend
for device information, even if it was just proxying on to the
PulseSupport class. This way it's more efficient and less
work to integrate into a backend.

 M  +1 -0      gstreamer/backend.cpp  
 M  +1 -1      gstreamer/devicemanager.cpp  
 M  +4 -6      phonon/pulsesupport.cpp  
 M  +3 -1      phonon/pulsesupport.h  
 M  +2 -1      xine/backend.cpp  


--- trunk/kdesupport/phonon/gstreamer/backend.cpp #1082381:1082382
@@ -53,6 +53,7 @@
 {
     // Initialise PulseAudio support
     PulseSupport *pulse = PulseSupport::getInstance();
+    pulse->enable();
     connect(pulse, SIGNAL(objectDescriptionChanged(ObjectDescriptionType)), \
SIGNAL(objectDescriptionChanged(ObjectDescriptionType)));  
     // In order to support reloading, we only set the app name once...
--- trunk/kdesupport/phonon/gstreamer/devicemanager.cpp #1082381:1082382
@@ -88,7 +88,7 @@
             m_audioSink = "pulsesink";
     }
     if ("pulsesink" != m_audioSink)
-        pulse->disable();
+        pulse->enable(false);
 
     m_videoSinkWidget = qgetenv("PHONON_GST_VIDEOMODE");
     if (m_videoSinkWidget.isEmpty()) {
--- trunk/kdesupport/phonon/phonon/pulsesupport.cpp #1082381:1082382
@@ -673,7 +673,7 @@
 }
 
 PulseSupport::PulseSupport()
- : QObject()
+ : QObject(), mEnabled(false)
 {
 #ifdef HAVE_PULSEAUDIO
     // Initialise our map (is there a better way to do this?)
@@ -736,17 +736,15 @@
 bool PulseSupport::isActive()
 {
 #ifdef HAVE_PULSEAUDIO
-    return s_pulseActive;
+    return mEnabled && s_pulseActive;
 #else
     return false;
 #endif
 }
 
-void PulseSupport::disable()
+void PulseSupport::enable(bool enabled)
 {
-#ifdef HAVE_PULSEAUDIO
-    s_pulseActive = false;
-#endif
+    mEnabled = enabled;
 }
 
 QList<int> PulseSupport::objectDescriptionIndexes(ObjectDescriptionType type) const
--- trunk/kdesupport/phonon/phonon/pulsesupport.h #1082381:1082382
@@ -43,7 +43,7 @@
             static void shutdown();
 
             bool isActive();
-            void disable();
+            void enable(bool enabled = true);
 
             QList<int> objectDescriptionIndexes(ObjectDescriptionType type) const;
             QHash<QByteArray, QVariant> objectDescriptionProperties(ObjectDescriptionType \
type, int index) const; @@ -64,6 +64,8 @@
         private:
             PulseSupport();
             ~PulseSupport();
+
+            bool mEnabled;
     };
 } // namespace Phonon
 
--- trunk/kdesupport/phonon/xine/backend.cpp #1082381:1082382
@@ -71,6 +71,7 @@
 {
     // Initialise PulseAudio support
     PulseSupport *pulse = PulseSupport::getInstance();
+    pulse->enable();
     connect(pulse, SIGNAL(objectDescriptionChanged(ObjectDescriptionType)), \
SLOT(emitObjectDescriptionChanged(ObjectDescriptionType)));  
     Q_ASSERT(s_instance == 0);
@@ -629,7 +630,7 @@
             }
 
             // We cannot find the output plugin, so let the support class know.
-            pulse->disable();
+            pulse->enable(false);
         }
 
         for (int i = 0; outputPlugins[i]; ++i) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic