[Kwintv] kdenonbeta/kwintv3/qtvision

George Staikos staikos at kde.org
Fri Aug 1 00:02:48 CEST 2003


CVS commit by staikos: 

Dirk's mute patch, and a small reformatting in mainwindow.cpp

CCMAIL: kwintv at mail.kde.org


  M +3 -3      clients/mainwindow.cpp   1.63
  M +16 -17    qtvision.cpp   1.128


--- kdenonbeta/kwintv3/qtvision/qtvision.cpp  #1.127:1.128
@@ -127,13 +127,11 @@ QtVision::~QtVision()
 {
     _cs->save();
-    stopDevice();
     
-    // Save volume related settings. We mute the mixer element in use
-    // if autoMute is set from general config. This is due to some cards
-    // not muting on application exit.
-    if(_cfg->autoMute == true)
+    // Save current volume state to config file before stopping device
         _cfg->volumeMuted = _muted;
     _cfg->volumeLeft = _am->volumeLeft();
-    _cfg->volumeRight= _am->volumeRight();
+    _cfg->volumeRight = _am->volumeRight();
+
+    stopDevice();
     
     delete _cfg;
@@ -170,4 +168,7 @@ DCOPRef QtVision::channelIface()
 void QtVision::start()
 {
+    bool muteStartup;
+
+
     kdDebug () << "QtVision::start: Set initial volume settings... " << endl;    
     
@@ -177,10 +178,10 @@ void QtVision::start()
     ChannelVolState.changeEventId = -2;
     
-    // Make sure the volume mute state is restored...
-    _muted = !_muted;
+    // Restore volume and mute state
+    muteStartup = _muted;
+    setVolume(ChannelVolState.left, ChannelVolState.right);
+    _muted = !muteStartup;
     volumeMute();
-     
-    emit volumeChanged (ChannelVolState.left, ChannelVolState.right);
-    kdDebug () << "QtVision::start: Emitted volume settings...." << endl;
+    kdDebug () << "QtVision::start: Restored volume settings...." << endl;
     
     if ( !_view )
@@ -731,10 +732,8 @@ void QtVision::volumeDown() {
 
 void QtVision::setVolume(int left, int right) {
-    // Unmute, set the flag to unmute and emit
-    // a volumeMuted signal to update the GUI
+    // Unmute if we are muted
     if (_muted)
     {
-      _muted = false;
-      emit volumeMuted (_muted);
+      volumeMute();
     }
     

--- kdenonbeta/kwintv3/qtvision/clients/mainwindow.cpp  #1.62:1.63
@@ -366,6 +366,6 @@ void MainWindow::setShowTrayIcon( bool s
             kdDebug() << "Creating systray icon" << endl;
            _systray = new QtVisionSysTray(this, "qtvision_systray", _actions);
-                                         connect (_systray, SIGNAL(doubleClicked()), _screen, SLOT(resetViewMode()));
-                                         connect (_systray, SIGNAL(leftClicked()), _screen, SLOT(bringToFront()));
+            connect(_systray, SIGNAL(doubleClicked()), _screen, SLOT(resetViewMode()));
+            connect(_systray, SIGNAL(leftClicked()), _screen, SLOT(bringToFront()));
         }
         kdDebug() << "Showing systray icon" << endl;




More information about the kwintv mailing list