TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
metadatamanager.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2009-2024 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef METADATAMANAGER_H
22 #define METADATAMANAGER_H
23 
24 #include <QList>
25 #include <QStringList>
26 #include <QPixmap>
27 #include <QDir>
28 #include <QMutex>
29 #include "trackinfo.h"
30 #include "metadatamodel.h"
31 
32 class DecoderFactory;
33 class EngineFactory;
34 class InputSourceFactory;
35 class QmmpSettings;
36 
37 
42 {
43 public:
52  QList<TrackInfo*> createPlayList(const QString &path, TrackInfo::Parts parts = TrackInfo::AllParts, QStringList *ignoredPaths = nullptr) const;
59  MetaDataModel* createMetaDataModel(const QString &url, bool readOnly) const;
63  QStringList filters() const;
67  QStringList nameFilters() const;
71  QStringList protocols() const;
75  QList<RegularExpression> regExps() const;
79  bool supports(const QString &file) const;
85  QPixmap getCover(const QString &url) const;
92  QString getCoverPath(const QString &url) const;
100  QString findCoverFile(const QString &fileName) const;
104  void clearCoverCache();
108  void prepareForAnotherThread();
112  static MetaDataManager* instance();
113 
114 private:
115  MetaDataManager();
116  ~MetaDataManager();
117 
118  static void destroy();
119 
121  {
122  QString url;
123  QString coverPath;
124  QPixmap coverPixmap;
125  };
126 
127  QFileInfoList findCoverFiles(QDir dir, int depth) const;
128  CoverCacheItem *createCoverCacheItem(const QString &url) const;
129  mutable QList<CoverCacheItem *> m_cover_cache;
130  QmmpSettings *m_settings = nullptr;
131  mutable QMutex m_mutex;
132 
134 
135 };
136 
137 #endif
Transport plugin interface.
The QmmpSettings class provides access to global settings.
Definition: qmmpsettings.h:35
static MetaDataManager * m_instance
The MetaDataModel is the base interface class of metadata access.
Definition: metadatamodel.h:78
The MetaDataManager class is the base class for metadata access.
Input plugin interface (decoder factory).
QList< CoverCacheItem * > m_cover_cache
#define QMMP_EXPORT
Definition: qmmp_export.h:29
Engine plugin interface.
Definition: enginefactory.h:51