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