[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-04-30 21:30:40
Message-ID: 20050430213040.A29D6629 () office ! kde ! org
[Download RAW message or body]

CVS commit by esken: 

More cleanup: Remove _errno and Mixer::getMixer()


  M +3 -71     mixer.cpp   1.97
  M +0 -4      mixer.h   1.61


--- kdemultimedia/kmix/mixer.cpp  #1.96:1.97
@@ -71,6 +71,4 @@ Mixer::Mixer( int driver, int device ) :
   _pollingTimer = 0;
 
-  _errno  = 0;
-
    _mixerBackend = 0;
    getMixerFunc *f = g_mixerFactories[driver].getMixer;
@@ -106,65 +104,4 @@ Mixer::~Mixer() {
 }
 
-#if 0
-Mixer* Mixer::getMixer( int driver, int device )
-{
-   // ---------------- Get the mixer Factory and produce one Mixer instance ------------
-   _mixerBackend = 0;
-   getMixerFunc *f = g_mixerFactories[driver].getMixer;
-   if( f!=0 ) {
-     _mixerBackend = f( device );
-   }
-
-   // ---------------- Open the freshly produced Mixer instance -----------------------
-
-   //   kdDebug(67100) << "Mixer::setupMixer()" << endl;
-   mixer->close();      // To be sure, release mixer before (re-)opening
-
-   // We open the Mixer, so that we have an initialized MixDevice list
-   int ret = mixer->open();
-   if (ret != 0) {
-      mixer->_errno = ret;
-      return mixer;
-   }
-   else if( mixer->m_mixDevices.isEmpty() )
-   {
-      // This case is a workaround for old Mixer_*.cpp backends. They return 0 on openMixer() but
-      // might not have devices in them. So we work around them here. It would be better if they
-      // would return ERR_NODEV themselves.
-      mixer->_errno = ERR_NODEV;
-      return mixer;
-   }
-
-   // Create a near-perfect unique ID
-   mixer->_id = mixer->mixerName() + ":" + (Mixer::mixers().count() + 1);
-   
-   // --------- Copy the hardware values to the MixDevice -------------------
-   MixSet &mset = mixer->m_mixDevices;
-   if( !mset.isEmpty() ) {
-       // Copy the initial mix set
-       //       kdDebug(67100) << "Mixer::setupMixer() copy Set" << endl;
-       MixDevice* md;
-       for( md = mset.first(); md != 0; md = mset.next() )
-       {
-           MixDevice* mdCopy = mixer->m_mixDevices.first();
-           while( mdCopy!=0 && mdCopy->num() != md->num() ) {
-               mdCopy = mixer->m_mixDevices.next();
-           }
-           if ( mdCopy != 0 ) {
-               // The "mdCopy != 0" was not checked before, but its safer to do so
-               mixer->setRecordSource( md->num(), md->isRecSource() );
-               Volume &vol = mdCopy->getVolume();
-               vol.setVolume( md->getVolume() );
-               mdCopy->setMuted( md->isMuted() );
-
-               // !! might need writeVolumeToHW( mdCopy->num(), mdCopy->getVolume() );
-           }
-       }
-   }
-
-   return mixer;
-}
-#endif
-
 void Mixer::volumeSave( KConfig *config )
 {
@@ -210,4 +147,6 @@ int Mixer::open()
 {
       int err = _mixerBackend->open();
+      _id = mixerName() + ":" + (Mixer::mixers().count() + 1);
+
       if( err == ERR_INCOMPATIBLESET )   // !!! When does this happen ?!?
         {
@@ -383,11 +322,4 @@ QString& Mixer::id()
 }
 
-// !!! remove
-int Mixer::getErrno() const {
-    return this->_errno;
-}
-
-
-
 
 

--- kdemultimedia/kmix/mixer.h  #1.60:1.61
@@ -80,7 +80,4 @@ class Mixer : public QObject, virtual pu
       virtual int close();
 
-      /// Returns the last error number
-      int getErrno() const;
-
       /// Returns a detailed state message after errors. Only for diagnostic purposes, no i18n.
       QString& stateMessage() const;
@@ -142,5 +139,4 @@ class Mixer : public QObject, virtual pu
 
       int m_balance; // from -100 (just left) to 100 (just right)
-      int  _errno;
 
       QPtrList<MixSet> m_profiles;


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

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