-
Notifications
You must be signed in to change notification settings - Fork 6
/
lyrics.h
101 lines (87 loc) · 2.57 KB
/
lyrics.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
99
100
101
/*
Drumstick MIDI File Player Multiplatform Program
Copyright (C) 2006-2024, Pedro Lopez-Cabanillas <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LYRICS_H
#define LYRICS_H
#include <QMainWindow>
#include <QMap>
#include <QObject>
#include <QTextCodec>
#include <mutex>
#include "framelesswindow.h"
class QGridLayout;
class QFrame;
class QHBoxLayout;
class QLabel;
class QComboBox;
class QToolButton;
class QTextEdit;
class Sequence;
class Lyrics : public FramelessWindow
{
Q_OBJECT
public:
explicit Lyrics(QWidget *parent = nullptr);
void readSettings();
void writeSettings();
void retranslateUi();
void initSong( Sequence *song );
void applySettings() override;
public slots:
void slotMidiText(const int track, const int type, int ticks, const QByteArray &text);
void trackChanged(int index);
void typeChanged(int index);
void codecChanged(int index);
void changeFont();
void displayText();
void toggleFullScreen(bool enabled);
void slotCopy();
void slotSave();
void slotPrint();
signals:
void closed();
protected:
void showEvent(QShowEvent *event) override;
void closeEvent( QCloseEvent *event) override;
private: // methods
void populateCodecsCombo();
void populateTracksCombo();
QString sanitizeText(const QByteArray& text);
private: // member vars
int m_track;
int m_mib;
int m_type;
Sequence *m_song;
QTextCodec *m_codec;
QColor m_normalColor;
QColor m_otherColor;
QColor m_highlightColor;
QAction *m_actionCopy;
QAction *m_actionSave;
QAction *m_actionPrint;
QAction *m_actionFont;
QAction *m_actionFullScreen;
QLabel *m_label1;
QComboBox *m_comboTrack;
QLabel *m_label2;
QComboBox *m_comboType;
QLabel *m_label3;
QComboBox *m_comboCodec;
QToolButton *m_toolButton;
QTextEdit *m_textViewer;
QMenu *m_chmenu;
QMap<int,int> m_textPos;
std::once_flag m_firstTime;
};
#endif // LYRICS_H