TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiclrccontainerforinterior.h
Go to the documentation of this file.
1 #ifndef MUSICLRCCCONTAINERFORINTERIOR_H
2 #define MUSICLRCCCONTAINERFORINTERIOR_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 
22 #include "musiclrccontainer.h"
23 
24 class TTKClickedLabel;
31 
36 {
37  Q_OBJECT
38 public:
42  explicit MusicLrcContainerForInterior(QWidget *parent = nullptr);
47 
51  virtual void start() override final;
55  virtual void stop() override final;
59  virtual void applyParameter() override final;
60 
64  void updateCurrentLrc(qint64 time);
68  void updateCurrentLrc(MusicLrcAnalysis::State state);
72  QString text() const;
76  qint64 findTimePosition(qint64 time);
77 
81  inline void setLrcDisplayExpand(bool expand) noexcept { m_lrcDisplayAll = expand; }
85  inline bool lrcDisplayExpand() const noexcept { return m_lrcDisplayAll; }
89  inline bool isShowArtistBackground() const noexcept { return m_showArtistBackground; }
90 
94  void setLrcSize(int size);
98  int lrcSize() const noexcept;
99 
103  void resizeGeometry();
104 
108  void createFloatPlayWidget();
112  void lrcWidgetShowFullScreen();
113 
114 Q_SIGNALS:
118  void backgroundChanged();
122  void updateCurrentTime(qint64 time);
123 
124 public Q_SLOTS:
128  void lrcSizeChanged(QAction *action);
132  void lrcTimePositionChanged(QAction *action);
136  void revertTimePosition();
140  void saveLrcTimeChanged();
144  void artistBackgroundChanged();
148  void lrcOpenFileDir() const;
152  void lrcCopyClipboard() const;
156  void showLocalLinkWidget();
160  void showSongCommentsWidget();
164  void showLrcPosterWidget();
165 
166 private Q_SLOTS:
170  void showSongMovieWidget();
174  void updateAnimationLrc();
178  void translatedLrcData();
179 
180 private:
184  virtual void contextMenuEvent(QContextMenuEvent *event) override final;
185  virtual void mousePressEvent(QMouseEvent *event) override final;
186  virtual void mouseMoveEvent(QMouseEvent *event) override final;
187  virtual void mouseReleaseEvent(QMouseEvent *event) override final;
188  virtual void mouseDoubleClickEvent(QMouseEvent *event) override final;
189  virtual void paintEvent(QPaintEvent *event) override final;
190 
194  void createFunctionLabel();
198  void createColorMenu(QMenu *menu);
202  void setTimePosition(qint64 pos);
206  void createNoLrcCurrentInfo();
210  void showNoLrcCurrentInfo();
214  void initCurrentLrc(const QString &str);
218  void setItemStyleSheet();
222  void setItemStyleSheet(int index, int size, int transparent);
226  int mapLrcSizeProperty(int size);
230  void setLrcSizeProperty(int property);
234  void resizeWidth(int w, int h);
235 
236  QPoint m_pressedPos;
237  int m_lrcChangeOffset, m_lrcChangeDelta;
238  bool m_mouseLeftPressed, m_lrcChangeState, m_mouseMoved;
239 
240  bool m_lrcDisplayAll, m_showArtistBackground;
241  int m_animationFreshTime, m_lrcSizeProperty;
242 
243  qint64 m_timePositionOffset;
244  QWidget *m_functionLabel;
245  MusicVoicePopWidget *m_mufflerButton;
246  MusicLrcFloatWidget *m_lrcFloatWidget;
247  MusicLrcFloatPlayWidget *m_floatPlayWidget;
248  TTKClickedLabel *m_noLrcCurrentInfo;
249  MusicLrcCommentsWidget *m_commentsWidget;
250  MusicLrcTranslatedWidget *m_translatedWidget;
252 
253 };
254 
255 #endif // MUSICLRCCCONTAINERFORINTERIOR_H
The class of the interior lrc container.
#define TTK_MODULE_EXPORT
The class of the lrc song comment widget.
void setLrcDisplayExpand(bool expand) noexcept
voidpf void uLong size
Definition: ioapi.h:136
The class of the label widget that can click.
virtual void start()=0
The class of the lrc container base.
The class of the lrc float widget.
The class of the lrc play float widget.
The class of the vertical layout float animation widget.
The class of the volume popup widget.
virtual void applyParameter()
The class of the lrc translate widget.
virtual void stop()=0
#define const
Definition: zconf.h:233
state
Definition: http_parser.c:279