#ifndef PQSOUNDEFFECT_H
#define PQSOUNDEFFECT_H

#include <pqobject.h>
#include <QSoundEffect>

class PQSoundEffect : public QSoundEffect
{
    Q_OBJECT
    PQ_OBJECT_EX(QSoundEffect)

public:
    Q_INVOKABLE explicit PQSoundEffect(QObject *parent = Q_NULLPTR);
    ~PQSoundEffect();

    Q_INVOKABLE QStringList supportedMimeTypes();

    Q_INVOKABLE QString source() const;
    Q_INVOKABLE void setSource(const QString &url);

    Q_INVOKABLE int loopCount() const;
    Q_INVOKABLE int loopsRemaining() const;
    Q_INVOKABLE void setLoopCount(int loopCount);

    Q_INVOKABLE double volume() const;
    Q_INVOKABLE void setVolume(double volume);

    Q_INVOKABLE bool isMuted() const;
    Q_INVOKABLE void setMuted(bool muted);

    Q_INVOKABLE bool isLoaded() const;

    Q_INVOKABLE bool isPlaying() const;
    Q_INVOKABLE int status() const;

    Q_INVOKABLE QString category() const;
    Q_INVOKABLE void setCategory(const QString &category);

public slots:
    Q_INVOKABLE void play();
    Q_INVOKABLE void stop();

    void categoryChanged_pslot();
    void loadedChanged_pslot();
    void loopCountChanged_pslot();
    void loopsRemainingChanged_pslot();
    void mutedChanged_pslot();
    void playingChanged_pslot();
    void sourceChanged_pslot();
    void statusChanged_pslot();
    void volumeChanged_pslot();

    PQ_ON_SIGNAL_DECL_START {
        PQOBJECT_ON_SIGNALS();
        PQ_ON_SIGNAL(categoryChanged_pslot());
        PQ_ON_SIGNAL(loadedChanged_pslot());
        PQ_ON_SIGNAL(loopCountChanged_pslot());
        PQ_ON_SIGNAL(loopsRemainingChanged_pslot());
        PQ_ON_SIGNAL(mutedChanged_pslot());
        PQ_ON_SIGNAL(playingChanged_pslot());
        PQ_ON_SIGNAL(sourceChanged_pslot());
        PQ_ON_SIGNAL(statusChanged_pslot());
        PQ_ON_SIGNAL(volumeChanged_pslot());
    } PQ_ON_SIGNAL_DECL_END
};

#endif // PQSOUNDEFFECT_H
