diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-09-18 00:22:33 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-09-18 00:45:50 +0200 |
commit | cfca7157b98c9dc8e0852fe6484bc3f75008af7d (patch) | |
tree | 32b92340908a9374214ec7b84c1fac7ea338f56d /src/ui/MxcMediaProxy.h | |
parent | Merge pull request #728 from Thulinma/goto (diff) | |
download | nheko-cfca7157b98c9dc8e0852fe6484bc3f75008af7d.tar.xz |
Change indentation to 4 spaces
Diffstat (limited to 'src/ui/MxcMediaProxy.h')
-rw-r--r-- | src/ui/MxcMediaProxy.h | 95 |
1 files changed, 46 insertions, 49 deletions
diff --git a/src/ui/MxcMediaProxy.h b/src/ui/MxcMediaProxy.h index 14541815..18152c75 100644 --- a/src/ui/MxcMediaProxy.h +++ b/src/ui/MxcMediaProxy.h @@ -20,61 +20,58 @@ class TimelineModel; // need the videoSurface property, so that part is really easy! class MxcMediaProxy : public QMediaPlayer { - Q_OBJECT - Q_PROPERTY(TimelineModel *roomm READ room WRITE setRoom NOTIFY roomChanged REQUIRED) - Q_PROPERTY(QString eventId READ eventId WRITE setEventId NOTIFY eventIdChanged) - Q_PROPERTY(QAbstractVideoSurface *videoSurface READ getVideoSurface WRITE setVideoSurface) - Q_PROPERTY(bool loaded READ loaded NOTIFY loadedChanged) + Q_OBJECT + Q_PROPERTY(TimelineModel *roomm READ room WRITE setRoom NOTIFY roomChanged REQUIRED) + Q_PROPERTY(QString eventId READ eventId WRITE setEventId NOTIFY eventIdChanged) + Q_PROPERTY(QAbstractVideoSurface *videoSurface READ getVideoSurface WRITE setVideoSurface) + Q_PROPERTY(bool loaded READ loaded NOTIFY loadedChanged) public: - MxcMediaProxy(QObject *parent = nullptr) - : QMediaPlayer(parent) - { - connect(this, &MxcMediaProxy::eventIdChanged, &MxcMediaProxy::startDownload); - connect(this, &MxcMediaProxy::roomChanged, &MxcMediaProxy::startDownload); - connect(this, - qOverload<QMediaPlayer::Error>(&MxcMediaProxy::error), - [this](QMediaPlayer::Error error) { - nhlog::ui()->info("Media player error {} and errorStr {}", - error, - this->errorString().toStdString()); - }); - connect(this, - &MxcMediaProxy::mediaStatusChanged, - [this](QMediaPlayer::MediaStatus status) { - nhlog::ui()->info( - "Media player status {} and error {}", status, this->error()); - }); - } + MxcMediaProxy(QObject *parent = nullptr) + : QMediaPlayer(parent) + { + connect(this, &MxcMediaProxy::eventIdChanged, &MxcMediaProxy::startDownload); + connect(this, &MxcMediaProxy::roomChanged, &MxcMediaProxy::startDownload); + connect(this, + qOverload<QMediaPlayer::Error>(&MxcMediaProxy::error), + [this](QMediaPlayer::Error error) { + nhlog::ui()->info("Media player error {} and errorStr {}", + error, + this->errorString().toStdString()); + }); + connect(this, &MxcMediaProxy::mediaStatusChanged, [this](QMediaPlayer::MediaStatus status) { + nhlog::ui()->info("Media player status {} and error {}", status, this->error()); + }); + } - bool loaded() const { return buffer.size() > 0; } - QString eventId() const { return eventId_; } - TimelineModel *room() const { return room_; } - void setEventId(QString newEventId) - { - eventId_ = newEventId; - emit eventIdChanged(); - } - void setRoom(TimelineModel *room) - { - room_ = room; - emit roomChanged(); - } - void setVideoSurface(QAbstractVideoSurface *surface); - QAbstractVideoSurface *getVideoSurface(); + bool loaded() const { return buffer.size() > 0; } + QString eventId() const { return eventId_; } + TimelineModel *room() const { return room_; } + void setEventId(QString newEventId) + { + eventId_ = newEventId; + emit eventIdChanged(); + } + void setRoom(TimelineModel *room) + { + room_ = room; + emit roomChanged(); + } + void setVideoSurface(QAbstractVideoSurface *surface); + QAbstractVideoSurface *getVideoSurface(); signals: - void roomChanged(); - void eventIdChanged(); - void loadedChanged(); - void newBuffer(QMediaContent, QIODevice *buf); + void roomChanged(); + void eventIdChanged(); + void loadedChanged(); + void newBuffer(QMediaContent, QIODevice *buf); private slots: - void startDownload(); + void startDownload(); private: - TimelineModel *room_ = nullptr; - QString eventId_; - QString filename_; - QBuffer buffer; - QAbstractVideoSurface *m_surface = nullptr; + TimelineModel *room_ = nullptr; + QString eventId_; + QString filename_; + QBuffer buffer; + QAbstractVideoSurface *m_surface = nullptr; }; |