-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathLyricModel.h
98 lines (71 loc) · 1.46 KB
/
LyricModel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#pragma once
#include <QAbstractListModel>
#include <QStringList>
#include <qdebug.h>
class CLyricModel : public QObject
{
Q_OBJECT
public:
CLyricModel();
~CLyricModel();
signals:
void sig_SendToQml(int nTime);
void sig_ReloadLyric();
void sig_HideLyric();
public:
//歌词设置
Q_INVOKABLE void setLyric(QString str) {
m_lyric = str;
}
Q_INVOKABLE QString getLyric() {
return m_lyric;
}
//歌手设置
Q_INVOKABLE void setSonger(QString str) {
m_songer = str;
}
Q_INVOKABLE QString getSonger() {
qDebug() << "CLyricModel::getSonger" << endl;
return m_songer;
}
//专辑设置
Q_INVOKABLE void setAlbumName(QString str) {
m_AlbumName = str;
}
Q_INVOKABLE QString getAlbumName() {
return m_AlbumName;
}
//歌名设置
Q_INVOKABLE void setSongName(QString str) {
m_SongName = str;
}
Q_INVOKABLE QString getSongName() {
return m_SongName;
}
private:
QString m_lyric;
QString m_songer;
QString m_AlbumName;
QString m_SongName;
};
extern CLyricModel lyricModel;
class CLyricLayer : public QObject
{
Q_OBJECT
public:
CLyricLayer() {
connect(&lyricModel, SIGNAL(sig_SendToQml(int)), this, SLOT(slotSendToQml(int)));
connect(&lyricModel, SIGNAL(sig_ReloadLyric()), this, SLOT(slotReloadLyric()));
};
~CLyricLayer() {};
signals:
void signalSendToQml(int nTime);
void signalReloadLyric();
public slots:
void slotSendToQml(int nTime) {
emit signalSendToQml(nTime);
}
void slotReloadLyric() {
emit signalReloadLyric();
}
};