Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > contrib-release-src > by-pkgid > a3a9b692ad9677f55cdf3960410addc8 > files > 5

lastfm-player-1.5.1.31879-3mdv2009.1.src.rpm

--- a/src/AudioController.cpp
+++ b/src/AudioController.cpp
@@ -134,6 +134,9 @@
              this,    SLOT  ( onTimerTimeout() ),
              Qt::DirectConnection );
 
+    // loadPlugins() gets m_output, the above connects its signal, NOW we can call setDevice()
+    m_output->setBufferCapacity( kOutputBufferMinSize );
+    m_output->setDevice( The::settings().soundCard() );
 
     // What is this interval exactly?
     // It's how often we send out timeChanged signals (500 ms)
@@ -179,9 +182,6 @@
     if ( m_output == 0 )
         return false;
 
-    m_output->setBufferCapacity( kOutputBufferMinSize );
-    m_output->setDevice( The::settings().soundCard() );
-
     m_proxyOutput = new ProxyOutput();
 
     return true;
--- a/src/Radio.cpp
+++ b/src/Radio.cpp
@@ -646,7 +646,7 @@
     }
     else
     {
-        if ( err == Radio_PluginLoadFailed )
+        if ( err == Radio_PluginLoadFailed || err == Radio_NoSoundcard )
         {
             m_broken = true;
         }
--- a/src/container.cpp
+++ b/src/container.cpp
@@ -75,6 +75,7 @@
 Container::Container()
         : QMainWindow(),
           m_userCheck( false ),
+          m_soundcardError( false ),
           m_sidebarEnabled( false ),
           m_sidebarWidth( 190 )
 #ifndef Q_WS_MAC
@@ -773,6 +774,7 @@
         case Handshake_SessionFailed:
         case Radio_PluginLoadFailed:
         case Radio_NoSoundcard:
+            m_soundcardError = true;
         case Radio_PlaybackError:
         case Radio_UnknownError:
         {
@@ -1915,8 +1917,11 @@
 
         default:
         {
-            ui.actionPlay->setEnabled( true );
-            ui.actionStop->setEnabled( true );
+            if ( !m_soundcardError )
+            {
+                ui.actionPlay->setEnabled( true );
+                ui.actionStop->setEnabled( true );
+            }
         }
         break;
     }
--- a/src/container.h
+++ b/src/container.h
@@ -107,6 +107,7 @@
         class DiagnosticsDialog *m_diagnosticsDialog;
 
         bool m_userCheck;
+        bool m_soundcardError;
         bool m_sidebarEnabled;
         int  m_lastVolume;
         int  m_sidebarWidth;