OSDN Git Service

kmix: remove unused configuration checks
authorIvailo Monev <xakepa10@laimg.moc>
Wed, 19 Feb 2020 16:13:43 +0000 (16:13 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Wed, 19 Feb 2020 16:13:43 +0000 (16:13 +0000)
since Katie requires compiler with C++11 support the shared pointer
checks could be ommited

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
56 files changed:
kmix/CMakeLists.txt
kmix/ConfigureChecks.cmake [deleted file]
kmix/apps/kmix.cpp
kmix/apps/kmix.h
kmix/apps/kmixd.cpp
kmix/apps/kmixd.h
kmix/backends/kmix-backends.cpp
kmix/backends/mixer_alsa.h
kmix/backends/mixer_alsa9.cpp
kmix/backends/mixer_backend.cpp
kmix/backends/mixer_backend.h
kmix/backends/mixer_mpris2.cpp
kmix/backends/mixer_mpris2.h
kmix/backends/mixer_oss.cpp
kmix/backends/mixer_oss.h
kmix/backends/mixer_oss4.cpp
kmix/backends/mixer_oss4.h
kmix/backends/mixer_pulse.cpp
kmix/backends/mixer_pulse.h
kmix/backends/mixer_sun.cpp
kmix/backends/mixer_sun.h
kmix/config.h.cmake [deleted file]
kmix/core/ControlPool.cpp
kmix/core/ControlPool.h
kmix/core/MasterControl.h
kmix/core/mixdevice.cpp
kmix/core/mixdevice.h
kmix/core/mixdevicecomposite.cpp
kmix/core/mixdevicecomposite.h
kmix/core/mixer.cpp
kmix/core/mixer.h
kmix/core/mixertoolbox.cpp
kmix/core/mixset.cpp
kmix/core/mixset.h
kmix/dbus/dbuscontrolwrapper.cpp
kmix/dbus/dbuscontrolwrapper.h
kmix/dbus/dbusmixerwrapper.cpp
kmix/dbus/dbusmixsetwrapper.cpp
kmix/gui/dialogselectmaster.cpp
kmix/gui/dialogviewconfiguration.cpp
kmix/gui/kmixdockwidget.cpp
kmix/gui/mdwenum.cpp
kmix/gui/mdwenum.h
kmix/gui/mdwmoveaction.cpp
kmix/gui/mdwmoveaction.h
kmix/gui/mdwslider.cpp
kmix/gui/mdwslider.h
kmix/gui/mixdevicewidget.cpp
kmix/gui/mixdevicewidget.h
kmix/gui/osdwidget.cpp
kmix/gui/viewbase.cpp
kmix/gui/viewbase.h
kmix/gui/viewdockareapopup.cpp
kmix/gui/viewdockareapopup.h
kmix/gui/viewsliders.cpp
kmix/gui/viewsliders.h

index 8b09b2a..d849040 100644 (file)
@@ -24,20 +24,6 @@ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=67100)
 
 include_directories(/usr/lib/oss/include)
 
-
-include(CheckCXXSourceCompiles)
-check_cxx_source_compiles("
-    #include <memory>
-    int main() { std::shared_ptr<int> p; return 0; }
-" HAVE_STD_SHARED_PTR)
-check_cxx_source_compiles("
-    #include <tr1/memory>
-    int main() { std::tr1::shared_ptr<int> p; return 0; }
-" HAVE_STD_TR1_SHARED_PTR)
-
-
-configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
-
 add_subdirectory( pics ) 
 add_subdirectory( profiles ) 
 #add_subdirectory( tests )
diff --git a/kmix/ConfigureChecks.cmake b/kmix/ConfigureChecks.cmake
deleted file mode 100644 (file)
index 642465b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-include(CheckIncludeFiles)
-include(CheckTypeSize)
-include(CheckStructMember)
-include(MacroBoolTo01)
-
-macro_bool_to_01(OGGVORBIS_FOUND HAVE_VORBIS)
-
-check_include_files(machine/endian.h HAVE_MACHINE_ENDIAN_H)
-# Linux has <endian.h>, FreeBSD has <sys/endian.h> and Solaris has neither.
-check_include_files(endian.h HAVE_ENDIAN_H)
-check_include_files(sys/endian.h HAVE_SYS_ENDIAN_H)
-check_include_files(unistd.h HAVE_UNISTD_H)
index 9c011d2..dbfe65c 100644 (file)
@@ -930,14 +930,14 @@ KMixWindow::unplugged(const QString& udi)
             }
           MixerToolBox::instance()->removeMixer(mixer);
           // Check whether the Global Master disappeared, and select a new one if necessary
-          shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+          std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
           if (globalMasterMixerDestroyed || md.get() == 0)
             {
               // We don't know what the global master should be now.
               // So lets play stupid, and just select the recommended master of the first device
               if (Mixer::mixers().count() > 0)
                 {
-                  shared_ptr<MixDevice> master =
+                  std::shared_ptr<MixDevice> master =
                       ((Mixer::mixers())[0])->getLocalMasterMD();
                   if (master.get() != 0)
                     {
@@ -1102,7 +1102,7 @@ KMixWindow::increaseOrDecreaseVolume(bool increase)
   Mixer* mixer = Mixer::getGlobalMasterMixer(); // only needed for the awkward construct below
   if (mixer == 0)
     return; // e.g. when no soundcard is available
-  shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+  std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
   if (md.get() == 0)
     return; // shouldn't happen, but lets play safe
 
@@ -1131,7 +1131,7 @@ KMixWindow::showVolumeDisplay()
   Mixer* mixer = Mixer::getGlobalMasterMixer();
   if (mixer == 0)
     return; // e.g. when no soundcard is available
-  shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+  std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
   if (md.get() == 0)
     return; // shouldn't happen, but lets play safe
     
@@ -1162,7 +1162,7 @@ void KMixWindow::slotMute()
        Mixer* mixer = Mixer::getGlobalMasterMixer();
        if (mixer == 0)
                return; // e.g. when no soundcard is available
-       shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+       std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
        if (md.get() == 0)
                return; // shouldn't happen, but lets play safe
        md->toggleMute();
index 7e5593a..6664771 100644 (file)
 #ifndef KMIX_H
 #define KMIX_H
 
-
-#include <config.h>
-
 // Qt
 #include <QString>
-
 #include <QLabel>
 #include <qlist.h>
 #include <QVBoxLayout>
 #include <QPushButton>
 #include <QTimer>
-class KTabWidget;
 
 // KDE
+class KTabWidget;
 class KAccel;
 class KAction;
 #include <kxmlguiwindow.h>
index 17217b3..d08af07 100644 (file)
@@ -158,7 +158,7 @@ void KMixD::saveBaseConfig()
    if ( mixerMasterCard != 0 ) {
       config.writeEntry( "MasterMixer", mixerMasterCard->id() );
    }
-   shared_ptr<MixDevice> mdMaster = Mixer::getGlobalMasterMD();
+   std::shared_ptr<MixDevice> mdMaster = Mixer::getGlobalMasterMD();
    if ( mdMaster ) {
       config.writeEntry( "MasterMixerDevice", mdMaster->id() );
    }
@@ -288,12 +288,12 @@ void KMixD::unplugged( const QString& udi)
 
             MixerToolBox::instance()->removeMixer(mixer);
             // Check whether the Global Master disappeared, and select a new one if necessary
-            shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+            std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
             if ( globalMasterMixerDestroyed || md.get() == 0 ) {
                 // We don't know what the global master should be now.
                 // So lets play stupid, and just select the recommended master of the first device
                 if ( Mixer::mixers().count() > 0 ) {
-                       shared_ptr<MixDevice> master = ((Mixer::mixers())[0])->getLocalMasterMD();
+                    std::shared_ptr<MixDevice> master = ((Mixer::mixers())[0])->getLocalMasterMD();
                     if ( master.get() != 0 ) {
                         QString localMaster = master->id();
                         Mixer::setGlobalMaster( ((Mixer::mixers())[0])->id(), localMaster, false);
index 6ab5383..78d5add 100644 (file)
 #ifndef KMIXD_H
 #define KMIXD_H
 
-
-#include <config.h>
-
 // Qt
 #include <QString>
 #include <QtDBus/QtDBus> 
-
-#include <qlist.h>
+#include <QList>
 #include <QTimer>
 
 // KDE
index 84d76e3..35a14a5 100644 (file)
@@ -22,8 +22,6 @@
 
 /* This code is being #include'd from mixer.cpp */
 
-#include <config.h>
-
 #include "mixer_backend.h"
 #include "core/mixer.h"
 
index 6d2703f..0dd9cb6 100644 (file)
@@ -42,8 +42,8 @@ public:
     explicit Mixer_ALSA(Mixer *mixer, int device = -1 );
     ~Mixer_ALSA();
 
-    virtual int  readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md );
-    virtual int  writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> md );
+    virtual int  readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> md );
+    virtual int  writeVolumeToHW ( const QString& id, std::shared_ptr<MixDevice> md );
     virtual void setEnumIdHW( const QString& id, unsigned int);
     virtual unsigned int enumIdHW(const QString& id);
     virtual bool prepareUpdateFromHW();
index f48dd4e..8d3be47 100644 (file)
@@ -228,7 +228,7 @@ int Mixer_ALSA::open()
             qDeleteAll(enumList); // clear temporary list
                }
 
-               shared_ptr<MixDevice> md = mdNew->addToPool();
+               std::shared_ptr<MixDevice> md = mdNew->addToPool();
         m_mixDevices.append( md );
          
 
@@ -740,7 +740,7 @@ unsigned int Mixer_ALSA::enumIdHW(const QString& id) {
 
 
 int
-Mixer_ALSA::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
+Mixer_ALSA::readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> md )
 {
     Volume& volumePlayback = md->playbackVolume();
     Volume& volumeCapture  = md->captureVolume();
@@ -834,7 +834,7 @@ Mixer_ALSA::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
         // Refresh the capture switch information of *all* controls of this card.
         // Doing it for all is necessary, because enabling one record source often
         // automatically disables another record source (due to the hardware design)
-        foreach ( shared_ptr<MixDevice> md, m_mixDevices )
+        foreach ( std::shared_ptr<MixDevice> md, m_mixDevices )
         {
             bool isRecsrc =  isRecsrcHW( md->id() );
             // kDebug() << "Mixer::setRecordSource(): isRecsrcHW(" <<  md->id() << ") =" <<  isRecsrc;
@@ -849,7 +849,7 @@ Mixer_ALSA::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
 }
 
 int
-Mixer_ALSA::writeVolumeToHW( const QString& id, shared_ptr<MixDevice> md )
+Mixer_ALSA::writeVolumeToHW( const QString& id, std::shared_ptr<MixDevice> md )
 {
     Volume& volumePlayback = md->playbackVolume();
     Volume& volumeCapture  = md->captureVolume();
index 6806c92..48a372f 100644 (file)
@@ -74,7 +74,7 @@ Mixer_Backend::~Mixer_Backend()
 
 void Mixer_Backend::freeMixDevices()
 {
-       foreach (shared_ptr<MixDevice> md, m_mixDevices)
+       foreach (std::shared_ptr<MixDevice> md, m_mixDevices)
                md->close();
 
        m_mixDevices.clear();
@@ -174,7 +174,7 @@ void Mixer_Backend::readSetFromHW()
 
        int ret = Mixer::OK_UNCHANGED;
 
-       foreach (shared_ptr<MixDevice> md, m_mixDevices )
+       foreach (std::shared_ptr<MixDevice> md, m_mixDevices )
        {
          //bool debugMe = (md->id() == "PCM:0" );
          bool debugMe = false;
@@ -242,7 +242,7 @@ void Mixer_Backend::readSetFromHW()
  * first device in the device list. Backends can override this (i.e. the ALSA Backend does so).
  * The users preference is NOT returned by this method - see the Mixer class for that.
  */
-shared_ptr<MixDevice> Mixer_Backend::recommendedMaster()
+std::shared_ptr<MixDevice> Mixer_Backend::recommendedMaster()
 {
        if ( m_recommendedMaster )
        {
index 5e9ef1d..d9d622f 100644 (file)
@@ -93,9 +93,9 @@ protected:
   void readSetFromHWforceUpdate() const;
 
   /// Volume Read
-  virtual int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> ) = 0;
+  virtual int readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> ) = 0;
   /// Volume Write
-  virtual int writeVolumeToHW( const QString& id, shared_ptr<MixDevice> ) = 0;
+  virtual int writeVolumeToHW( const QString& id, std::shared_ptr<MixDevice> ) = 0;
 
   /// Enums
   virtual void setEnumIdHW(const QString& id, unsigned int);
@@ -111,7 +111,7 @@ protected:
   /// Overwrite in the backend if the backend can see changes without polling
   virtual bool needsPolling() { return true; }
 
-  shared_ptr<MixDevice> recommendedMaster();
+  std::shared_ptr<MixDevice> recommendedMaster();
 
   /**
    * Return a translated error text for the given error number.
@@ -143,7 +143,7 @@ protected:
    ******************************************************************************************/
   bool m_isOpen;
   // The MixDevice that would qualify best as MasterDevice (according to the taste of the Backend developer)
-  shared_ptr<MixDevice> m_recommendedMaster;
+  std::shared_ptr<MixDevice> m_recommendedMaster;
    // The Mixer is stored her only for one reason: The backend creates the MixDevice's, and it has shown
    // that it is helpful if the MixDevice's know their corresponding Mixer. KMix lived 10 years without that,
    // but just believe me. It's *really* better, for example, you can put controls of different soundcards in
index deedccd..7435c9b 100644 (file)
@@ -120,7 +120,7 @@ void Mixer_MPRIS2::watcherMediaControl(QDBusPendingCallWatcher* watcher)
  * readVolumeFromHW() should be used only for hotplug (and even that should go away). Everything should operate via
  * the slot volumeChanged in the future.
  */
-int Mixer_MPRIS2::readVolumeFromHW( const QString& /*id*/, shared_ptr<MixDevice> /*md*/)
+int Mixer_MPRIS2::readVolumeFromHW( const QString& /*id*/, std::shared_ptr<MixDevice> /*md*/)
 {
        // Everything is done by notifications => no code neccessary
        return Mixer::OK_UNCHANGED;
@@ -135,7 +135,7 @@ int Mixer_MPRIS2::readVolumeFromHW( const QString& /*id*/, shared_ptr<MixDevice>
  */
 void Mixer_MPRIS2::playbackStateChanged(MPrisControl* mad, MediaController::PlayState playState)
 {
-       shared_ptr<MixDevice> md = m_mixDevices.get(mad->getId());
+       std::shared_ptr<MixDevice> md = m_mixDevices.get(mad->getId());
        md->getMediaController()->setPlayState(playState);
        QMetaObject::invokeMethod(this, "announceGUI", Qt::QueuedConnection);
 //     ControlManager::instance().announce(_mixer->id(), ControlChangeType::GUI, QString("MixerMPRIS2.playbackStateChanged"));
@@ -150,14 +150,14 @@ void Mixer_MPRIS2::playbackStateChanged(MPrisControl* mad, MediaController::Play
  */
 void Mixer_MPRIS2::volumeChanged(MPrisControl* mad, double newVolume)
 {
-       shared_ptr<MixDevice> md = m_mixDevices.get(mad->getId());
+       std::shared_ptr<MixDevice> md = m_mixDevices.get(mad->getId());
        int volInt = newVolume *100;
        if (GlobalConfig::instance().data.debugVolume)
                kDebug() << "changed" << volInt;
        volumeChangedInternal(md, volInt);
 }
 
-void Mixer_MPRIS2::volumeChangedInternal(shared_ptr<MixDevice> md, int volumePercentage)
+void Mixer_MPRIS2::volumeChangedInternal(std::shared_ptr<MixDevice> md, int volumePercentage)
 {
        if ( md->isVirtuallyMuted() && volumePercentage == 0)
        {
@@ -193,7 +193,7 @@ signal sender=:1.125 -> dest=(null destination) serial=503 path=/org/mpris/Media
  * @param md
  * @return
  */
-int Mixer_MPRIS2::writeVolumeToHW( const QString& id, shared_ptr<MixDevice> md )
+int Mixer_MPRIS2::writeVolumeToHW( const QString& id, std::shared_ptr<MixDevice> md )
 {
        Volume& vol = md->playbackVolume();
        double volFloat = 0;
@@ -591,7 +591,7 @@ void Mixer_MPRIS2::newMediaPlayer(QString name, QString oldOwner, QString newOwn
                        }
 
                        // -2- Remove MixDevice from internal list
-                       shared_ptr<MixDevice> md = m_mixDevices.get(id);
+                       std::shared_ptr<MixDevice> md = m_mixDevices.get(id);
                        if (md)
                        {
                                // We know about the player that is unregistering => remove internally
index 307243f..8a97769 100644 (file)
@@ -121,8 +121,8 @@ public:
 
   virtual int open();
   virtual int close();
-  virtual int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> );
-  virtual int writeVolumeToHW( const QString& id, shared_ptr<MixDevice> );
+  virtual int readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> );
+  virtual int writeVolumeToHW( const QString& id, std::shared_ptr<MixDevice> );
   virtual void setEnumIdHW(const QString& id, unsigned int);
   virtual unsigned int enumIdHW(const QString& id);
   virtual bool moveStream( const QString& id, const QString& destId );
@@ -164,7 +164,7 @@ private:
 //    void asyncAddMprisControl(QString busDestination);
 //    void messageQueueThreadLoop();
     int addAllRunningPlayersAndInitHotplug();
-    void volumeChangedInternal(shared_ptr<MixDevice> md, int volumePercentage);
+    void volumeChangedInternal(std::shared_ptr<MixDevice> md, int volumePercentage);
        QString busDestinationToControlId(const QString& busDestination);
        MixDevice::ChannelType getChannelTypeFromPlayerId(const QString& id);
 
index 150078b..9cf23c9 100644 (file)
@@ -320,7 +320,7 @@ int Mixer_OSS::setRecsrcToOSS( const QString& id, bool on )
     {
         for(int i=0; i< m_mixDevices.count() ; i++ )
         {
-               shared_ptr<MixDevice> md = m_mixDevices[i];
+            std::shared_ptr<MixDevice> md = m_mixDevices[i];
             bool isRecsrc =  ( (recsrcMask & ( 1<<devnum)) != 0 );
             md->setRecSource(isRecsrc);
         } // for all controls
@@ -347,7 +347,7 @@ void Mixer_OSS::errormsg(int mixer_error)
 }
 
 
-int Mixer_OSS::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
+int Mixer_OSS::readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> md )
 {
        int ret = 0;
 
@@ -448,7 +448,7 @@ int Mixer_OSS::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
 
 
 
-int Mixer_OSS::writeVolumeToHW( const QString& id, shared_ptr<MixDevice> md)
+int Mixer_OSS::writeVolumeToHW( const QString& id, std::shared_ptr<MixDevice> md)
 {
     int volume;
     int devnum = id2num(id);
index c69e8ab..064dadf 100644 (file)
@@ -33,8 +33,8 @@ public:
   virtual ~Mixer_OSS();
 
   virtual QString errorText(int mixer_error);
-  virtual int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> );
-  virtual int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> );
+  virtual int readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> );
+  virtual int writeVolumeToHW ( const QString& id, std::shared_ptr<MixDevice> );
 
   virtual QString getDriverName();
 
index a4adfa9..be83d7f 100644 (file)
@@ -215,7 +215,7 @@ int Mixer_OSS4::open()
                        bool masterChosen = false;
                        bool masterHeuristicAvailable = false;
                        bool saveAsMasterHeuristc = false;
-                       shared_ptr<MixDevice> masterHeuristic;
+                       std::shared_ptr<MixDevice> masterHeuristic;
 
                        oss_mixext ext;
                        ext.dev = m_devnum;
@@ -340,7 +340,7 @@ int Mixer_OSS4::open()
                                                                        name,
                                                                        cType);
                                         
-                                        shared_ptr<MixDevice> md = md_ptr->addToPool();
+                                        std::shared_ptr<MixDevice> md = md_ptr->addToPool();
                                         m_mixDevices.append(md);
                                        
                                        if(isCapture)
@@ -375,7 +375,7 @@ int Mixer_OSS4::open()
                                                                      name,
                                                                      cType);
                                         
-                                        shared_ptr<MixDevice> md = md_ptr->addToPool();
+                                        std::shared_ptr<MixDevice> md = md_ptr->addToPool();
                                         m_mixDevices.append(md);
                                        
                                        if(isCapture)
@@ -413,7 +413,7 @@ int Mixer_OSS4::open()
                                                                      name,
                                                                      cType);
                                         
-                                        shared_ptr<MixDevice> md = md_ptr->addToPool();
+                                        std::shared_ptr<MixDevice> md = md_ptr->addToPool();
                                         m_mixDevices.append(md);
 
                                         if(isCapture)
@@ -457,7 +457,7 @@ int Mixer_OSS4::open()
                                                }
                                                md_ptr->addEnums(enumValuesRef);
                                         
-                                                shared_ptr<MixDevice> md = md_ptr->addToPool();
+                                                std::shared_ptr<MixDevice> md = md_ptr->addToPool();
                                                 m_mixDevices.append(md);
                                        }
                                }
@@ -537,7 +537,7 @@ bool Mixer_OSS4::prepareUpdateFromHW()
        return true;
 }
 
-int Mixer_OSS4::readVolumeFromHW(const QString& id, shared_ptr<MixDevice> md)
+int Mixer_OSS4::readVolumeFromHW(const QString& id, std::shared_ptr<MixDevice> md)
 {
        oss_mixext extinfo;
        oss_mixer_value mv;
@@ -603,7 +603,7 @@ int Mixer_OSS4::readVolumeFromHW(const QString& id, shared_ptr<MixDevice> md)
        return 0;
 }
 
-int Mixer_OSS4::writeVolumeToHW(const QString& id, shared_ptr<MixDevice> md)
+int Mixer_OSS4::writeVolumeToHW(const QString& id, std::shared_ptr<MixDevice> md)
 {
        int volume = 0;
 
index 2df1a36..8ed678e 100644 (file)
@@ -16,8 +16,8 @@ public:
   virtual QString getDriverName();
   virtual bool CheckCapture(oss_mixext *ext);
   virtual bool prepareUpdateFromHW();
-  virtual int readVolumeFromHW(const QString& id, shared_ptr<MixDevice> md);
-  virtual int writeVolumeToHW(const QString& id, shared_ptr<MixDevice> md );
+  virtual int readVolumeFromHW(const QString& id, std::shared_ptr<MixDevice> md);
+  virtual int writeVolumeToHW(const QString& id, std::shared_ptr<MixDevice> md );
   virtual void setEnumIdHW(const QString& id, unsigned int idx);
   virtual unsigned int enumIdHW(const QString& id);
 
index b361316..4f61cf1 100644 (file)
@@ -828,7 +828,7 @@ void Mixer_PULSE::pulseControlsReconfigured(QString mixerId)
 void Mixer_PULSE::updateRecommendedMaster(devmap* map)
 {
     unsigned int prio = 0;
-    shared_ptr<MixDevice> res;
+    std::shared_ptr<MixDevice> res;
     MixSet::iterator iter;
 
     for (iter = m_mixDevices.begin(); iter != m_mixDevices.end(); ++iter) {
@@ -876,7 +876,7 @@ void Mixer_PULSE::removeWidget(int index)
 
     // We need to find the MixDevice that goes with this widget and remove it.
     MixSet::iterator iter;
-    shared_ptr<MixDevice> md;
+    std::shared_ptr<MixDevice> md;
     for (iter = m_mixDevices.begin(); iter != m_mixDevices.end(); ++iter)
     {
         if ((*iter)->id() == id)
@@ -1158,7 +1158,7 @@ int Mixer_PULSE::id2num(const QString& id) {
     return num;
 }
 
-int Mixer_PULSE::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
+int Mixer_PULSE::readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> md )
 {
     devmap *map = get_widget_map(m_devnum, id);
 
@@ -1176,7 +1176,7 @@ int Mixer_PULSE::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
     return 0;
 }
 
-int Mixer_PULSE::writeVolumeToHW( const QString& id, shared_ptr<MixDevice> md )
+int Mixer_PULSE::writeVolumeToHW( const QString& id, std::shared_ptr<MixDevice> md )
 {
     devmap::iterator iter;
     if (KMIXPA_PLAYBACK == m_devnum)
index 5720ad6..d63060f 100644 (file)
@@ -53,8 +53,8 @@ class Mixer_PULSE : public Mixer_Backend
         Mixer_PULSE(Mixer *mixer, int devnum);
         virtual ~Mixer_PULSE();
 
-        virtual int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> );
-        virtual int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> );
+        virtual int readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> );
+        virtual int writeVolumeToHW ( const QString& id, std::shared_ptr<MixDevice> );
 
         virtual bool moveStream( const QString& id, const QString& destId );
 
index 85e1d0e..cf7d53f 100644 (file)
@@ -252,7 +252,7 @@ QString Mixer_SUN::errorText( int mixer_error )
 // FUNCTION    : Mixer::readVolumeFromHW
 // DESCRIPTION : Read the audio information from the driver.
 //======================================================================
-int Mixer_SUN::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
+int Mixer_SUN::readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> md )
 {
    audio_info_t audioinfo;
    int devnum = id2num(id);
@@ -314,7 +314,7 @@ int Mixer_SUN::readVolumeFromHW( const QString& id, shared_ptr<MixDevice> md )
 // FUNCTION    : Mixer::writeVolumeToHW
 // DESCRIPTION : Write the specified audio settings to the hardware.
 //======================================================================
-int Mixer_SUN::writeVolumeToHW( const QString& id, shared_ptr<MixDevice> md )
+int Mixer_SUN::writeVolumeToHW( const QString& id, std::shared_ptr<MixDevice> md )
 {
    uint_t gain;
    uchar_t balance;
index 9fe3d58..13c8463 100644 (file)
@@ -34,8 +34,8 @@ public:
   virtual ~Mixer_SUN();
 
   virtual QString errorText(int mixer_error);
-  virtual int readVolumeFromHW( const QString& id, shared_ptr<MixDevice> );
-  virtual int writeVolumeToHW ( const QString& id, shared_ptr<MixDevice> );
+  virtual int readVolumeFromHW( const QString& id, std::shared_ptr<MixDevice> );
+  virtual int writeVolumeToHW ( const QString& id, std::shared_ptr<MixDevice> );
 
   virtual QString getDriverName();
 
diff --git a/kmix/config.h.cmake b/kmix/config.h.cmake
deleted file mode 100644 (file)
index acd9a9c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* config.h.  Generated by cmake from config.h.cmake */
-/* Don't add anything new here!!! Use per-directory generated files. */
-
-/* Define if you ogg/vorbis installed */
-#cmakedefine HAVE_VORBIS ${OGGVORBIS_VERSION}
-
-/* Define to 1 if you have the <machine/endian.h> header file. */
-#cmakedefine HAVE_MACHINE_ENDIAN_H 1
-
-/* Define to 1 if you have the <endian.h> header file. */
-#cmakedefine HAVE_SYS_ENDIAN_H 1
-
-/* Define to 1 if you have the <sys/endian.h> header file. */
-#cmakedefine HAVE_ENDIAN_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H 1
-
-/* Define to 1 if <tr1/memory> exists and defines std::tr1::shared_ptr. */
-#cmakedefine HAVE_STD_TR1_SHARED_PTR 1
-
-/* Define to 1 if <memory> exists and defines std::shared_ptr. */
-#cmakedefine HAVE_STD_SHARED_PTR 1
index f2dd17b..342dacb 100644 (file)
 #include <QMap>
 
 
-shared_ptr<MixDevice> ControlPool::TheEmptyDevice; // = shared_ptr<MixDevice>(ControlPool::TheEmptyDevicePtr);
+std::shared_ptr<MixDevice> ControlPool::TheEmptyDevice; // = std::shared_ptr<MixDevice>(ControlPool::TheEmptyDevicePtr);
 
 ControlPool::ControlPool()
 {
-       pool = new QMap<QString, shared_ptr<MixDevice> >();
+       pool = new QMap<QString, std::shared_ptr<MixDevice> >();
 }
 
 ControlPool* ControlPool::_instance = 0;
@@ -51,9 +51,9 @@ ControlPool* ControlPool::instance()
  * @return
  */
 
-shared_ptr<MixDevice> ControlPool::add(const QString& key, MixDevice* md)
+std::shared_ptr<MixDevice> ControlPool::add(const QString& key, MixDevice* md)
 {
-       shared_ptr<MixDevice> controlFromPool(get(key));
+       std::shared_ptr<MixDevice> controlFromPool(get(key));
        if ( controlFromPool.get() != 0)
        {
                kDebug() << "----ControlPool already cached key=" << key;
@@ -62,7 +62,7 @@ shared_ptr<MixDevice> ControlPool::add(const QString& key, MixDevice* md)
 
        // else: Add the control to the pool
        kDebug() << "----ControlPool add key=" << key;
-       shared_ptr<MixDevice> mdShared(md);
+       std::shared_ptr<MixDevice> mdShared(md);
        pool->insert(key, mdShared);
        return mdShared;
 
@@ -76,8 +76,8 @@ shared_ptr<MixDevice> ControlPool::add(const QString& key, MixDevice* md)
  * @param key
  * @return The Control wrapped in QSharedPointer. If not found, a QSharedPointer that points to null.
  */
-shared_ptr<MixDevice> ControlPool::get(const QString& key)
+std::shared_ptr<MixDevice> ControlPool::get(const QString& key)
 {
-       shared_ptr<MixDevice> mixDeviceShared = pool->value(key, TheEmptyDevice);
+       std::shared_ptr<MixDevice> mixDeviceShared = pool->value(key, TheEmptyDevice);
        return mixDeviceShared;
 }
index b045ce0..a6ec314 100644 (file)
 #ifndef CONTROL_POOL_H
 #define CONTROL_POOL_H
 
-#include "config.h"
-
-#if defined(HAVE_STD_SHARED_PTR)
 #include <memory>
-using std::shared_ptr;
-#elif defined(HAVE_STD_TR1_SHARED_PTR)
-#include <tr1/memory>
-using std::tr1::shared_ptr;
-#endif
 
 #include "core/mixdevice.h"
 
@@ -39,8 +31,8 @@ class ControlPool
 
 public:
        static ControlPool* instance();
-       shared_ptr<MixDevice> add(const QString& key, MixDevice* mixDevice);
-       shared_ptr<MixDevice> get(const QString& key);
+       std::shared_ptr<MixDevice> add(const QString& key, MixDevice* mixDevice);
+       std::shared_ptr<MixDevice> get(const QString& key);
 
 
 private:
@@ -48,9 +40,9 @@ private:
        virtual ~ControlPool() {};
 
 
-       QMap<QString, shared_ptr<MixDevice> > *pool;
+       QMap<QString, std::shared_ptr<MixDevice> > *pool;
        static ControlPool* _instance;
-       static shared_ptr<MixDevice> TheEmptyDevice;
+       static std::shared_ptr<MixDevice> TheEmptyDevice;
 };
 
 #endif
index 16472ff..57c8d18 100644 (file)
@@ -8,16 +8,6 @@
 #ifndef MASTERCONTROL_H_
 #define MASTERCONTROL_H_
 
-#include "config.h"
-
-#if defined(HAVE_STD_SHARED_PTR)
-#include <memory>
-using std::shared_ptr;
-#elif defined(HAVE_STD_TR1_SHARED_PTR)
-#include <tr1/memory>
-using std::tr1::shared_ptr;
-#endif
-
 #include <QString>
 
 class MasterControl
index cfd516c..4850e8d 100644 (file)
@@ -152,7 +152,7 @@ void MixDevice::init(  Mixer* mixer, const QString& id, const QString& name, con
  * You must not use this MixDevice after calling close().
  * <br>
  * The necessity stems from a memory leak due to object cycle (MixDevice<->DBusControlWrapper), so the reference
- * counting shared_ptr has no chance to clean up. See Bug 309464 for background information.
+ * counting std::shared_ptr has no chance to clean up. See Bug 309464 for background information.
  */
 void MixDevice::close()
 {
@@ -167,11 +167,11 @@ MediaController* MixDevice::getMediaController()
 }
 
 
-shared_ptr<MixDevice> MixDevice::addToPool()
+std::shared_ptr<MixDevice> MixDevice::addToPool()
 {
 //     kDebug() << "id=" <<  _mixer->id() << ":" << _id;
-    shared_ptr<MixDevice> thisSharedPtr(this);
-    //shared_ptr<MixDevice> thisSharedPtr = ControlPool::instance()->add(fullyQualifiedId, this);
+    std::shared_ptr<MixDevice> thisSharedPtr(this);
+    // std::shared_ptr<MixDevice> thisSharedPtr = ControlPool::instance()->add(fullyQualifiedId, this);
     _dbusControlWrapper = new DBusControlWrapper( thisSharedPtr, dbusPath() );
        return thisSharedPtr;
 }
index 6696ae0..ee5784f 100644 (file)
 #ifndef MixDevice_h
 #define MixDevice_h
 
-#include "config.h"
-
-#if defined(HAVE_STD_SHARED_PTR)
 #include <memory>
-using std::shared_ptr;
-#elif defined(HAVE_STD_TR1_SHARED_PTR)
-#include <tr1/memory>
-using std::tr1::shared_ptr;
-#endif
 
 //KMix
 #include "core/MediaController.h"
+#include "core/volume.h"
+
 class Mixer;
 class MixSet;
 class ProfControl;
-#include "core/volume.h"
 class DBusControlWrapper;
 
 // KDE
@@ -127,7 +120,7 @@ public:
 
    void close();
 
-   shared_ptr<MixDevice> addToPool();
+   std::shared_ptr<MixDevice> addToPool();
 
    const QString& iconName() const { return _iconName; }
 
index c636b8a..36f7533 100644 (file)
@@ -25,7 +25,7 @@
 
 const long MixDeviceComposite::VolMax = 10000;
 
-MixDeviceComposite::MixDeviceComposite( Mixer* mixer,  const QString& id, QList<shared_ptr<MixDevice> >& mds, const QString& name, ChannelType type ) :
+MixDeviceComposite::MixDeviceComposite( Mixer* mixer,  const QString& id, QList<std::shared_ptr<MixDevice> >& mds, const QString& name, ChannelType type ) :
    MixDevice( mixer, id, name, type )  // this will use doNotRestore == true
 {
     setArtificial(true);
@@ -33,9 +33,9 @@ MixDeviceComposite::MixDeviceComposite( Mixer* mixer,  const QString& id, QList<
     _compositePlaybackVolume->addVolumeChannel(Volume::LEFT);
     _compositePlaybackVolume->addVolumeChannel(Volume::RIGHT);
 
-    QListIterator<shared_ptr<MixDevice> > it(mds);
+    QListIterator<std::shared_ptr<MixDevice> > it(mds);
     while ( it.hasNext()) {
-       shared_ptr<MixDevice> md = it.next();
+       std::shared_ptr<MixDevice> md = it.next();
         _mds.append(md);
     }
 }
@@ -75,12 +75,12 @@ void MixDeviceComposite::update()
 
 long MixDeviceComposite::calculateVolume(Volume::VolumeType vt)
 {
-    QListIterator<shared_ptr<MixDevice> > it(_mds);
+    QListIterator<std::shared_ptr<MixDevice> > it(_mds);
     long volSum = 0;
     int  volCount = 0;
     while ( it.hasNext())
     {
-       shared_ptr<MixDevice> md = it.next();
+       std::shared_ptr<MixDevice> md = it.next();
 
         Volume& vol =  ( vt == Volume::CaptureVT ) ? md->captureVolume() : md->playbackVolume();
         if (vol.hasVolume() && (vol.maxVolume() != 0) ) {
@@ -101,9 +101,9 @@ long MixDeviceComposite::calculateVolume(Volume::VolumeType vt)
 bool MixDeviceComposite::isMuted()
 {
     bool isMuted = false;
-    QListIterator<shared_ptr<MixDevice> > it(_mds);
+    QListIterator<std::shared_ptr<MixDevice> > it(_mds);
     while ( it.hasNext()) {
-       shared_ptr<MixDevice> md = it.next();
+       std::shared_ptr<MixDevice> md = it.next();
         isMuted |= md->isMuted();
         if ( isMuted ) break;  // Enough. It can't get more true :-)
     }
@@ -114,9 +114,9 @@ bool MixDeviceComposite::isMuted()
 
 void MixDeviceComposite::setMuted(bool value)
 {
-    QListIterator<shared_ptr<MixDevice> > it(_mds);
+    QListIterator<std::shared_ptr<MixDevice> > it(_mds);
     while ( it.hasNext()) {
-       shared_ptr<MixDevice> md = it.next();
+       std::shared_ptr<MixDevice> md = it.next();
         md->setMuted(value);
     }
 }
@@ -124,9 +124,9 @@ void MixDeviceComposite::setMuted(bool value)
 bool MixDeviceComposite::isRecSource()
 {
     bool isRecSource = false;
-    QListIterator<shared_ptr<MixDevice> > it(_mds);
+    QListIterator<std::shared_ptr<MixDevice> > it(_mds);
     while ( it.hasNext()) {
-       shared_ptr<MixDevice> md = it.next();
+       std::shared_ptr<MixDevice> md = it.next();
         isRecSource |= md->isRecSource();
         if ( isRecSource ) break;  // Enough. It can't get more true :-)
     }
@@ -136,9 +136,9 @@ bool MixDeviceComposite::isRecSource()
 
 void MixDeviceComposite::setRecSource(bool value)
 {
-    QListIterator<shared_ptr<MixDevice> > it(_mds);
+    QListIterator<std::shared_ptr<MixDevice> > it(_mds);
     while ( it.hasNext()) {
-       shared_ptr<MixDevice> md = it.next();
+       std::shared_ptr<MixDevice> md = it.next();
         md->setRecSource(value);
     }
 }
@@ -147,9 +147,9 @@ void MixDeviceComposite::setRecSource(bool value)
 bool MixDeviceComposite::isEnum()
 {
     bool isEnum = true;
-    QListIterator<shared_ptr<MixDevice> > it(_mds);
+    QListIterator<std::shared_ptr<MixDevice> > it(_mds);
     while ( it.hasNext()) {
-       shared_ptr<MixDevice> md = it.next();
+       std::shared_ptr<MixDevice> md = it.next();
         isEnum &= md->isEnum();
         if ( ! isEnum ) break;  // Enough. It can't get more false :-)
     }
index 0180e24..b427308 100644 (file)
@@ -74,7 +74,7 @@ public:
     *  @par name is the readable name. This one is presented to the user in the GUI
     *  @par type The control type. It is only used to find an appropriate icon
     */
-   MixDeviceComposite( Mixer* mixer,  const QString& id, QList<shared_ptr<MixDevice> >& mds, const QString& name, ChannelType type );
+   MixDeviceComposite( Mixer* mixer,  const QString& id, QList<std::shared_ptr<MixDevice> >& mds, const QString& name, ChannelType type );
 //   MixDevice( Mixer* mixer, const QString& id, const QString& name, const QString& iconName = "", bool doNotRestore = false, MixSet* moveDestinationMixSet = 0 );
    ~MixDeviceComposite();
 
@@ -99,7 +99,7 @@ private:
    long calculateVolume(Volume::VolumeType vt);
 
    Mixer *_mixer;
-   QList<shared_ptr<MixDevice> > _mds;
+   QList<std::shared_ptr<MixDevice> > _mds;
 
    static const long VolMax;
 
index 6c4c4f2..747d79c 100644 (file)
@@ -234,7 +234,7 @@ void Mixer::volumeLoad( KConfig *config )
    // set new settings
    for(int i=0; i<_mixerBackend->m_mixDevices.count() ; i++ )
    {
-          shared_ptr<MixDevice> md = _mixerBackend->m_mixDevices[i];
+          std::shared_ptr<MixDevice> md = _mixerBackend->m_mixDevices[i];
           if ( md.get() == 0 )
                   continue;
 
@@ -267,7 +267,7 @@ bool Mixer::openIfValid()
     if ( ok )
     {
         recreateId();
-        shared_ptr<MixDevice> recommendedMaster = _mixerBackend->recommendedMaster();
+        std::shared_ptr<MixDevice> recommendedMaster = _mixerBackend->recommendedMaster();
         if ( recommendedMaster.get() != 0 )
         {
             QString recommendedMasterStr = recommendedMaster->id();
@@ -305,9 +305,9 @@ unsigned int Mixer::size() const
   return _mixerBackend->m_mixDevices.count();
 }
 
-shared_ptr<MixDevice> Mixer::operator[](int num)
+std::shared_ptr<MixDevice> Mixer::operator[](int num)
 {
-       shared_ptr<MixDevice> md =  _mixerBackend->m_mixDevices.at( num );
+       std::shared_ptr<MixDevice> md =  _mixerBackend->m_mixDevices.at( num );
        return md;
 }
 
@@ -364,7 +364,7 @@ void Mixer::setBalance(int balance)
 
    m_balance = balance;
 
-   shared_ptr<MixDevice> master = getLocalMasterMD();
+   std::shared_ptr<MixDevice> master = getLocalMasterMD();
    if ( master.get() == 0 )
    {
       // no master device available => return
@@ -523,23 +523,23 @@ MasterControl& Mixer::getGlobalMasterPreferred()
 }
 
 
-shared_ptr<MixDevice> Mixer::getGlobalMasterMD()
+std::shared_ptr<MixDevice> Mixer::getGlobalMasterMD()
 {
    return getGlobalMasterMD(true);
 }
 
 
-shared_ptr<MixDevice> Mixer::getGlobalMasterMD(bool fallbackAllowed)
+std::shared_ptr<MixDevice> Mixer::getGlobalMasterMD(bool fallbackAllowed)
 {
-       shared_ptr<MixDevice> mdRet;
-       shared_ptr<MixDevice> firstDevice;
+       std::shared_ptr<MixDevice> mdRet;
+       std::shared_ptr<MixDevice> firstDevice;
        Mixer *mixer = fallbackAllowed ?
                   Mixer::getGlobalMasterMixer() : Mixer::getGlobalMasterMixerNoFalback();
 
        if ( mixer == 0 )
                return mdRet;
 
-       foreach (shared_ptr<MixDevice> md, mixer->_mixerBackend->m_mixDevices )
+       foreach (std::shared_ptr<MixDevice> md, mixer->_mixerBackend->m_mixDevices )
        {
                if ( md.get() == 0 )
                        continue; // invalid
@@ -565,7 +565,7 @@ shared_ptr<MixDevice> Mixer::getGlobalMasterMD(bool fallbackAllowed)
 
 
 
-shared_ptr<MixDevice> Mixer::getLocalMasterMD()
+std::shared_ptr<MixDevice> Mixer::getLocalMasterMD()
 {
   return find( _masterDevicePK );
 }
@@ -576,12 +576,12 @@ void Mixer::setLocalMasterMD(QString &devPK)
 }
 
 
-shared_ptr<MixDevice> Mixer::find(const QString& mixdeviceID)
+std::shared_ptr<MixDevice> Mixer::find(const QString& mixdeviceID)
 {
 
-       shared_ptr<MixDevice> mdRet;
+       std::shared_ptr<MixDevice> mdRet;
 
-       foreach (shared_ptr<MixDevice> md, _mixerBackend->m_mixDevices )
+       foreach (std::shared_ptr<MixDevice> md, _mixerBackend->m_mixDevices )
        {
                if ( md.get() == 0 )
                        continue; // invalid
@@ -596,11 +596,11 @@ shared_ptr<MixDevice> Mixer::find(const QString& mixdeviceID)
 }
 
 
-shared_ptr<MixDevice> Mixer::getMixdeviceById( const QString& mixdeviceID )
+std::shared_ptr<MixDevice> Mixer::getMixdeviceById( const QString& mixdeviceID )
 {
        kDebug() << "id=" << mixdeviceID << "md=" << _mixerBackend->m_mixDevices.get(mixdeviceID).get()->id();
        return _mixerBackend->m_mixDevices.get(mixdeviceID);
-//     shared_ptr<MixDevice> md;
+//     std::shared_ptr<MixDevice> md;
 //   int num = _mixerBackend->id2num(mixdeviceID);
 //   if ( num!=-1 && num < (int)size() )
 //   {
@@ -617,7 +617,7 @@ shared_ptr<MixDevice> Mixer::getMixdeviceById( const QString& mixdeviceID )
    - It is fast               (no copying of Volume objects required)
    - It is easy to understand ( read - modify - commit )
 */
-void Mixer::commitVolumeChange(shared_ptr<MixDevice> md)
+void Mixer::commitVolumeChange(std::shared_ptr<MixDevice> md)
 {
        _mixerBackend->writeVolumeToHW(md->id(), md);
        if (md->isEnum())
@@ -671,7 +671,7 @@ void Mixer::decreaseVolume( const QString& mixdeviceID )
 void Mixer::increaseOrDecreaseVolume( const QString& mixdeviceID, bool decrease )
 {
 
-       shared_ptr<MixDevice> md= getMixdeviceById( mixdeviceID );
+    std::shared_ptr<MixDevice> md= getMixdeviceById( mixdeviceID );
     if (md.get() != 0)
     {
         Volume& volP=md->playbackVolume();
index e8c7eae..f4db678 100644 (file)
@@ -65,7 +65,7 @@ public:
     static int numDrivers();
     QString getDriverName();
 
-    shared_ptr<MixDevice>  find(const QString& devPK);
+    std::shared_ptr<MixDevice>  find(const QString& devPK);
     static Mixer* findMixer( const QString& mixer_id);
 
     void volumeSave( KConfig *config );
@@ -76,12 +76,12 @@ public:
 
     /// Returns a pointer to the mix device with the given number
     // TODO remove this method. Only used by ViewDockAreaPopup: dockMD = (*mixer)[0];
-    shared_ptr<MixDevice> operator[](int val_i_num);
+    std::shared_ptr<MixDevice> operator[](int val_i_num);
 
     /// Returns a pointer to the mix device whose type matches the value
     /// given by the parameter and the array MixerDevNames given in
     /// mixer_oss.cpp (0 is Volume, 4 is PCM, etc.)
-    shared_ptr<MixDevice> getMixdeviceById( const QString& deviceID );
+    std::shared_ptr<MixDevice> getMixdeviceById( const QString& deviceID );
 
     /// Open/grab the mixer for further intraction
     bool openIfValid();
@@ -146,8 +146,8 @@ public:
     At the moment it is only used for selecting the Mixer to use in KMix's DockIcon.
     ******************************************/
     static void setGlobalMaster(QString ref_card, QString ref_control, bool preferred);
-    static shared_ptr<MixDevice> getGlobalMasterMD();
-    static shared_ptr<MixDevice> getGlobalMasterMD(bool fallbackAllowed);
+    static std::shared_ptr<MixDevice> getGlobalMasterMD();
+    static std::shared_ptr<MixDevice> getGlobalMasterMD(bool fallbackAllowed);
     static Mixer* getGlobalMasterMixer();
     static Mixer* getGlobalMasterMixerNoFalback();
     static MasterControl& getGlobalMasterPreferred();
@@ -155,7 +155,7 @@ public:
     /******************************************
     The recommended master of this Mixer.
     ******************************************/
-    shared_ptr<MixDevice> getLocalMasterMD();
+    std::shared_ptr<MixDevice> getLocalMasterMD();
     void setLocalMasterMD(QString&);
 
     /// get the actual MixSet
@@ -179,7 +179,7 @@ public:
    virtual int mediaNext(QString id) { return _mixerBackend->mediaNext(id); };
 
     
-    void commitVolumeChange( shared_ptr<MixDevice> md );
+    void commitVolumeChange( std::shared_ptr<MixDevice> md );
 
 public slots:
     void readSetFromHWforceUpdate() const;
index 56e2052..76e36ca 100644 (file)
@@ -256,7 +256,7 @@ void MixerToolBox::initMixerInternal(MultiDriverMode multiDriverMode, QList<QStr
       // not one defined in the kmixrc.
       // So lets just set the first card as master card.
       if ( Mixer::mixers().count() > 0 ) {
-         shared_ptr<MixDevice> master = Mixer::mixers().first()->getLocalMasterMD();
+         std::shared_ptr<MixDevice> master = Mixer::mixers().first()->getLocalMasterMD();
          if ( master ) {
              QString controlId = master->id();
              Mixer::setGlobalMaster( Mixer::mixers().first()->id(), controlId, true);
@@ -266,7 +266,7 @@ void MixerToolBox::initMixerInternal(MultiDriverMode multiDriverMode, QList<QStr
    else {
       // setGlobalMaster was already set after reading the configuration.
       // So we must make the local master consistent
-         shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+         std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
       QString mdID = md->id();
       md->mixer()->setLocalMasterMD(mdID);
    }
index 67cd2c5..2670078 100644 (file)
@@ -45,7 +45,7 @@ bool MixSet::read( KConfig *config, const QString& grp )
    m_name = group.readEntry( "name", m_name );
 
    bool have_success = false, have_fail = false;
-   foreach ( shared_ptr<MixDevice> md, *this)
+   foreach ( std::shared_ptr<MixDevice> md, *this)
    {
        if ( md->read( config, grp ) )
            have_success = true;
@@ -62,7 +62,7 @@ bool MixSet::write( KConfig *config, const QString& grp )
    conf.writeEntry( "name", m_name );
 
    bool have_success = false, have_fail = false;
-   foreach ( shared_ptr<MixDevice> md, *this)
+   foreach ( std::shared_ptr<MixDevice> md, *this)
    {
        if ( md->write( config, grp ) )
            have_success = true;
@@ -77,11 +77,11 @@ void MixSet::setName( const QString &name )
     m_name = name;
 }
 
-shared_ptr<MixDevice> MixSet::get(QString id)
+std::shared_ptr<MixDevice> MixSet::get(QString id)
 {
-       shared_ptr<MixDevice> mdRet;
+       std::shared_ptr<MixDevice> mdRet;
 
-       foreach ( shared_ptr<MixDevice> md, *this)
+       foreach ( std::shared_ptr<MixDevice> md, *this)
        {
                if ( md->id() == id )
                {
@@ -96,7 +96,7 @@ void MixSet::removeById(QString id)
 {
        for (int i=0; i < count() ; i++ )
        {
-               shared_ptr<MixDevice> md = operator[](i);
+               std::shared_ptr<MixDevice> md = operator[](i);
            if ( md->id() == id )
            {
                removeAt(i);
index acea599..ff41366 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "core/mixdevice.h"
 
-class MixSet : public QList <shared_ptr<MixDevice> >
+class MixSet : public QList <std::shared_ptr<MixDevice> >
 {
    public:
        ~MixSet();
@@ -36,7 +36,7 @@ class MixSet : public QList <shared_ptr<MixDevice> >
       QString name() { return m_name; }
       void setName( const QString &name );
       
-      shared_ptr<MixDevice> get(QString id);
+      std::shared_ptr<MixDevice> get(QString id);
 
       void removeById(QString id);
 
index ec5c63f..66dbcae 100644 (file)
@@ -24,7 +24,7 @@
 #include "core/mixer.h"
 #include "core/volume.h"
 
-DBusControlWrapper::DBusControlWrapper(shared_ptr<MixDevice> parent, const QString& path)
+DBusControlWrapper::DBusControlWrapper(std::shared_ptr<MixDevice> parent, const QString& path)
        : QObject(0)
 {
 //     kDebug() << "QDBusConnection for control created" << path;
index 5355f97..789f10e 100644 (file)
@@ -41,14 +41,14 @@ class DBusControlWrapper : public QObject
        Q_PROPERTY(bool hasCaptureSwitch READ hasCaptureSwitch)
 
        public:
-               DBusControlWrapper(shared_ptr<MixDevice> parent, const QString& path);
+               DBusControlWrapper(std::shared_ptr<MixDevice> parent, const QString& path);
                ~DBusControlWrapper();
 
                void increaseVolume();
                void decreaseVolume();
                void toggleMute();
        private:
-               shared_ptr<MixDevice> m_md;
+               std::shared_ptr<MixDevice> m_md;
                
                QString id();
                QString readableName();
index 5e27c24..c6a4782 100644 (file)
@@ -84,7 +84,7 @@ QString DBusMixerWrapper::driverName()
 QStringList DBusMixerWrapper::controls()
 {
        QStringList result;
-       foreach ( shared_ptr<MixDevice> md, m_mixer->getMixSet() )
+       foreach ( std::shared_ptr<MixDevice> md, m_mixer->getMixSet() )
        {
                result.append( md->dbusPath() );
        }
@@ -93,7 +93,7 @@ QStringList DBusMixerWrapper::controls()
 
 QString DBusMixerWrapper::masterControl()
 {
-       shared_ptr<MixDevice> md = m_mixer->getLocalMasterMD();
+       std::shared_ptr<MixDevice> md = m_mixer->getLocalMasterMD();
        // XXX: Since empty object path is invalid, using "/"
        return md ? md->dbusPath() : QString("/");
 }
index 6a2ec45..4e3863b 100644 (file)
@@ -85,7 +85,7 @@ QString DBusMixSetWrapper::currentMasterMixer() const
 
 QString DBusMixSetWrapper::currentMasterControl() const
 {
-       shared_ptr<MixDevice> masterControl = Mixer::getGlobalMasterMD();
+       std::shared_ptr<MixDevice> masterControl = Mixer::getGlobalMasterMD();
        return masterControl ? masterControl->id() : QString();
 }
 
index 832c4c8..d47227a 100644 (file)
@@ -161,14 +161,14 @@ void DialogSelectMaster::createPage(Mixer* mixer)
     m_vboxForScrollView = new KVBox(); //m_scrollableChannelSelector->viewport()
 
 
-    shared_ptr<MixDevice> master = mixer->getLocalMasterMD();
+    std::shared_ptr<MixDevice> master = mixer->getLocalMasterMD();
     QString masterKey = ( master.get() != 0 ) ? master->id() : "----noMaster---"; // Use non-matching name as default
 
     const MixSet& mixset = mixer->getMixSet();
     MixSet& mset = const_cast<MixSet&>(mixset);
     for( int i=0; i< mset.count(); ++i )
     {
-       shared_ptr<MixDevice> md = mset[i];
+       std::shared_ptr<MixDevice> md = mset[i];
         // Create a RadioButton for each MixDevice (excluding Enum's)
         if ( md->playbackVolume().hasVolume() )
         {
index 068c715..5ba5d8f 100644 (file)
@@ -305,7 +305,7 @@ void DialogViewConfiguration::createPage()
       QWidget *qw = mdws[i];
       if ( qw->inherits("MixDeviceWidget") ) {
             MixDeviceWidget *mdw = static_cast<MixDeviceWidget*>(qw);
-            shared_ptr<MixDevice> md = mdw->mixDevice();
+            std::shared_ptr<MixDevice> md = mdw->mixDevice();
             QString mdName = md->readableName();
 
             int splitted = -1;
index b885372..c7e8c8c 100644 (file)
@@ -135,7 +135,7 @@ void KMixDockWidget::createMenuActions()
     if ( menu == 0)
        return; // We do not use a menu
 
-    shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+    std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
     if ( md.get() != 0 && md->hasMuteSwitch() ) {
         // Put "Mute" selector in context menu
         KToggleAction *action = actionCollection()->add<KToggleAction>( "dock_mute" );
@@ -159,7 +159,7 @@ void KMixDockWidget::createMenuActions()
 void
 KMixDockWidget::setVolumeTip()
 {
-    shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+    std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
     QString tip;
     int virtualToolTipValue = 0;
 
@@ -197,7 +197,7 @@ KMixDockWidget::setVolumeTip()
 
 void KMixDockWidget::updatePixmap()
 {
-       shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+       std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
 
     char newPixmapType;
     if ( !md )
@@ -308,7 +308,7 @@ void KMixDockWidget::activate(const QPoint &pos)
 void
 KMixDockWidget::trayWheelEvent(int delta,Qt::Orientation wheelOrientation)
 {
-       shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+       std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
        if ( md.get() == 0 )
                return;
 
@@ -343,7 +343,7 @@ KMixDockWidget::trayWheelEvent(int delta,Qt::Orientation wheelOrientation)
 void
 KMixDockWidget::dockMute()
 {
-    shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+    std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
     if ( md )
     {
         md->toggleMute();
@@ -374,7 +374,7 @@ void KMixDockWidget::contextMenuAboutToShow()
 
 void KMixDockWidget::updateDockMuteAction ( KToggleAction* dockMuteAction )
 {  
-    shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
+    std::shared_ptr<MixDevice> md = Mixer::getGlobalMasterMD();
     if ( md && dockMuteAction != 0 )
     {
        Volume& vol = md->playbackVolume().hasVolume() ? md->playbackVolume() : md->captureVolume();
index ae3caf1..b2ff734 100644 (file)
@@ -47,7 +47,7 @@
  * Class that represents an Enum element (a select one-from-many selector)
  * The orientation (horizontal, vertical) is ignored
  */
-MDWEnum::MDWEnum( shared_ptr<MixDevice> md,
+MDWEnum::MDWEnum( std::shared_ptr<MixDevice> md,
                  Qt::Orientation orientation,
                  QWidget* parent, ViewBase* view, ProfControl* par_pctl) :
    MixDeviceWidget(md, false, orientation, parent, view, par_pctl),
index b413232..42fd449 100644 (file)
@@ -45,7 +45,7 @@ class MDWEnum : public MixDeviceWidget
     Q_OBJECT
 
 public:
-    MDWEnum( shared_ptr<MixDevice> md,
+    MDWEnum( std::shared_ptr<MixDevice> md,
               Qt::Orientation orientation,
               QWidget* parent, ViewBase* view, ProfControl* pctl);
     ~MDWEnum();
index b8a171a..89115a8 100644 (file)
@@ -30,7 +30,7 @@
 // Qt
 #include <QString>
 
-MDWMoveAction::MDWMoveAction(shared_ptr<MixDevice> md, QObject *parent)
+MDWMoveAction::MDWMoveAction(std::shared_ptr<MixDevice> md, QObject *parent)
  : KAction(parent), m_mixDevice(md)
 {
    Q_ASSERT(md);
index acc6e6e..7e855d2 100644 (file)
@@ -30,7 +30,7 @@ class MDWMoveAction : public KAction
     Q_OBJECT
 
     public:
-        MDWMoveAction(shared_ptr<MixDevice> md, QObject *parent);
+        MDWMoveAction(std::shared_ptr<MixDevice> md, QObject *parent);
         ~MDWMoveAction();
 
     signals:
@@ -40,7 +40,7 @@ class MDWMoveAction : public KAction
         void triggered(bool checked);
 
    private:
-        shared_ptr<MixDevice> m_mixDevice;
+        std::shared_ptr<MixDevice> m_mixDevice;
 };
 
 #endif
index 93308ed..b4ce298 100644 (file)
@@ -62,7 +62,7 @@ bool MDWSlider::debugMe = false;
  *
  * Due to the many options, this is the most complicated MixDeviceWidget subclass.
  */
-MDWSlider::MDWSlider(shared_ptr<MixDevice> md, bool showMuteLED, bool showCaptureLED
+MDWSlider::MDWSlider(std::shared_ptr<MixDevice> md, bool showMuteLED, bool showCaptureLED
         , bool includeMixerName, bool small, Qt::Orientation orientation, QWidget* parent
         , ViewBase* view
         , ProfControl* par_ctl
@@ -1222,7 +1222,7 @@ void MDWSlider::showMoveMenu()
     _mdwMoveActions->addAction( QString("-"), a);
 
     m_moveMenu->addAction( a );
-    foreach (shared_ptr<MixDevice> md, *ms)
+    foreach (std::shared_ptr<MixDevice> md, *ms)
     {
         a = new MDWMoveAction(md, _mdwMoveActions);
         _mdwMoveActions->addAction( QString("moveto") + md->id(), a);
index 83156bd..f038e62 100644 (file)
@@ -52,7 +52,7 @@ class MDWSlider : public MixDeviceWidget
     Q_OBJECT
 
 public:
-    MDWSlider( shared_ptr<MixDevice> md,
+    MDWSlider( std::shared_ptr<MixDevice> md,
               bool includePlayback, bool includeCapture,
               bool includeMixerName, bool small, Qt::Orientation,
               QWidget* parent, ViewBase* view, ProfControl *pctl);
index 54c3020..b3b314a 100644 (file)
@@ -51,7 +51,7 @@
  * SHOULD honor these values - those who do not might not be suitable for placing in
  * the panel applet or any other smallish settings.
  */
-MixDeviceWidget::MixDeviceWidget(shared_ptr<MixDevice> md,
+MixDeviceWidget::MixDeviceWidget(std::shared_ptr<MixDevice> md,
                                  bool small, Qt::Orientation orientation,
                                  QWidget* parent, ViewBase* view, ProfControl* par_pctl) :
    QWidget( parent ), m_mixdevice( md ), m_view( view ), _pctl(par_pctl),
index 68033b2..a33389b 100644 (file)
@@ -45,14 +45,14 @@ class MixDeviceWidget
       Q_OBJECT
 
 public:
-    MixDeviceWidget( shared_ptr<MixDevice> md,
+    MixDeviceWidget( std::shared_ptr<MixDevice> md,
                      bool small, Qt::Orientation orientation,
                      QWidget* parent, ViewBase*, ProfControl * );
     virtual ~MixDeviceWidget();
 
     void addActionToPopup( KAction *action );
 
-    shared_ptr<MixDevice> mixDevice() { return m_mixdevice; }
+    std::shared_ptr<MixDevice> mixDevice() { return m_mixdevice; }
 
     virtual void setColors( QColor high, QColor low, QColor back );
     virtual void setIcons( bool value );
@@ -81,7 +81,7 @@ protected slots:
 
 protected:
 
-      shared_ptr<MixDevice>  m_mixdevice;
+      std::shared_ptr<MixDevice>  m_mixdevice;
       KActionCollection*   _mdwActions;
       KActionCollection*   _mdwPopupActions;
       ViewBase*            m_view;
index 1e94a98..ec59cbb 100644 (file)
@@ -99,7 +99,7 @@ OSDWidget::~OSDWidget()
 void OSDWidget::controlsChange(int changeType)
 {
   ControlChangeType::Type type = ControlChangeType::fromInt(changeType);
-    shared_ptr<MixDevice> master = Mixer::getGlobalMasterMD();
+    std::shared_ptr<MixDevice> master = Mixer::getGlobalMasterMD();
   switch (type )
   {
     case ControlChangeType::Volume:
index 1ba1581..7fef907 100644 (file)
@@ -150,7 +150,7 @@ void ViewBase::updateMediaPlaybackIcons()
 void ViewBase::createDeviceWidgets()
 {
   _setMixSet();
-    foreach ( shared_ptr<MixDevice> md, _mixSet )
+    foreach ( std::shared_ptr<MixDevice> md, _mixSet )
     {
         QWidget* mdw = add(md); // a) Let the View implementation do its work
         _mdws.append(mdw); // b) Add it to the local list
@@ -275,7 +275,7 @@ void ViewBase::resetMdws()
       while (!_mdws.isEmpty())
              delete _mdws.takeFirst();
 
-      // _mixSet contains shared_ptr instances, so clear() should be enough to prevent mem leak
+      // _mixSet contains std::shared_ptr instances, so clear() should be enough to prevent mem leak
       _mixSet.clear(); // Clean up our _mixSet so we can reapply our GUIProfile
 }
 
@@ -345,7 +345,7 @@ void ViewBase::load(KConfig *config)
                        if (qmdw->inherits("MixDeviceWidget"))
                        {
                                MixDeviceWidget* mdw = (MixDeviceWidget*) qmdw;
-                               shared_ptr<MixDevice> md = mdw->mixDevice();
+                               std::shared_ptr<MixDevice> md = mdw->mixDevice();
                                QString devgrp = md->configGroupName(grp);
                                KConfigGroup devcg = config->group(devgrp);
 
@@ -452,7 +452,7 @@ void ViewBase::save(KConfig *config)
                if (qmdw->inherits("MixDeviceWidget"))
                {
                        MixDeviceWidget* mdw = (MixDeviceWidget*) qmdw;
-                       shared_ptr<MixDevice> md = mdw->mixDevice();
+                       std::shared_ptr<MixDevice> md = mdw->mixDevice();
 
                        //kDebug(67100) << "  grp=" << grp.toAscii();
                        //kDebug(67100) << "  mixer=" << view->id().toAscii();
index a660c11..5363129 100644 (file)
@@ -84,7 +84,7 @@ public:
     /**
      * Creates a suitable representation for the given MixDevice.
      */
-    virtual QWidget* add(shared_ptr<MixDevice>) = 0;
+    virtual QWidget* add(std::shared_ptr<MixDevice>) = 0;
 
     // This method is called after a configuration update (show/hide controls, split/unsplit).
     virtual void configurationUpdate() = 0;
index 95524bc..ca03520 100644 (file)
@@ -246,7 +246,7 @@ Application: KMix (kmix), signal: Segmentation fault
        foreach ( Mixer* mixer, _mixers )
        {
 //             kDebug() << "ADD? mixerId=" << mixer->id();
-               shared_ptr<MixDevice>dockMD = mixer->getLocalMasterMD();
+               std::shared_ptr<MixDevice>dockMD = mixer->getLocalMasterMD();
                if ( !dockMD && mixer->size() > 0 )
                {
                        // If we have no dock device yet, we will take the first available mixer device.
@@ -268,7 +268,7 @@ Application: KMix (kmix), signal: Segmentation fault
        // Add all application streams
        foreach ( Mixer* mixer2 , _mixers )
        {
-               foreach ( shared_ptr<MixDevice> md, mixer2->getMixSet() )
+               foreach ( std::shared_ptr<MixDevice> md, mixer2->getMixSet() )
                {
                        if (md->isApplicationStream())
                        {
@@ -280,7 +280,7 @@ Application: KMix (kmix), signal: Segmentation fault
 }
 
 
-QWidget* ViewDockAreaPopup::add(shared_ptr<MixDevice> md)
+QWidget* ViewDockAreaPopup::add(std::shared_ptr<MixDevice> md)
 {
   bool vertical = (GlobalConfig::instance().data.getTraypopupOrientation() == Qt::Vertical); // I am wondering whether using vflags for this would still make sense
   /*
index 2b583b4..8400796 100644 (file)
@@ -42,7 +42,7 @@ public:
     ViewDockAreaPopup(QWidget* parent, QString id, ViewBase::ViewFlags vflags, QString guiProfileId, KMixWindow *dockW);
     virtual ~ViewDockAreaPopup();
 
-    virtual QWidget* add(shared_ptr<MixDevice> md);
+    virtual QWidget* add(std::shared_ptr<MixDevice> md);
     virtual void constructionFinished();
     virtual void refreshVolumeLevels();
      virtual void showContextMenu();
index d5ea35e..f0eb129 100644 (file)
@@ -116,7 +116,7 @@ void ViewSliders::controlsChange(int changeType)
 }
 
 
-QWidget* ViewSliders::add(shared_ptr<MixDevice> md)
+QWidget* ViewSliders::add(std::shared_ptr<MixDevice> md)
 {
     MixDeviceWidget *mdw;
     Qt::Orientation orientation = GlobalConfig::instance().data.getToplevelOrientation();
@@ -239,7 +239,7 @@ void ViewSliders::_setMixSet()
        _layoutMDW->addWidget(emptyStreamHint);
 
 #ifdef TEST_MIXDEVICE_COMPOSITE
-       QList<shared_ptr<MixDevice> > mds;  // For temporary test
+       QList<std::shared_ptr<MixDevice> > mds;  // For temporary test
 #endif
 
        // This method iterates the controls from the Profile
@@ -263,7 +263,7 @@ void ViewSliders::_setMixSet()
                        // The following for-loop could be simplified by using a std::find_if
                        for ( int i=0; i<mixset.count(); i++ )
                        {
-                               shared_ptr<MixDevice> md = mixset[i];
+                               std::shared_ptr<MixDevice> md = mixset[i];
 
                                if ( md->id().contains(idRegexp) )
                                {
index 8856f76..a1bf6fe 100644 (file)
@@ -38,7 +38,7 @@ public:
     ViewSliders(QWidget* parent, QString id, Mixer* mixer, ViewBase::ViewFlags vflags, QString guiProfileId, KActionCollection *actColl);
     virtual ~ViewSliders();
 
-    virtual QWidget* add(shared_ptr<MixDevice>);
+    virtual QWidget* add(std::shared_ptr<MixDevice>);
     virtual void constructionFinished();
     virtual void configurationUpdate();