Changeset View
Changeset View
Standalone View
Standalone View
src/modeldataloader.h
Show All 23 Lines | |||||
24 | #include "databaseinterface.h" | 24 | #include "databaseinterface.h" | ||
25 | #include "models/datamodel.h" | 25 | #include "models/datamodel.h" | ||
26 | 26 | | |||
27 | #include <QObject> | 27 | #include <QObject> | ||
28 | 28 | | |||
29 | #include <memory> | 29 | #include <memory> | ||
30 | 30 | | |||
31 | class ModelDataLoaderPrivate; | 31 | class ModelDataLoaderPrivate; | ||
32 | class UpnpSsdpEngine; | ||||
33 | class UpnpDiscoverAllMusic; | ||||
32 | 34 | | |||
33 | class ELISALIB_EXPORT ModelDataLoader : public QObject | 35 | class ELISALIB_EXPORT ModelDataLoader : public QObject | ||
34 | { | 36 | { | ||
35 | 37 | | |||
36 | Q_OBJECT | 38 | Q_OBJECT | ||
37 | 39 | | |||
38 | public: | 40 | public: | ||
39 | 41 | | |||
40 | using ListAlbumDataType = DatabaseInterface::ListAlbumDataType; | 42 | using ListAlbumDataType = DatabaseInterface::ListAlbumDataType; | ||
41 | using ListArtistDataType = DatabaseInterface::ListArtistDataType; | 43 | using ListArtistDataType = DatabaseInterface::ListArtistDataType; | ||
42 | using ListGenreDataType = DatabaseInterface::ListGenreDataType; | 44 | using ListGenreDataType = DatabaseInterface::ListGenreDataType; | ||
43 | using ListTrackDataType = DatabaseInterface::ListTrackDataType; | 45 | using ListTrackDataType = DatabaseInterface::ListTrackDataType; | ||
44 | using ListRadioDataType = DatabaseInterface::ListRadioDataType; | 46 | using ListRadioDataType = DatabaseInterface::ListRadioDataType; | ||
47 | using ListNetworkServiceDataType = DatabaseInterface::ListNetworkServiceDataType; | ||||
45 | using TrackDataType = DatabaseInterface::TrackDataType; | 48 | using TrackDataType = DatabaseInterface::TrackDataType; | ||
46 | using AlbumDataType = DatabaseInterface::AlbumDataType; | 49 | using AlbumDataType = DatabaseInterface::AlbumDataType; | ||
50 | using NetworkServiceDataType = DatabaseInterface::NetworkServiceDataType; | ||||
47 | 51 | | |||
48 | using FilterType = ElisaUtils::FilterType; | 52 | using FilterType = ElisaUtils::FilterType; | ||
49 | 53 | | |||
50 | explicit ModelDataLoader(QObject *parent = nullptr); | 54 | explicit ModelDataLoader(QObject *parent = nullptr); | ||
51 | 55 | | |||
52 | ~ModelDataLoader() override; | 56 | ~ModelDataLoader() override; | ||
53 | 57 | | |||
54 | void setDatabase(DatabaseInterface *database); | 58 | void setDatabase(DatabaseInterface *database); | ||
55 | 59 | | |||
60 | void setSsdpDiscoveryEngine(UpnpSsdpEngine *ssdpDiscoveryEngine); | ||||
61 | | ||||
62 | void setUpnpDiscoverAllMusic(UpnpDiscoverAllMusic *discoveryEngine); | ||||
63 | | ||||
56 | Q_SIGNALS: | 64 | Q_SIGNALS: | ||
57 | 65 | | |||
58 | void allAlbumsData(const ModelDataLoader::ListAlbumDataType &allData); | 66 | void allAlbumsData(const ModelDataLoader::ListAlbumDataType &allData); | ||
59 | 67 | | |||
60 | void allArtistsData(const ModelDataLoader::ListArtistDataType &allData); | 68 | void allArtistsData(const ModelDataLoader::ListArtistDataType &allData); | ||
61 | 69 | | |||
62 | void allGenresData(const ModelDataLoader::ListGenreDataType &allData); | 70 | void allGenresData(const ModelDataLoader::ListGenreDataType &allData); | ||
63 | 71 | | |||
Show All 28 Lines | |||||
92 | void albumModified(const ModelDataLoader::AlbumDataType &modifiedAlbum); | 100 | void albumModified(const ModelDataLoader::AlbumDataType &modifiedAlbum); | ||
93 | 101 | | |||
94 | void saveRadioModified(const ModelDataLoader::TrackDataType trackDataType); | 102 | void saveRadioModified(const ModelDataLoader::TrackDataType trackDataType); | ||
95 | 103 | | |||
96 | void removeRadio(qulonglong radioId); | 104 | void removeRadio(qulonglong radioId); | ||
97 | 105 | | |||
98 | void radioRemoved(qulonglong radioId); | 106 | void radioRemoved(qulonglong radioId); | ||
99 | 107 | | |||
108 | void networkServicesAdded(const ModelDataLoader::ListNetworkServiceDataType &newData); | ||||
109 | | ||||
110 | void networkServiceRemoved(const ModelDataLoader::NetworkServiceDataType &removedService); | ||||
111 | | ||||
100 | public Q_SLOTS: | 112 | public Q_SLOTS: | ||
101 | 113 | | |||
102 | void loadData(ElisaUtils::PlayListEntryType dataType); | 114 | void loadData(ElisaUtils::PlayListEntryType dataType); | ||
103 | 115 | | |||
104 | void loadDataByAlbumId(ElisaUtils::PlayListEntryType dataType, qulonglong databaseId); | 116 | void loadDataByAlbumId(ElisaUtils::PlayListEntryType dataType, qulonglong databaseId); | ||
105 | 117 | | |||
106 | void loadDataByGenre(ElisaUtils::PlayListEntryType dataType, | 118 | void loadDataByGenre(ElisaUtils::PlayListEntryType dataType, | ||
107 | const QString &genre); | 119 | const QString &genre); | ||
Show All 13 Lines | |||||
121 | void loadRecentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | 133 | void loadRecentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | ||
122 | 134 | | |||
123 | void loadFrequentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | 135 | void loadFrequentlyPlayedData(ElisaUtils::PlayListEntryType dataType); | ||
124 | 136 | | |||
125 | void updateRadioData(ModelDataLoader::TrackDataType trackDataType); | 137 | void updateRadioData(ModelDataLoader::TrackDataType trackDataType); | ||
126 | 138 | | |||
127 | void deleteRadioData(qulonglong radioId); | 139 | void deleteRadioData(qulonglong radioId); | ||
128 | 140 | | |||
141 | void newUpnpContentDirectoryService(const QString &name); | ||||
142 | | ||||
143 | void removedUpnpContentDirectoryService(const QString &name); | ||||
144 | | ||||
129 | private: | 145 | private: | ||
130 | 146 | | |||
131 | void databaseTracksAdded(const ListTrackDataType &newData); | 147 | void databaseTracksAdded(const ListTrackDataType &newData); | ||
132 | 148 | | |||
133 | void databaseTrackModified(const TrackDataType &modifiedTrack); | 149 | void databaseTrackModified(const TrackDataType &modifiedTrack); | ||
134 | 150 | | |||
135 | void databaseTrackRemoved(qulonglong removedTrackId); | 151 | void databaseTrackRemoved(qulonglong removedTrackId); | ||
136 | 152 | | |||
Show All 25 Lines |