66 * @param tnData reference to thumbnail data where data is ocpied |
66 * @param tnData reference to thumbnail data where data is ocpied |
67 * |
67 * |
68 * @return QIcon* thumbnail pointer |
68 * @return QIcon* thumbnail pointer |
69 * |
69 * |
70 */ |
70 */ |
71 const QIcon* getThumbnail(TMPXItemId mediaId); |
71 const QIcon* getThumbnail(const TMPXItemId &mediaId); |
72 |
72 |
73 /** |
73 /** |
74 * Method removes thumbnail data from the icon cache. |
74 * Method removes thumbnail data from the icon cache. |
75 * |
75 * |
76 * @param mediaId id for media whose thumbnail is to be removed |
76 * @param mediaId id for media whose thumbnail is to be removed |
77 * |
77 * |
78 * @return bool: true if item removed correctly, false if not. |
78 * @return bool: true if item removed correctly, false if not. |
79 * |
79 * |
80 */ |
80 */ |
81 bool removeThumbnail(TMPXItemId mediaId); |
81 bool removeThumbnail(const TMPXItemId &mediaId); |
82 |
82 |
83 /** |
83 /** |
84 * Starts background thumbnail fetching from the given fetch index. |
84 * Starts background thumbnail fetching from the given fetch index. |
85 * |
85 * |
86 * @param model model of the items for the fetching. |
86 * @param model model of the items for the fetching. |
100 * that have been already generated are fetched still. |
100 * that have been already generated are fetched still. |
101 * |
101 * |
102 * @param enable true enables and false disables thumbnail creation. |
102 * @param enable true enables and false disables thumbnail creation. |
103 */ |
103 */ |
104 void enableThumbnailCreation(bool enable); |
104 void enableThumbnailCreation(bool enable); |
|
105 |
|
106 /** |
|
107 * Returns if background fetching is enabled. |
|
108 * |
|
109 * @return bool: true if background fetching is enabled, otherwise false. |
|
110 */ |
|
111 bool backgroundFetchingEnabled(); |
105 |
112 |
106 /** |
113 /** |
107 * Frees allocated data for thumbnails and cancels ongoing fetches. |
114 * Frees allocated data for thumbnails and cancels ongoing fetches. |
108 */ |
115 */ |
109 void freeThumbnailData(); |
116 void freeThumbnailData(); |
157 * @param priority priority for the fetch |
164 * @param priority priority for the fetch |
158 * |
165 * |
159 * @return int: thumbnail id or -1 if fetch starting fails. |
166 * @return int: thumbnail id or -1 if fetch starting fails. |
160 * |
167 * |
161 */ |
168 */ |
162 int startFetchingThumbnail(TMPXItemId mediaId, int priority); |
169 int startFetchingThumbnail(const TMPXItemId &mediaId, int priority); |
163 |
170 |
164 /** |
171 /** |
165 * Appends indexes in the source model to the list between start and end. |
172 * Appends indexes in the source model to the list between start and end. |
166 * |
173 * |
167 * @param indexes list of indexes |
174 * @param indexes list of indexes |
168 * @param startIndex start index |
175 * @param startIndex start index |
169 * @param endIndex end index |
176 * @param endIndex end index |
170 */ |
177 */ |
171 void getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex); |
178 void getModelIndexes(QList<QModelIndex> &indexes, int &startIndex, int &endIndex); |
172 |
179 |
173 /** |
180 /** |
174 * Method returns default thumbnail data. |
181 * Method returns default thumbnail data. |
175 * |
182 * |
176 * @param mediaId media id for which to get thumbnail |
183 * @param mediaId media id for which to get thumbnail |
177 * |
184 * |
178 * @return QIcon: reference to default thumbnail data |
185 * @return QIcon: reference to default thumbnail data |
179 * |
186 * |
180 */ |
187 */ |
181 const QIcon* defaultThumbnail(TMPXItemId mediaId); |
188 const QIcon* defaultThumbnail(const TMPXItemId &mediaId); |
182 |
189 |
183 /** |
190 /** |
184 * Loads icon from file or resource, the icon is scaled to size of the |
191 * Loads icon from file or resource, the icon is scaled to size of the |
185 * video list view thumbnail. |
192 * video list view thumbnail. |
186 * |
193 * |
202 * This signal is emitted from thumbnailReadySlot, when |
209 * This signal is emitted from thumbnailReadySlot, when |
203 * |
210 * |
204 * @param mediaIds: media ids of the videos whose thumbnail is ready. |
211 * @param mediaIds: media ids of the videos whose thumbnail is ready. |
205 * |
212 * |
206 */ |
213 */ |
207 void thumbnailsFetched(QList<TMPXItemId> mediaIds); |
214 void thumbnailsFetched(QList<TMPXItemId>& mediaIds); |
208 |
215 |
209 private slots: |
216 private slots: |
210 |
217 |
211 /** |
218 /** |
212 * Thumbnail fetcher signals this slot when thumbnail is ready |
219 * Thumbnail fetcher signals this slot when thumbnail is ready |
216 * @param mediaId: pointer to the media id used in emitted signal |
223 * @param mediaId: pointer to the media id used in emitted signal |
217 * @param error: possible error code from thumbnail manager ( 0 == ok ) |
224 * @param error: possible error code from thumbnail manager ( 0 == ok ) |
218 * |
225 * |
219 */ |
226 */ |
220 void thumbnailReadySlot(QPixmap tnData, const TMPXItemId &mediaId, int error); |
227 void thumbnailReadySlot(QPixmap tnData, const TMPXItemId &mediaId, int error); |
221 |
|
222 /** |
|
223 * VideoListDataModel signals this slot when the model has been changed. |
|
224 * |
|
225 */ |
|
226 void modelChangedSlot(); |
|
227 |
228 |
228 /** |
229 /** |
229 * Fetches thumbnails around of mCurrentFetchIndex in batches of THUMBNAIL_BACKGROUND_FETCH_AMOUNT. |
230 * Fetches thumbnails around of mCurrentFetchIndex in batches of THUMBNAIL_BACKGROUND_FETCH_AMOUNT. |
230 * The fetch index is set by startFetchingThumbnails which also resets |
231 * The fetch index is set by startFetchingThumbnails which also resets |
231 * mCurrentBackgroundFetchCount. Maximum of THUMBNAIL_MAX_BACKGROUND_FETCH thumbnails are |
232 * mCurrentBackgroundFetchCount. Maximum of THUMBNAIL_MAX_BACKGROUND_FETCH thumbnails are |