DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dmpriscontrol.h
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DMPRISCONTROL_H
6#define DMPRISCONTROL_H
7
8#include <DObject>
9#include <dtkwidget_global.h>
10
11#include <QFrame>
12
13DWIDGET_BEGIN_NAMESPACE
14
15class DMPRISControlPrivate;
16class LIBDTKWIDGETSHARED_EXPORT DMPRISControl : public QFrame, public DTK_CORE_NAMESPACE::DObject
17{
18 Q_OBJECT
19 Q_DISABLE_COPY(DMPRISControl)
20 D_DECLARE_PRIVATE(DMPRISControl)
21
22public:
23 explicit DMPRISControl(QWidget *parent = 0);
24
25 bool isWorking() const;
26
27Q_SIGNALS:
28 void mprisAcquired() const;
29 void mprisChanged() const;
30 void mprisLosted() const;
31
32public Q_SLOTS:
33 void setPictureVisible(bool visible);
34 void setPictureSize(const QSize &size);
35
36protected:
37 void showEvent(QShowEvent *event);
38
39 D_PRIVATE_SLOT(void _q_onMetaDataChanged())
40 D_PRIVATE_SLOT(void _q_onPlaybackStatusChanged())
41 D_PRIVATE_SLOT(void _q_onPrevClicked())
42 D_PRIVATE_SLOT(void _q_onPlayClicked())
43 D_PRIVATE_SLOT(void _q_onPauseClicked())
44 D_PRIVATE_SLOT(void _q_onNextClicked())
45 D_PRIVATE_SLOT(void _q_loadMPRISPath(const QString &))
46 D_PRIVATE_SLOT(void _q_removeMPRISPath(const QString &))
47 D_PRIVATE_SLOT(void _q_onCanControlChanged(bool canControl))
48};
49
50DWIDGET_END_NAMESPACE
51
52#endif // DMPRISCONTROL_H
DMPRISControl 封装了MPRIS协议,提供了上一曲、下一曲、暂停播放、恢复播放和显示歌曲名和封面的功能.
Definition dmpriscontrol.h:17
void mprisLosted() const
当MPRIS接口中有退出的服务时会发出该信号
void mprisChanged() const
当MPRIS接口列表发生变化时会发出该信号
void mprisAcquired() const
当第一次注册MPRIS接口时会发出该信号