TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiclrcmakerwidget.h
Go to the documentation of this file.
1 #ifndef MUSICLRCMAKERWIDGET_H
2 #define MUSICLRCMAKERWIDGET_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2024 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
23 
24 namespace Ui {
26 }
27 class MusicLrcAnalysis;
29 
34 {
35  Q_OBJECT
37 public:
41  explicit MusicLrcMakerWidgetItem(QWidget *ui = nullptr, QObject *parent = nullptr);
42 
46  bool biggerThan(int value) const;
50  bool done() const;
54  void reset();
58  void moveUp();
62  void moveDown();
66  void moveLeft();
70  void moveRight();
71 
72 public Q_SLOTS:
76  void setText(const QString &string);
77 
78 private:
82  virtual void paintEvent(QPaintEvent *event) override final;
83 
84  QObject *m_parent;
85  bool m_leftDirection, m_painetLineDone;
86  int m_intervalCount, m_itemDelta;
87  int m_currentIndex, m_paintIndex;
88 
89 };
90 
91 
96 {
97  Q_OBJECT
99 public:
103  explicit MusicLrcMakerWidget(QWidget *parent = nullptr);
108 
112  void setCurrentSongName(const QString &name);
113 
114 public Q_SLOTS:
118  void positionChanged(qint64 position);
122  void durationChanged(qint64 duration);
126  void currentLineFinished();
127 
128 private Q_SLOTS:
132  void timeSliderValueChanged(int value);
136  void saveButtonClicked();
140  void reMakeButtonClicked();
144  void backToMakeLrcWidget();
148  void firstWidgetStateButtonClicked();
152  void thirdWidgetStateButtonClicked();
156  void setCurrentMainWidget();
160  void setCurrentFirstWidget();
164  void setCurrentSecondWidget();
168  void setCurrentThirdWidget();
172  void updateAnimationLrc();
176  void lrcSpeedSlower();
180  void lrcSpeedFaster();
181 
182 private:
186  virtual void keyPressEvent(QKeyEvent *event) override final;
187  virtual void keyReleaseEvent(QKeyEvent *event) override final;
191  void createCurrentLine(int key);
195  void createMainWidget();
199  void createFirstWidget();
203  void createSecondWidget();
207  void createThirdWidget();
212  bool checkInputValid();
216  void setControlEnabled(bool enabled) const;
220  QString translateTimeString(qint64 time);
224  void resetToOriginPlayMode();
228  void updateCurrentLrc(qint64 time);
232  void setItemStyleSheet(int index, int size, int transparent);
233 
234  Ui::MusicLrcMakerWidget *m_ui;
235  QStringList m_plainText;
236  QMap<int, qint64> m_times;
242  QList<MusicLrcManagerForInterior*> m_lrcContainer;
243 
244 };
245 
246 #endif // MUSICLRCMAKERWIDGET_H
#define TTK_MODULE_EXPORT
QList< MusicLrcManagerForInterior * > m_lrcContainer
MusicLrcMakerWidgetItem * m_lineItem
static constexpr wchar_t key[]
voidpf void uLong size
Definition: ioapi.h:136
MusicLrcAnalysis * m_analysis
const char * name
Definition: http_parser.c:458
The class of the core lrc analysis.
PlayMode
Definition: musicobject.h:171
The class of the interior lrc manager.
QMap< int, qint64 > m_times
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the lrc maker widget item.
The class of the lrc maker widget.
Ui::MusicLrcMakerWidget * m_ui
The class of the moving widget base.