medialibrary.h
1 #ifndef MEDIALIBRARY_H
2 #define MEDIALIBRARY_H
3 
4 #include <QObject>
5 #include <QQmlListProperty>
6 #include <QVariant>
7 #include <taglib/taglib.h>
8 #include <taglib/tag.h>
9 #include <taglib/fileref.h>
10 #include <taglib/taglib_config.h>
11 #include <taglib/tpropertymap.h>
12 
13 #include "mediascanner.h"
14 #include "mediadb.h"
15 class MediaLibrary : public QObject
16 {
17  Q_OBJECT
18  Q_PROPERTY(QVariantMap audioFolders READ audioFolders CONSTANT)
19  Q_PROPERTY(QVariantMap playlists READ playlists CONSTANT)
20 public:
21  explicit MediaLibrary(QObject *parent = 0);
22  const QVariantMap audioFolders();
23  const QVariantMap playlists();
24  Q_INVOKABLE QVariantMap audioFolderContent(int folder_id);
25  Q_INVOKABLE QVariantMap videoFolderContent(int folder_id);
26  Q_INVOKABLE QVariantMap albumContent(QString album);
27  Q_INVOKABLE QVariantMap getAlbums();
28  Q_INVOKABLE QVariantMap getArtists();
29  Q_INVOKABLE QVariantMap getGenres();
30  Q_INVOKABLE QVariantMap getSongs();
31  Q_INVOKABLE QVariantMap getAlbumContent(QString key);
32  Q_INVOKABLE QVariantMap getArtistContent(QString key);
33  Q_INVOKABLE QVariantMap getGenreContent(QString key);
34  Q_INVOKABLE QVariantMap getPlaylistContent(QString key);
35  Q_INVOKABLE QVariantMap getSongContent(QString key);
36  Q_INVOKABLE QVariantList getPlaylistContent(QString path, QString name);
37 private:
38  MediaScanner *mediaScanner;
39  QVariantMap p_audioFolders;
40  QVariantMap p_playlists;
41  QVariantMap getPlaylists();
42 };
43 
44 #endif // MEDIALIBRARY_H
Definition: medialibrary.h:15
Definition: mediascanner.h:20