-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathosdlyricswidget.h
41 lines (35 loc) · 937 Bytes
/
osdlyricswidget.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
#ifndef OSDLYRICSWIDGET_H
#define OSDLYRICSWIDGET_H
#include <QWidget>
#include <QtCore>
#include <QTimer>
typedef struct LRCLine{
long milliseconds;
QString lineStr;
bool operator <(const LRCLine &line) const;
}LrcLine;
class OSDLyricsWidget : public QWidget
{
Q_OBJECT
public:
explicit OSDLyricsWidget(QWidget *parent = 0);
~OSDLyricsWidget();
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void paintEvent(QPaintEvent *event);
signals:
public slots:
void handleNewLyricsData(QByteArray *lrcData);
void processLyricLine(QString line);
void updateLyrics(long timePos);
void handleTimeout();
void pauseTimer(bool stop);
private:
QPoint windowPos, dPos;
QString currentLyrics;
int curIndex;
QList <LrcLine> *lrcLineList;
unsigned long curLyricTime,curLyricTimeLeft;
QTimer *timer;
};
#endif // OSDLYRICSWIDGET_H