TTKMusicPlayer  4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicbackgroundmanager.h
Go to the documentation of this file.
1 #ifndef MUSICBACKGROUNDMANAGER_H
2 #define MUSICBACKGROUNDMANAGER_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2025 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 "musicobject.h"
23 #include "ttksingleton.h"
24 
29 {
30  Q_OBJECT
32 public:
36  void setArtistName(const QString &name);
40  QString artistName() const;
41 
45  inline int currentIndex() const { return m_currentIndex; }
49  inline void setCurrentIndex(int index) { m_currentIndex = index; }
53  inline int count() const { return m_images.count(); }
57  inline bool isEmpty() const { return m_images.isEmpty(); }
58 
62  void imageNext();
66  void imagePrevious();
67 
71  QString artistImagePath();
75  QString artistImageDefaultPath() const;
76 
80  void updateArtistImageList();
84  QStringList artistImageList() const;
88  void setArtistImageList(const QStringList &list);
92  void setSelectArtistIndex(int index);
93 
97  void addObserver(QObject *object);
101  void removeObserver(QObject *object);
102 
106  void setBackgroundUrl(const QString &path);
110  QString backgroundUrl() const;
111 
112 Q_SIGNALS:
116  void artistChanged();
120  void backgroundChanged();
124  void selectIndexChanged();
125 
126 private:
131 
133  QStringList m_images;
134  QObjectList m_observer;
135  QString m_currentArtistName, m_background;
136 
138 
139 };
140 
141 #define G_BACKGROUND_PTR makeMusicBackgroundManager()
143 
144 #endif // MUSICBACKGROUNDMANAGER_H
#define TTK_MODULE_EXPORT
const char * name
Definition: http_parser.c:458
#define TTK_DECLARE_SINGLETON_CLASS(Class)
// Singleton Macro // //
Definition: ttksingleton.h:86
The class of the manager of dealing with artist pictures.
TTK_MODULE_EXPORT MusicBackgroundManager * makeMusicBackgroundManager()
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:168