summaryrefslogtreecommitdiffstats
path: root/src/multimedia/effects/qsoundeffect_qsound_p.h
diff options
context:
space:
mode:
authorJustin McPherson <justin.mcpherson@nokia.com>2010-03-08 03:45:33 (GMT)
committerJustin McPherson <justin.mcpherson@nokia.com>2010-03-08 05:53:08 (GMT)
commit2e501c4d45dddba3db2d8817a27380615c1ce8fd (patch)
tree89598b65b64a0425868e8335e794ba380330fab9 /src/multimedia/effects/qsoundeffect_qsound_p.h
parenta8b5200403742272811f095c0710193a27eed466 (diff)
downloadQt-2e501c4d45dddba3db2d8817a27380615c1ce8fd.zip
Qt-2e501c4d45dddba3db2d8817a27380615c1ce8fd.tar.gz
Qt-2e501c4d45dddba3db2d8817a27380615c1ce8fd.tar.bz2
Refactor QSoundEffect.
Reviewed-by: Dmytro Poplavskiy
Diffstat (limited to 'src/multimedia/effects/qsoundeffect_qsound_p.h')
-rw-r--r--src/multimedia/effects/qsoundeffect_qsound_p.h55
1 files changed, 15 insertions, 40 deletions
diff --git a/src/multimedia/effects/qsoundeffect_qsound_p.h b/src/multimedia/effects/qsoundeffect_qsound_p.h
index 45c0888..377c8a7 100644
--- a/src/multimedia/effects/qsoundeffect_qsound_p.h
+++ b/src/multimedia/effects/qsoundeffect_qsound_p.h
@@ -55,20 +55,14 @@
#include <QtCore/qobject.h>
-#include <QtCore/qdatetime.h>
-#include <QtMultimedia/qmediaplayer.h>
-
-#include "qsoundeffect_p.h"
+#include <QtCore/qurl.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QTimer;
class QSound;
-class QFile;
-class WaveDecoder;
class QSoundEffectPrivate : public QObject
{
@@ -77,49 +71,30 @@ public:
explicit QSoundEffectPrivate(QObject* parent);
~QSoundEffectPrivate();
- qint64 duration() const;
+ QUrl source() const;
+ void setSource(const QUrl &url);
+ int loopCount() const;
+ void setLoopCount(int loopCount);
int volume() const;
+ void setVolume(int volume);
bool isMuted() const;
- QMediaContent media() const;
- QMediaPlayer::State state() const;
- QMediaPlayer::MediaStatus mediaStatus() const;
+ void setMuted(bool muted);
+ int duration() const;
public Q_SLOTS:
void play();
- void stop();
- void setVolume(int volume);
- void setMuted(bool muted);
- void setMedia(const QMediaContent &media);
Q_SIGNALS:
- void mediaChanged(const QMediaContent &media);
- void mediaStatusChanged(QMediaPlayer::MediaStatus status);
- void stateChanged(QMediaPlayer::State newState);
- void durationChanged(qint64 duration);
- void volumeChanged(int volume);
- void mutedChanged(bool muted);
- void error(QMediaPlayer::Error error);
-
-private slots:
- void decoderReady();
- void decoderError();
- void checkPlayTime();
+ void durationChanged();
+ void volumeChanged();
+ void mutedChanged();
private:
- void loadSample();
- void unloadSample();
-
- bool m_queued;
- bool m_muted;
- QTime m_playbackTime;
- QMediaPlayer::State m_state;
- QMediaPlayer::MediaStatus m_status;
- QFile *m_file;
- QByteArray m_name;
- QMediaContent m_media;
- WaveDecoder *m_waveDecoder;
+ bool m_muted;
+ int m_loopCount;
+ int m_volume;
QSound *m_sound;
- QTimer *m_timer;
+ QUrl m_source;
};
QT_END_NAMESPACE