TTKMusicPlayer  4.3.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 - 2026 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
36 public:
40  explicit MusicLrcMakerWidgetItem(QWidget *ui = nullptr, QObject *parent = nullptr);
41 
45  bool biggerThan(int value) const;
49  bool done() const noexcept;
53  void reset();
57  void moveUp();
61  void moveDown();
65  void moveLeft();
69  void moveRight();
70 
71 public Q_SLOTS:
75  void setText(const QString &string);
76 
77 private:
81  virtual void paintEvent(QPaintEvent *event) override final;
82 
83  QObject *m_parent;
84  bool m_leftDirection, m_painetLineDone;
85  int m_intervalCount, m_itemDelta;
86  int m_currentIndex, m_paintIndex;
87 
88 };
89 
90 
95 {
96  Q_OBJECT
98 public:
102  explicit MusicLrcMakerWidget(QWidget *parent = nullptr);
107 
111  void setCurrentSongName(const QString &name);
112 
113 public Q_SLOTS:
117  void positionChanged(qint64 position);
121  void durationChanged(qint64 duration);
125  void currentLineFinished();
126 
127 private Q_SLOTS:
131  void timeSliderValueChanged(int value);
135  void saveButtonClicked();
139  void reMakeButtonClicked();
143  void backToMakeLrcWidget();
147  void firstWidgetStateButtonClicked();
151  void thirdWidgetStateButtonClicked();
155  void setCurrentMainWidget();
159  void setCurrentFirstWidget();
163  void setCurrentSecondWidget();
167  void setCurrentThirdWidget();
171  void updateAnimationLrc();
175  void lrcPositionSlower();
179  void lrcPositionFaster();
180 
181 private:
185  virtual void keyPressEvent(QKeyEvent *event) override final;
186  virtual void keyReleaseEvent(QKeyEvent *event) override final;
190  void createCurrentLine(int key);
194  void createMainWidget();
198  void createFirstWidget();
202  void createSecondWidget();
206  void createThirdWidget();
207 
211  bool checkInputValid();
215  void setControlEnabled(bool enabled) const;
219  QString translateTimeString(qint64 time);
223  void resetToOriginPlayMode();
227  void updateCurrentLrc(qint64 time);
231  void setItemStyleSheet(int index, int size, int transparent);
232 
233  Ui::MusicLrcMakerWidget *m_ui;
234  QStringList m_plainText;
235  QMap<int, qint64> m_times;
241  QList<MusicLrcManagerForInterior*> m_lrcContainer;
242 
243 };
244 
245 #endif // MUSICLRCMAKERWIDGET_H
#define TTK_MODULE_EXPORT
QList< MusicLrcManagerForInterior * > m_lrcContainer
MusicLrcMakerWidgetItem * m_lineItem
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:190
The class of the interior lrc manager.
QMap< int, qint64 > m_times
static constexpr wchar_t key[]
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:164
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.