9#ifndef DECLARATIVEMEDIAPLAYER_H
10#define DECLARATIVEMEDIAPLAYER_H
13#include <qqmlregistration.h>
15#include "mediaplayer.h"
16#include "pendingcall.h"
18class DeclarativeMediaPlayer :
public QObject
21 QML_NAMED_ELEMENT(MediaPlayer)
22 QML_UNCREATABLE(
"MediaPlayer cannot be created")
24 Q_PROPERTY(BluezQt::MediaPlayer::Equalizer equalizer READ equalizer WRITE setEqualizer NOTIFY equalizerChanged)
25 Q_PROPERTY(BluezQt::MediaPlayer::Repeat repeat READ repeat WRITE setRepeat NOTIFY repeatChanged)
26 Q_PROPERTY(BluezQt::MediaPlayer::Shuffle shuffle READ shuffle WRITE setShuffle NOTIFY shuffleChanged)
27 Q_PROPERTY(BluezQt::MediaPlayer::Status status READ status NOTIFY statusChanged)
29 Q_PROPERTY(quint32 position READ position NOTIFY positionChanged)
32 explicit DeclarativeMediaPlayer(BluezQt::MediaPlayerPtr mediaPlayer,
QObject *
parent =
nullptr);
36 BluezQt::MediaPlayer::Equalizer equalizer() const;
37 void setEqualizer(BluezQt::MediaPlayer::Equalizer equalizer);
39 BluezQt::MediaPlayer::Repeat repeat() const;
40 void setRepeat(BluezQt::MediaPlayer::Repeat repeat);
42 BluezQt::MediaPlayer::Shuffle shuffle() const;
43 void setShuffle(BluezQt::MediaPlayer::Shuffle shuffle);
45 BluezQt::MediaPlayer::Status status() const;
49 quint32 position() const;
52 BluezQt::PendingCall *play();
53 BluezQt::PendingCall *pause();
54 BluezQt::PendingCall *stop();
55 BluezQt::PendingCall *next();
56 BluezQt::PendingCall *previous();
57 BluezQt::PendingCall *fastForward();
58 BluezQt::PendingCall *rewind();
61 void nameChanged(const
QString &name);
62 void equalizerChanged(BluezQt::MediaPlayer::Equalizer equalizer);
63 void repeatChanged(BluezQt::MediaPlayer::Repeat repeat);
64 void shuffleChanged(BluezQt::MediaPlayer::Shuffle shuffle);
65 void statusChanged(BluezQt::MediaPlayer::Status status);
67 void positionChanged(quint32 position);
72 BluezQt::MediaPlayerPtr m_mediaPlayer;
QObject * parent() const const