TTKMusicPlayer  3.7.0.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 - 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 "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_photos.count(); }
57  inline bool isEmpty() const { return m_photos.isEmpty(); }
58 
62  void photoNext();
66  void photoPrevious();
67 
71  QString artistPhotoPath();
75  QString artistPhotoDefaultPath() const;
76 
80  void updateArtistPhotoList();
84  QStringList artistPhotoList() const;
88  void setArtistPhotoList(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 
115  void backgroundUrlChanged();
116 
117 Q_SIGNALS:
121  void artistChanged();
125  void backgroundChanged();
129  void selectIndexChanged();
130 
131 private:
136 
138  QStringList m_photos;
139  QObjectList m_observer;
140  QString m_currentArtistName, m_background;
141 
143 
144 };
145 
146 #define G_BACKGROUND_PTR makeMusicBackgroundManager()
148 
149 #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:152