Changeset View
Changeset View
Standalone View
Standalone View
src/manageheaderbar.h
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 54 | Q_PROPERTY(int albumRole | |||
---|---|---|---|---|---|
56 | WRITE setAlbumRole | 56 | WRITE setAlbumRole | ||
57 | NOTIFY albumRoleChanged) | 57 | NOTIFY albumRoleChanged) | ||
58 | 58 | | |||
59 | Q_PROPERTY(int albumArtistRole | 59 | Q_PROPERTY(int albumArtistRole | ||
60 | READ albumArtistRole | 60 | READ albumArtistRole | ||
61 | WRITE setAlbumArtistRole | 61 | WRITE setAlbumArtistRole | ||
62 | NOTIFY albumArtistRoleChanged) | 62 | NOTIFY albumArtistRoleChanged) | ||
63 | 63 | | |||
64 | Q_PROPERTY(int fileNameRole | ||||
65 | READ fileNameRole | ||||
66 | WRITE setFileNameRole | ||||
67 | NOTIFY fileNameRoleChanged) | ||||
68 | | ||||
64 | Q_PROPERTY(int imageRole | 69 | Q_PROPERTY(int imageRole | ||
65 | READ imageRole | 70 | READ imageRole | ||
66 | WRITE setImageRole | 71 | WRITE setImageRole | ||
67 | NOTIFY imageRoleChanged) | 72 | NOTIFY imageRoleChanged) | ||
68 | 73 | | |||
74 | Q_PROPERTY(int databaseIdRole | ||||
75 | READ databaseIdRole | ||||
76 | WRITE setDatabaseIdRole | ||||
77 | NOTIFY databaseIdRoleChanged) | ||||
78 | | ||||
69 | Q_PROPERTY(int albumIdRole | 79 | Q_PROPERTY(int albumIdRole | ||
70 | READ albumIdRole | 80 | READ albumIdRole | ||
71 | WRITE setAlbumIdRole | 81 | WRITE setAlbumIdRole | ||
72 | NOTIFY albumIdRoleChanged) | 82 | NOTIFY albumIdRoleChanged) | ||
73 | 83 | | |||
74 | Q_PROPERTY(int isValidRole | 84 | Q_PROPERTY(int isValidRole | ||
75 | READ isValidRole | 85 | READ isValidRole | ||
76 | WRITE setIsValidRole | 86 | WRITE setIsValidRole | ||
Show All 10 Lines | |||||
87 | Q_PROPERTY(QVariant album | 97 | Q_PROPERTY(QVariant album | ||
88 | READ album | 98 | READ album | ||
89 | NOTIFY albumChanged) | 99 | NOTIFY albumChanged) | ||
90 | 100 | | |||
91 | Q_PROPERTY(QVariant albumArtist | 101 | Q_PROPERTY(QVariant albumArtist | ||
92 | READ albumArtist | 102 | READ albumArtist | ||
93 | NOTIFY albumArtistChanged) | 103 | NOTIFY albumArtistChanged) | ||
94 | 104 | | |||
105 | Q_PROPERTY(QString fileName | ||||
106 | READ fileName | ||||
107 | NOTIFY fileNameChanged) | ||||
108 | | ||||
95 | Q_PROPERTY(QUrl image | 109 | Q_PROPERTY(QUrl image | ||
96 | READ image | 110 | READ image | ||
97 | NOTIFY imageChanged) | 111 | NOTIFY imageChanged) | ||
98 | 112 | | |||
113 | Q_PROPERTY(qulonglong databaseId | ||||
114 | READ databaseId | ||||
115 | NOTIFY databaseIdChanged) | ||||
116 | | ||||
99 | Q_PROPERTY(qulonglong albumId | 117 | Q_PROPERTY(qulonglong albumId | ||
100 | READ albumId | 118 | READ albumId | ||
101 | NOTIFY albumIdChanged) | 119 | NOTIFY albumIdChanged) | ||
102 | 120 | | |||
103 | Q_PROPERTY(bool isValid | 121 | Q_PROPERTY(bool isValid | ||
104 | READ isValid | 122 | READ isValid | ||
105 | NOTIFY isValidChanged) | 123 | NOTIFY isValidChanged) | ||
106 | 124 | | |||
Show All 12 Lines | 129 | public: | |||
119 | int artistRole() const; | 137 | int artistRole() const; | ||
120 | 138 | | |||
121 | int titleRole() const; | 139 | int titleRole() const; | ||
122 | 140 | | |||
123 | int albumRole() const; | 141 | int albumRole() const; | ||
124 | 142 | | |||
125 | int albumArtistRole() const; | 143 | int albumArtistRole() const; | ||
126 | 144 | | |||
145 | int fileNameRole() const; | ||||
146 | | ||||
127 | int imageRole() const; | 147 | int imageRole() const; | ||
128 | 148 | | |||
149 | int databaseIdRole() const; | ||||
150 | | ||||
129 | int albumIdRole() const; | 151 | int albumIdRole() const; | ||
130 | 152 | | |||
131 | int isValidRole() const; | 153 | int isValidRole() const; | ||
132 | 154 | | |||
133 | QVariant artist() const; | 155 | QVariant artist() const; | ||
134 | 156 | | |||
135 | QVariant title() const; | 157 | QVariant title() const; | ||
136 | 158 | | |||
137 | QVariant album() const; | 159 | QVariant album() const; | ||
138 | 160 | | |||
139 | QVariant albumArtist() const; | 161 | QVariant albumArtist() const; | ||
140 | 162 | | |||
163 | QString fileName() const; | ||||
164 | | ||||
141 | QUrl image() const; | 165 | QUrl image() const; | ||
142 | 166 | | |||
167 | qulonglong databaseId() const; | ||||
168 | | ||||
143 | qulonglong albumId() const; | 169 | qulonglong albumId() const; | ||
144 | 170 | | |||
145 | bool isValid() const; | 171 | bool isValid() const; | ||
146 | 172 | | |||
147 | int remainingTracks() const; | 173 | int remainingTracks() const; | ||
148 | 174 | | |||
149 | Q_SIGNALS: | 175 | Q_SIGNALS: | ||
150 | 176 | | |||
151 | void currentTrackChanged(); | 177 | void currentTrackChanged(); | ||
152 | 178 | | |||
153 | void playListModelChanged(); | 179 | void playListModelChanged(); | ||
154 | 180 | | |||
155 | void artistRoleChanged(); | 181 | void artistRoleChanged(); | ||
156 | 182 | | |||
157 | void titleRoleChanged(); | 183 | void titleRoleChanged(); | ||
158 | 184 | | |||
159 | void albumRoleChanged(); | 185 | void albumRoleChanged(); | ||
160 | 186 | | |||
161 | void albumArtistRoleChanged(); | 187 | void albumArtistRoleChanged(); | ||
162 | 188 | | |||
189 | void fileNameRoleChanged(); | ||||
190 | | ||||
163 | void imageRoleChanged(); | 191 | void imageRoleChanged(); | ||
164 | 192 | | |||
193 | void databaseIdRoleChanged(); | ||||
194 | | ||||
165 | void albumIdRoleChanged(); | 195 | void albumIdRoleChanged(); | ||
166 | 196 | | |||
167 | void isValidRoleChanged(); | 197 | void isValidRoleChanged(); | ||
168 | 198 | | |||
169 | void artistChanged(); | 199 | void artistChanged(); | ||
170 | 200 | | |||
171 | void titleChanged(); | 201 | void titleChanged(); | ||
172 | 202 | | |||
173 | void albumChanged(); | 203 | void albumChanged(); | ||
174 | 204 | | |||
175 | void albumArtistChanged(); | 205 | void albumArtistChanged(); | ||
176 | 206 | | |||
207 | void fileNameChanged(); | ||||
208 | | ||||
177 | void imageChanged(); | 209 | void imageChanged(); | ||
178 | 210 | | |||
179 | void remainingTracksChanged(); | 211 | void remainingTracksChanged(); | ||
180 | 212 | | |||
213 | void databaseIdChanged(); | ||||
214 | | ||||
181 | void albumIdChanged(); | 215 | void albumIdChanged(); | ||
182 | 216 | | |||
183 | void isValidChanged(); | 217 | void isValidChanged(); | ||
184 | 218 | | |||
185 | public Q_SLOTS: | 219 | public Q_SLOTS: | ||
186 | 220 | | |||
187 | void setCurrentTrack(const QPersistentModelIndex ¤tTrack); | 221 | void setCurrentTrack(const QPersistentModelIndex ¤tTrack); | ||
188 | 222 | | |||
189 | void setPlayListModel(QAbstractItemModel* aPlayListModel); | 223 | void setPlayListModel(QAbstractItemModel* aPlayListModel); | ||
190 | 224 | | |||
191 | void setArtistRole(int value); | 225 | void setArtistRole(int value); | ||
192 | 226 | | |||
193 | void setTitleRole(int value); | 227 | void setTitleRole(int value); | ||
194 | 228 | | |||
195 | void setAlbumRole(int value); | 229 | void setAlbumRole(int value); | ||
196 | 230 | | |||
197 | void setAlbumArtistRole(int value); | 231 | void setAlbumArtistRole(int value); | ||
198 | 232 | | |||
233 | void setFileNameRole(int value); | ||||
234 | | ||||
199 | void setImageRole(int value); | 235 | void setImageRole(int value); | ||
200 | 236 | | |||
237 | void setDatabaseIdRole(int databaseIdRole); | ||||
238 | | ||||
201 | void setAlbumIdRole(int albumIdRole); | 239 | void setAlbumIdRole(int albumIdRole); | ||
202 | 240 | | |||
203 | void setIsValidRole(int isValidRole); | 241 | void setIsValidRole(int isValidRole); | ||
204 | 242 | | |||
205 | void playListLayoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint); | 243 | void playListLayoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint); | ||
206 | 244 | | |||
207 | void tracksInserted(const QModelIndex &parent, int first, int last); | 245 | void tracksInserted(const QModelIndex &parent, int first, int last); | ||
208 | 246 | | |||
Show All 10 Lines | 255 | private: | |||
219 | void notifyArtistProperty(); | 257 | void notifyArtistProperty(); | ||
220 | 258 | | |||
221 | void notifyTitleProperty(); | 259 | void notifyTitleProperty(); | ||
222 | 260 | | |||
223 | void notifyAlbumProperty(); | 261 | void notifyAlbumProperty(); | ||
224 | 262 | | |||
225 | void notifyAlbumArtistProperty(); | 263 | void notifyAlbumArtistProperty(); | ||
226 | 264 | | |||
265 | void notifyFileNameProperty(); | ||||
266 | | ||||
227 | void notifyImageProperty(); | 267 | void notifyImageProperty(); | ||
228 | 268 | | |||
269 | void notifyDatabaseIdProperty(); | ||||
270 | | ||||
229 | void notifyAlbumIdProperty(); | 271 | void notifyAlbumIdProperty(); | ||
230 | 272 | | |||
231 | void notifyIsValidProperty(); | 273 | void notifyIsValidProperty(); | ||
232 | 274 | | |||
233 | void notifyRemainingTracksProperty(); | 275 | void notifyRemainingTracksProperty(); | ||
234 | 276 | | |||
235 | QPersistentModelIndex mCurrentTrack; | 277 | QPersistentModelIndex mCurrentTrack; | ||
236 | 278 | | |||
237 | QAbstractItemModel *mPlayListModel = nullptr; | 279 | QAbstractItemModel *mPlayListModel = nullptr; | ||
238 | 280 | | |||
239 | int mArtistRole = Qt::DisplayRole; | 281 | int mArtistRole = Qt::DisplayRole; | ||
240 | 282 | | |||
241 | int mTitleRole = Qt::DisplayRole; | 283 | int mTitleRole = Qt::DisplayRole; | ||
242 | 284 | | |||
243 | int mAlbumRole = Qt::DisplayRole; | 285 | int mAlbumRole = Qt::DisplayRole; | ||
244 | 286 | | |||
245 | int mAlbumArtistRole = Qt::DisplayRole; | 287 | int mAlbumArtistRole = Qt::DisplayRole; | ||
246 | 288 | | |||
289 | int mFileNameRole = Qt::DisplayRole; | ||||
290 | | ||||
247 | int mImageRole = Qt::DisplayRole; | 291 | int mImageRole = Qt::DisplayRole; | ||
248 | 292 | | |||
293 | int mDatabaseIdRole = Qt::DisplayRole; | ||||
294 | | ||||
249 | int mAlbumIdRole = Qt::DisplayRole; | 295 | int mAlbumIdRole = Qt::DisplayRole; | ||
250 | 296 | | |||
251 | int mIsValidRole = Qt::DisplayRole; | 297 | int mIsValidRole = Qt::DisplayRole; | ||
252 | 298 | | |||
253 | QVariant mOldArtist; | 299 | QVariant mOldArtist; | ||
254 | 300 | | |||
255 | QVariant mOldTitle; | 301 | QVariant mOldTitle; | ||
256 | 302 | | |||
257 | QVariant mOldAlbum; | 303 | QVariant mOldAlbum; | ||
258 | 304 | | |||
259 | QVariant mOldAlbumArtist; | 305 | QVariant mOldAlbumArtist; | ||
260 | 306 | | |||
307 | QVariant mOldFileName; | ||||
308 | | ||||
261 | QVariant mOldImage; | 309 | QVariant mOldImage; | ||
262 | 310 | | |||
311 | qulonglong mOldDatabaseId = 0; | ||||
312 | | ||||
263 | qulonglong mOldAlbumId = 0; | 313 | qulonglong mOldAlbumId = 0; | ||
264 | 314 | | |||
265 | bool mOldIsValid = false; | 315 | bool mOldIsValid = false; | ||
266 | 316 | | |||
267 | int mOldRemainingTracks = 0; | 317 | int mOldRemainingTracks = 0; | ||
268 | 318 | | |||
269 | }; | 319 | }; | ||
270 | 320 | | |||
271 | 321 | | |||
272 | 322 | | |||
273 | #endif // MANAGEHEADERBAR_H | 323 | #endif // MANAGEHEADERBAR_H |