Changeset View
Changeset View
Standalone View
Standalone View
src/musiclistenersmanager.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 38 | { | |||
---|---|---|---|---|---|
42 | Q_PROPERTY(DatabaseInterface* viewDatabase | 42 | Q_PROPERTY(DatabaseInterface* viewDatabase | ||
43 | READ viewDatabase | 43 | READ viewDatabase | ||
44 | NOTIFY viewDatabaseChanged) | 44 | NOTIFY viewDatabaseChanged) | ||
45 | 45 | | |||
46 | Q_PROPERTY(int importedTracksCount | 46 | Q_PROPERTY(int importedTracksCount | ||
47 | READ importedTracksCount | 47 | READ importedTracksCount | ||
48 | NOTIFY importedTracksCountChanged) | 48 | NOTIFY importedTracksCountChanged) | ||
49 | 49 | | |||
50 | Q_PROPERTY(bool indexingRunning | | |||
51 | READ isIndexingRunning | | |||
52 | NOTIFY indexingRunningChanged) | | |||
53 | | ||||
54 | Q_PROPERTY(ElisaApplication* elisaApplication | 50 | Q_PROPERTY(ElisaApplication* elisaApplication | ||
55 | READ elisaApplication | 51 | READ elisaApplication | ||
56 | WRITE setElisaApplication | 52 | WRITE setElisaApplication | ||
57 | NOTIFY elisaApplicationChanged) | 53 | NOTIFY elisaApplicationChanged) | ||
58 | 54 | | |||
59 | Q_PROPERTY(bool indexerBusy | 55 | Q_PROPERTY(bool indexerBusy | ||
60 | READ indexerBusy | 56 | READ indexerBusy | ||
61 | NOTIFY indexerBusyChanged) | 57 | NOTIFY indexerBusyChanged) | ||
62 | 58 | | |||
59 | Q_PROPERTY(bool fileSystemIndexerActive | ||||
60 | READ fileSystemIndexerActive | ||||
61 | NOTIFY fileSystemIndexerActiveChanged) | ||||
62 | | ||||
63 | Q_PROPERTY(bool balooIndexerActive | ||||
64 | READ balooIndexerActive | ||||
65 | NOTIFY balooIndexerActiveChanged) | ||||
66 | | ||||
67 | Q_PROPERTY(bool balooIndexerAvailable | ||||
68 | READ balooIndexerAvailable | ||||
69 | NOTIFY balooIndexerAvailableChanged) | ||||
70 | | ||||
71 | Q_PROPERTY(bool androidIndexerActive | ||||
72 | READ androidIndexerActive | ||||
73 | NOTIFY androidIndexerActiveChanged) | ||||
74 | | ||||
75 | Q_PROPERTY(bool androidIndexerAvailable | ||||
76 | READ androidIndexerAvailable | ||||
77 | NOTIFY androidIndexerAvailableChanged) | ||||
78 | | ||||
63 | public: | 79 | public: | ||
64 | 80 | | |||
65 | explicit MusicListenersManager(QObject *parent = nullptr); | 81 | explicit MusicListenersManager(QObject *parent = nullptr); | ||
66 | 82 | | |||
67 | ~MusicListenersManager() override; | 83 | ~MusicListenersManager() override; | ||
68 | 84 | | |||
69 | DatabaseInterface* viewDatabase() const; | 85 | DatabaseInterface* viewDatabase() const; | ||
70 | 86 | | |||
71 | void subscribeForTracks(MediaPlayList *client); | 87 | void subscribeForTracks(MediaPlayList *client); | ||
72 | 88 | | |||
73 | int importedTracksCount() const; | 89 | int importedTracksCount() const; | ||
74 | 90 | | |||
75 | bool isIndexingRunning() const; | | |||
76 | | ||||
77 | ElisaApplication* elisaApplication() const; | 91 | ElisaApplication* elisaApplication() const; | ||
78 | 92 | | |||
79 | bool indexerBusy() const; | 93 | bool indexerBusy() const; | ||
80 | 94 | | |||
95 | bool fileSystemIndexerActive() const; | ||||
96 | | ||||
97 | bool balooIndexerActive() const; | ||||
98 | | ||||
99 | bool balooIndexerAvailable() const; | ||||
100 | | ||||
101 | bool androidIndexerActive() const; | ||||
102 | | ||||
103 | bool androidIndexerAvailable() const; | ||||
104 | | ||||
81 | Q_SIGNALS: | 105 | Q_SIGNALS: | ||
82 | 106 | | |||
83 | void viewDatabaseChanged(); | 107 | void viewDatabaseChanged(); | ||
84 | 108 | | |||
85 | void applicationIsTerminating(); | 109 | void applicationIsTerminating(); | ||
86 | 110 | | |||
87 | void importedTracksCountChanged(); | 111 | void importedTracksCountChanged(); | ||
88 | 112 | | |||
89 | void indexingRunningChanged(); | | |||
90 | | ||||
91 | void newNotification(NotificationItem notification); | 113 | void newNotification(NotificationItem notification); | ||
92 | 114 | | |||
93 | void closeNotification(QString notificationId); | 115 | void closeNotification(QString notificationId); | ||
94 | 116 | | |||
95 | void elisaApplicationChanged(); | 117 | void elisaApplicationChanged(); | ||
96 | 118 | | |||
97 | void removeTracksInError(QList<QUrl> tracks); | 119 | void removeTracksInError(QList<QUrl> tracks); | ||
98 | 120 | | |||
99 | void displayTrackError(const QString &fileName); | 121 | void displayTrackError(const QString &fileName); | ||
100 | 122 | | |||
101 | void indexerBusyChanged(); | 123 | void indexerBusyChanged(); | ||
102 | 124 | | |||
103 | void clearDatabase(); | 125 | void clearDatabase(); | ||
104 | 126 | | |||
127 | void fileSystemIndexerActiveChanged(); | ||||
128 | | ||||
129 | void balooIndexerActiveChanged(); | ||||
130 | | ||||
131 | void balooIndexerAvailableChanged(); | ||||
132 | | ||||
133 | void androidIndexerActiveChanged(); | ||||
134 | | ||||
135 | void androidIndexerAvailableChanged(); | ||||
136 | | ||||
105 | public Q_SLOTS: | 137 | public Q_SLOTS: | ||
106 | 138 | | |||
107 | void databaseReady(); | 139 | void databaseReady(); | ||
108 | 140 | | |||
109 | void applicationAboutToQuit(); | 141 | void applicationAboutToQuit(); | ||
110 | 142 | | |||
111 | void showConfiguration(); | 143 | void showConfiguration(); | ||
112 | 144 | | |||
Show All 14 Lines | 153 | private Q_SLOTS: | |||
127 | void decreaseImportedTracksCount(); | 159 | void decreaseImportedTracksCount(); | ||
128 | 160 | | |||
129 | void monitorStartingListeners(); | 161 | void monitorStartingListeners(); | ||
130 | 162 | | |||
131 | void monitorEndingListeners(); | 163 | void monitorEndingListeners(); | ||
132 | 164 | | |||
133 | void cleanedDatabase(); | 165 | void cleanedDatabase(); | ||
134 | 166 | | |||
167 | void balooAvailabilityChanged(); | ||||
168 | | ||||
135 | private: | 169 | private: | ||
136 | 170 | | |||
171 | void testBalooIndexerAvailability(); | ||||
172 | | ||||
173 | void startLocalFileSystemIndexing(); | ||||
174 | | ||||
175 | void startBalooIndexing(); | ||||
176 | | ||||
137 | std::unique_ptr<MusicListenersManagerPrivate> d; | 177 | std::unique_ptr<MusicListenersManagerPrivate> d; | ||
138 | 178 | | |||
139 | void createTracksListener(); | 179 | void createTracksListener(); | ||
140 | 180 | | |||
141 | }; | 181 | }; | ||
142 | 182 | | |||
143 | #endif // MUSICLISTENERSMANAGER_H | 183 | #endif // MUSICLISTENERSMANAGER_H |