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

List:       kde-commits
Subject:    KDE/kdelibs/phonon
From:       Thierry Bastian <thierry.bastian () trolltech ! com>
Date:       2008-03-14 11:53:23
Message-ID: 1205495603.731461.7235.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 785576 by tbastian:

-remove the audiopaths/videopaths references from mediacontroller
-make it compile on VC6
-added a version number (4.2 for trunk)

 M  +9 -9      audiooutput.cpp  
 M  +1 -1      effectparameter.h  
 M  +1 -3      iodevicestream_p.h  
 M  +12 -13    mediacontroller.cpp  
 M  +6 -6      mediacontroller.h  
 M  +2 -0      objectdescriptionmodel.cpp  
 M  +8 -8      objectdescriptionmodel_p.h  
 M  +12 -0     phononnamespace.cpp  
 M  +12 -0     phononnamespace.h  
 M  +2 -2      qsettingsgroup_p.h  
 M  +4 -3      volumefadereffect.cpp  


--- trunk/KDE/kdelibs/phonon/audiooutput.cpp #785575:785576
@@ -26,7 +26,7 @@
 #include "phononnamespace_p.h"
 #include "platform_p.h"
 
-#include <cmath>
+#include <qmath.h>
 
 #define PHONON_CLASSNAME AudioOutput
 #define PHONON_INTERFACENAME AudioOutputInterface
@@ -105,7 +105,7 @@
         // sound pressure is proportional to voltage:
         // p ² \prop P \prop V ²
         // => if a factor for loudness of x is requested
-        INTERFACE_CALL(setVolume(std::pow(volume, VOLTAGE_TO_LOUDNESS_EXPONENT)));
+        INTERFACE_CALL(setVolume(pow(volume, VOLTAGE_TO_LOUDNESS_EXPONENT)));
     } else {
         emit volumeChanged(volume);
     }
@@ -118,7 +118,7 @@
     if (d->muted || !d->m_backendObject) {
         return d->volume;
     }
-    return std::pow(INTERFACE_CALL(volume()), LOUDNESS_TO_VOLTAGE_EXPONENT);
+    return pow(INTERFACE_CALL(volume()), LOUDNESS_TO_VOLTAGE_EXPONENT);
 }
 
 #ifndef PHONON_LOG10OVER20
@@ -130,14 +130,14 @@
 {
     K_D(const AudioOutput);
     if (d->muted || !d->m_backendObject) {
-        return -std::log(d->volume) / log10over20;
+        return -log(d->volume) / log10over20;
     }
-    return -0.67 * std::log(INTERFACE_CALL(volume())) / log10over20;
+    return -0.67 * log(INTERFACE_CALL(volume())) / log10over20;
 }
 
 void AudioOutput::setVolumeDecibel(qreal newVolumeDecibel)
 {
-    setVolume(std::exp(-newVolumeDecibel * log10over20));
+    setVolume(exp(-newVolumeDecibel * log10over20));
 }
 
 bool AudioOutput::isMuted() const
@@ -157,7 +157,7 @@
             }
         } else {
             if (k_ptr->backendObject()) {
-                INTERFACE_CALL(setVolume(std::pow(d->volume, \
VOLTAGE_TO_LOUDNESS_EXPONENT))); +                \
INTERFACE_CALL(setVolume(pow(d->volume, VOLTAGE_TO_LOUDNESS_EXPONENT)));  }
             d->muted = mute;
         }
@@ -216,7 +216,7 @@
     QObject::connect(m_backendObject, SIGNAL(audioDeviceFailed()), q, \
SLOT(_k_audioDeviceFailed()));  
     // set up attributes
-    pINTERFACE_CALL(setVolume(std::pow(volume, VOLTAGE_TO_LOUDNESS_EXPONENT)));
+    pINTERFACE_CALL(setVolume(pow(volume, VOLTAGE_TO_LOUDNESS_EXPONENT)));
 
     // if the output device is not available and the device was not explicitly set
     if (!pINTERFACE_CALL(setOutputDevice(outputDeviceIndex)) && \
!outputDeviceOverridden) { @@ -241,7 +241,7 @@
 {
     if (!muted) {
         Q_Q(AudioOutput);
-        emit q->volumeChanged(std::pow(newVolume, qreal(0.67)));
+        emit q->volumeChanged(pow(newVolume, qreal(0.67)));
     }
 }
 
--- trunk/KDE/kdelibs/phonon/effectparameter.h #785575:785576
@@ -193,7 +193,7 @@
          * (explaining what it controls) to be used as a tooltip or
          * WhatsThis help.
          */
-        EffectParameter(int parameterId, const QString &name, EffectParameter::Hints \
hints, +        EffectParameter(int parameterId, const QString &name, Hints hints,
                 const QVariant &defaultValue, const QVariant &min = QVariant(),
                 const QVariant &max = QVariant(), const QVariantList &values = \
QVariantList(),  const QString &description = QString());
--- trunk/KDE/kdelibs/phonon/iodevicestream_p.h #785575:785576
@@ -34,8 +34,7 @@
     Q_DECLARE_PUBLIC(IODeviceStream)
     protected:
         IODeviceStreamPrivate(QIODevice *_ioDevice)
-            : ioDevice(_ioDevice),
-            offset(0)
+            : ioDevice(_ioDevice)
         {
             if (!ioDevice->isOpen()) {
                 ioDevice->open(QIODevice::ReadOnly);
@@ -48,7 +47,6 @@
 
     private:
         QIODevice *ioDevice;
-        qint64 offset;
 };
 
 } // namespace Phonon
--- trunk/KDE/kdelibs/phonon/mediacontroller.cpp #785575:785576
@@ -172,52 +172,51 @@
             AddonInterface::setAngle, QList<QVariant>() << QVariant(titleNumber));
 }
 
-AudioStreamDescription MediaController::currentAudioStream(const QObject *audioPath) \
const +AudioStreamDescription MediaController::currentAudioStream() const
 {
     IFACE AudioStreamDescription();
     return iface->interfaceCall(AddonInterface::AudioChannelInterface,
-        AddonInterface::currentAudioStream, QList<QVariant>() << \
QVariant(audioPath)).value<AudioStreamDescription>(); +        \
AddonInterface::currentAudioStream).value<AudioStreamDescription>();  }
 
-SubtitleStreamDescription MediaController::currentSubtitleStream(const QObject \
*videoPath) const +SubtitleStreamDescription MediaController::currentSubtitleStream() \
const  {
     IFACE SubtitleStreamDescription();
     return iface->interfaceCall(AddonInterface::SubtitleInterface,
-        AddonInterface::currentSubtitleStream, QList<QVariant>() << \
QVariant(videoPath)).value<SubtitleStreamDescription>(); +        \
AddonInterface::currentSubtitleStream).value<SubtitleStreamDescription>();  }
 
-QList<AudioStreamDescription> MediaController::availableAudioStreams(const QObject \
*videoPath) const +QList<AudioStreamDescription> \
MediaController::availableAudioStreams() const  {
     QList<AudioStreamDescription> retList;
     IFACE retList;
     retList = iface->interfaceCall(AddonInterface::AudioChannelInterface,
-        AddonInterface::availableAudioStreams, QList<QVariant>() << \
                QVariant(videoPath))
-        .value< QList<AudioStreamDescription> >();
+        AddonInterface::availableAudioStreams).value< QList<AudioStreamDescription> \
>();  return retList;
 }
 
-QList<SubtitleStreamDescription> MediaController::availableSubtitleStreams(const \
QObject *videoPath) const +QList<SubtitleStreamDescription> \
MediaController::availableSubtitleStreams() const  {
     QList<SubtitleStreamDescription> retList;
     IFACE retList;
     retList = iface->interfaceCall(AddonInterface::SubtitleInterface,
-        AddonInterface::availableSubtitleStreams, QList<QVariant>() << \
QVariant(videoPath)) +        AddonInterface::availableSubtitleStreams)
         .value< QList<SubtitleStreamDescription> >();
     return retList;
 }
 
-void MediaController::setCurrentAudioStream(const Phonon::AudioStreamDescription \
&stream, const QObject* audioPath) +void MediaController::setCurrentAudioStream(const \
Phonon::AudioStreamDescription &stream)  {
     IFACE;
     iface->interfaceCall(AddonInterface::AudioChannelInterface,
-        AddonInterface::setCurrentAudioStream, QList<QVariant>() << \
QVariant::fromValue(stream) << QVariant(audioPath)); +        \
AddonInterface::setCurrentAudioStream, QList<QVariant>() << \
qVariantFromValue(stream));  }
 
-void MediaController::setCurrentSubtitleStream(const \
Phonon::SubtitleStreamDescription &stream, const QObject* videoPath) +void \
MediaController::setCurrentSubtitleStream(const Phonon::SubtitleStreamDescription \
&stream)  {
     IFACE;
     iface->interfaceCall(AddonInterface::SubtitleInterface,
-        AddonInterface::setCurrentSubtitleStream, QList<QVariant>() << \
QVariant::fromValue(stream) << QVariant(videoPath)); +        \
AddonInterface::setCurrentSubtitleStream, QList<QVariant>() << \
qVariantFromValue(stream));  }
 
 #undef IFACE
--- trunk/KDE/kdelibs/phonon/mediacontroller.h #785575:785576
@@ -73,7 +73,7 @@
          * \see availableAudioStreams
          * \see setCurrentAudioStream
          */
-        AudioStreamDescription currentAudioStream(const QObject *audioPath = 0) \
const; +        AudioStreamDescription currentAudioStream() const;
 
         /**
          * Returns the selected subtitle stream.
@@ -81,7 +81,7 @@
          * \see availableSubtitleStreams
          * \see setCurrentSubtitleStream
          */
-        SubtitleStreamDescription currentSubtitleStream(const QObject *videoPath = \
0) const; +        SubtitleStreamDescription currentSubtitleStream() const;
 
         /**
          * Returns the audio streams that can be selected by the user. The
@@ -90,7 +90,7 @@
          * \see selectedAudioStream
          * \see setCurrentAudioStream
          */
-        QList<AudioStreamDescription> availableAudioStreams(const QObject *audioPath \
= 0) const; +        QList<AudioStreamDescription> availableAudioStreams() const;
 
         /**
          * Returns the subtitle streams that can be selected by the user. The
@@ -99,7 +99,7 @@
          * \see selectedSubtitleStream
          * \see setCurrentSubtitleStream
          */
-        QList<SubtitleStreamDescription> availableSubtitleStreams(const QObject \
*videoPath = 0) const; +        QList<SubtitleStreamDescription> \
availableSubtitleStreams() const;  
         /**
          * Selects an audio stream from the media.
@@ -112,7 +112,7 @@
          * \see availableAudioStreams()
          * \see currentAudioStream()
          */
-        void setCurrentAudioStream(const Phonon::AudioStreamDescription &stream, \
const QObject* audioPath = 0); +        void setCurrentAudioStream(const \
Phonon::AudioStreamDescription &stream);  
         /**
          * Selects a subtitle stream from the media.
@@ -125,7 +125,7 @@
          * \see availableSubtitleStreams()
          * \see currentSubtitleStream()
          */
-        void setCurrentSubtitleStream(const Phonon::SubtitleStreamDescription \
&stream, const QObject* videoPath = 0); +        void setCurrentSubtitleStream(const \
Phonon::SubtitleStreamDescription &stream);  
     public Q_SLOTS:
         void setCurrentAngle(int angleNumber);
--- trunk/KDE/kdelibs/phonon/objectdescriptionmodel.cpp #785575:785576
@@ -365,12 +365,14 @@
     return QStringList(QLatin1String("application/x-phonon-objectdescription") + \
QString::number(static_cast<int>(type)));  }
 
+#if !defined(Q_CC_MSVC) || _MSC_VER >= 1300 || defined(Q_CC_INTEL)
 #define INSTANTIATE_META_FUNCTIONS(type) \
 template PHONON_EXPORT const QMetaObject *ObjectDescriptionModel<type>::metaObject() \
const; \  template void *ObjectDescriptionModel<type>::qt_metacast(const char *)
 
 INSTANTIATE_META_FUNCTIONS(AudioOutputDeviceType);
 INSTANTIATE_META_FUNCTIONS(EffectType);
+#endif
 /*INSTANTIATE_META_FUNCTIONS(AudioCaptureDeviceType);
 INSTANTIATE_META_FUNCTIONS(VideoOutputDeviceType);
 INSTANTIATE_META_FUNCTIONS(VideoCaptureDeviceType);
--- trunk/KDE/kdelibs/phonon/objectdescriptionmodel_p.h #785575:785576
@@ -32,14 +32,14 @@
 class ListModelHelper : public QAbstractListModel
 {
     public:
-        using QAbstractItemModel::layoutAboutToBeChanged;
-        using QAbstractItemModel::changePersistentIndexList;
-        using QAbstractItemModel::layoutChanged;
-        using QAbstractItemModel::reset;
-        using QAbstractItemModel::beginInsertRows;
-        using QAbstractItemModel::endInsertRows;
-        using QAbstractItemModel::beginRemoveRows;
-        using QAbstractItemModel::endRemoveRows;
+        using QAbstractListModel::layoutAboutToBeChanged;
+        using QAbstractListModel::changePersistentIndexList;
+        using QAbstractListModel::layoutChanged;
+        using QAbstractListModel::reset;
+        using QAbstractListModel::beginInsertRows;
+        using QAbstractListModel::endInsertRows;
+        using QAbstractListModel::beginRemoveRows;
+        using QAbstractListModel::endRemoveRows;
 };
 
 class ObjectDescriptionModelDataPrivate
--- trunk/KDE/kdelibs/phonon/phononnamespace.cpp #785575:785576
@@ -31,6 +31,18 @@
 
 namespace Phonon
 {
+    /*!
+        Returns the version number of Phonon at run-time as a string (for
+        example, "4.0.0"). This may be a different version than the
+        version the application was compiled against.
+
+        \sa PHONON_VERSION_STR
+    */
+    const char *phononVersion()
+    {
+        return PHONON_VERSION_STR;
+    }
+
     QString categoryToString(Category c)
     {
         switch(c)
--- trunk/KDE/kdelibs/phonon/phononnamespace.h #785575:785576
@@ -22,6 +22,16 @@
 
 #include "phonon/phonon_export.h"
 
+#define PHONON_VERSION 0x040200
+/*
+   PHONON_VERSION is (major << 16) + (minor << 8) + patch.
+*/
+#define PHONON_VERSION_STR "4.2.0"
+/*
+   can be used like #if (PHONON_VERSION >= PHONON_VERSION_CHECK(4, 4, 0))
+*/
+#define PHONON_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
+
 QT_BEGIN_HEADER
 QT_BEGIN_NAMESPACE
 
@@ -41,6 +51,8 @@
  */
 namespace Phonon
 {
+    PHONON_EXPORT const char *phononVersion();
+
     /**
      * Enum to identify the media discs supported by MediaObject.
      *
--- trunk/KDE/kdelibs/phonon/qsettingsgroup_p.h #785575:785576
@@ -51,7 +51,7 @@
         template<typename T>
         inline T value(const QString &key, const T &def) const
         {
-            return qvariant_cast<T>(value(key, QVariant::fromValue(def)));
+            return qvariant_cast<T>(value(key, qVariantFromValue(def)));
         }
 
         inline QVariant value(const QString &key, const QVariant &def) const
@@ -63,7 +63,7 @@
         inline void setValue(const QString &key, const T &value)
         {
             Q_ASSERT(m_mutableSettings);
-            m_mutableSettings->setValue(m_group + key, QVariant::fromValue(value));
+            m_mutableSettings->setValue(m_group + key, qVariantFromValue(value));
         }
 
         inline void removeEntry(const QString &key)
--- trunk/KDE/kdelibs/phonon/volumefadereffect.cpp #785575:785576
@@ -21,8 +21,9 @@
 #include "volumefadereffect_p.h"
 #include "volumefaderinterface.h"
 #include "factory.h"
-#include <cmath>
 
+#include <qmath.h>
+
 #define PHONON_CLASSNAME VolumeFaderEffect
 #define PHONON_INTERFACENAME VolumeFaderInterface
 
@@ -44,12 +45,12 @@
 
 double VolumeFaderEffect::volumeDecibel() const
 {
-    return -std::log(volume()) / log10over20;
+    return -log(volume()) / log10over20;
 }
 
 void VolumeFaderEffect::setVolumeDecibel(double newVolumeDecibel)
 {
-    setVolume(std::exp(-newVolumeDecibel * log10over20));
+    setVolume(exp(-newVolumeDecibel * log10over20));
 }
 
 


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

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