TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiclrccontainer.h
Go to the documentation of this file.
1 #ifndef MUSICLRCCONTAINER_H
2 #define MUSICLRCCONTAINER_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 
22 #include "musiclrcmanager.h"
23 #include "musiclrcanalysis.h"
24 #include "musicsettingmanager.h"
25 
27 
28 static constexpr const char *LRC_WALLPAPER_TPYE = "WALLPAPER";
29 static constexpr const char *LRC_INTERIOR_TPYE = "INTERIOR";
30 static constexpr const char *LRC_DESKTOP_TPYE = "DESKTOP";
31 static constexpr const char *LRC_DESKTOP_PREFIX = "D";
32 
36 class TTK_MODULE_EXPORT MusicLrcContainer : public QWidget
37 {
38  Q_OBJECT
40 public:
44  explicit MusicLrcContainer(QWidget *parent = nullptr);
49 
54  virtual void startDrawLrc() = 0;
59  virtual void stopDrawLrc() = 0;
63  virtual void applyParameter();
64 
68  void setLinearGradientColor(MusicLrcColor::Color color);
72  void setLinearGradientColor(const MusicLrcColor &color);
76  inline void setCurrentSongName(const QString &name) { m_currentSongName = name; }
80  void setCurrentTime(qint64 time, qint64 total);
84  qint64 totalTime() const;
85 
89  inline void setLrcAnalysisModel(MusicLrcAnalysis *analysis) { m_lrcAnalysis = analysis; }
93  inline MusicLrcAnalysis* lrcAnalysisModel() const { return m_lrcAnalysis; }
94 
95 Q_SIGNALS:
99  void currentLrcUpdated();
103  void showCurrentLrcSetting();
107  void showCurrentLrcColorSetting();
111  void maskLinearGradientColorChanged();
115  void linearGradientColorChanged();
116 
117 public Q_SLOTS:
121  void currentLrcCustom();
125  void changeCurrentLrcColor(QAction *action);
129  void changeCurrentLrcColor(int index);
133  void searchMusicLrcs();
137  void showLrcMakedWidget();
141  void linkLrcStateChanged();
142 
143 protected:
147  void clearAllMusicLRCManager();
148 
150  qint64 m_currentTime, m_totalTime;
151  QString m_currentSongName, m_containerType;
153  QList<MusicLrcManager*> m_lrcManagers;
155 
156 };
157 
158 #endif // MUSICLRCCONTAINER_H
#define TTK_MODULE_EXPORT
MusicLrcAnalysis * m_lrcAnalysis
The class of the lrc color.
static constexpr const char * LRC_DESKTOP_TPYE
static constexpr const char * LRC_DESKTOP_PREFIX
void setLrcAnalysisModel(MusicLrcAnalysis *analysis)
void setCurrentSongName(const QString &name)
The class of the lrc container base.
MusicLrcAnalysis * lrcAnalysisModel() const
const char * name
Definition: http_parser.c:458
The class of the core lrc analysis.
The class of the lrc search widget.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
static constexpr const char * LRC_WALLPAPER_TPYE
MusicLrcSearchWidget * m_lrcSearchWidget
QList< MusicLrcManager * > m_lrcManagers
static constexpr const char * LRC_INTERIOR_TPYE