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

List:       kde-commits
Subject:    kdemultimedia/kmix
From:       Christian Esken <esken () kde ! org>
Date:       2005-03-25 12:24:35
Message-ID: 20050325122435.13AD648F () office ! kde ! org
[Download RAW message or body]

CVS commit by esken: 

CBUGS:102232
A problem has been identified in the Master-Detection. It looks like the problem was \
already detected on 2003-08-13 by Alexander E. Patrakov, but due to missing ALSA \
documentation it could not been fixed there. The attached patch is definitely \
neccesary, and possibly also fixes bug 102232.


  M +0 -1      mixer_alsa.h   1.20
  M +7 -9      mixer_alsa9.cpp   1.54


--- kdemultimedia/kmix/mixer_alsa9.cpp  #1.53:1.54
@@ -57,5 +57,4 @@ Mixer_ALSA::Mixer_ALSA( int device, int 
         Mixer( device, card ), _handle(0)
 {
-        masterChosen = false;
         _initialUpdate = true;
 }
@@ -70,12 +69,5 @@ Mixer_ALSA::identify( snd_mixer_selem_id
         QString name = snd_mixer_selem_id_get_name( sid );
 
-        if ( name == "Master" )
-        {
-                if (!masterChosen) {
-                        m_masterDevice = snd_mixer_selem_id_get_index( sid );
-                        masterChosen = true; // -<- this makes KMix select the \
                *first* master device
-                }
-                return MixDevice::VOLUME;
-        }
+        if ( name == "Master" ) return MixDevice::VOLUME;
         if ( name == "Capture" ) return MixDevice::RECMONITOR;
         if ( name == "Master Mono" ) return MixDevice::VOLUME;
@@ -107,4 +99,5 @@ Mixer_ALSA::openMixer()
     bool virginOpen = m_mixDevices.isEmpty();
     bool validDevice = false;
+    bool masterChosen = false;
     int err;
 
@@ -210,4 +203,9 @@ Mixer_ALSA::openMixer()
         // New mix device
         MixDevice::ChannelType ct = (MixDevice::ChannelType)identify( sid );
+        if (!masterChosen && ct==MixDevice::VOLUME) {
+           // Determine a nicer MasterVolume
+           m_masterDevice = mixerIdx;
+           masterChosen = true;
+        }
 
         if( virginOpen )

--- kdemultimedia/kmix/mixer_alsa.h  #1.19:1.20
@@ -35,5 +35,4 @@ class Mixer_ALSA : public Mixer
                 AlsaMixerSidList mixer_sid_list;
 
-                bool masterChosen;
                 bool _initialUpdate;
                 snd_mixer_t *_handle;


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

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