1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
|
/*
* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __TIZEN_MEDIA_GROUP_H__
#define __TIZEN_MEDIA_GROUP_H__
#include <media_content_type.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @addtogroup CAPI_CONTENT_MEDIA_ALBUM_MODULE
* @{
*/
/**
* @brief Gets the number of album for the passed @a filter from the media database.
*
* @param[in] filter The handle to media filter.
* @param[out] album_count The count of media album
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
* @pre This function requires opened connection to content service by media_content_connect().
* @see media_content_connect()
*
*/
int media_album_get_album_count_from_db(filter_h filter, int *album_count);
/**
* @brief Iterates through the media album with optional @a filter from the media database.
* @details This function gets all media album handles meeting the given filter.
* The callback function will be invoked for every retrieved media album.
* If NULL is passed to the filter, no filtering is applied.
*
* @param [in] filter The handle to media filter
* @param [in] callback The callback function to invoke
* @param [in] user_data The user data to be passed to the callback function
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @pre This function requires opened connection to content service by media_content_connect().
* @post This function invokes media_album_cb().
* @see #media_album_cb
* @see media_content_connect()
* @see media_filter_create()
*
*/
int media_album_foreach_album_from_db(filter_h filter, media_album_cb callback, void *user_data);
/**
* @brief Gets number of media info for the given album present in the media database.
*
* @param [in] album_id The ID of media album
* @param [in] filter The handle to media filter
* @param [out] media_count A count of album
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @pre This function requires opened connection to content service by media_content_connect().
* @see media_content_connect()
*/
int media_album_get_media_count_from_db (int album_id, filter_h filter, int *media_count);
/**
* @brief Iterates through the media files with optional @a filter in the given @a media @a album from the media database.
* @details This function gets all media files associated with the given media album and
* meeting desired filter option and calls registered callback function for
* every retrieved media info. If NULL is passed to the @a filter, no filtering is applied.
*
* @param [in] album_id The ID of media album
* @param [in] filter The handle to media filter
* @param [in] callback The callback function to invoke
* @param [in] user_data The user data to be passed to the callback function
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @pre This function requires opened connection to content service by media_content_connect().
* @post This function invokes media_info_cb().
* @see #media_info_cb
* @see media_content_connect()
* @see media_filter_create()
*/
int media_album_foreach_media_from_db(int album_id, filter_h filter, media_info_cb callback, void *user_data);
/**
* @brief Destroys album handle.
* @details Function frees all resources related to album handle. This handle
* no longer can be used to perform any operation. A new handle has to
* be created before the next use.
*
* @param [in] album The handle to media album
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @pre Get copy of album handle by calling media_album_clone()
* @see media_album_clone()
*/
int media_album_destroy(media_album_h album);
/**
* @brief Clones media album.
* @details This function copies the media album handle from a source to
* destination. There is no media_album_create() function. The media_album_h is created internally and available through
* media album foreach function such as media_album_foreach_album_from_db(). To use this handle outside of these foreach functions,
* use this function.
*
* @remark The destination handle must be released with media_album_destroy() by you.
*
* @param [in] src The source handle to media album
* @param [out] dst A destination handle to media album
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @see media_album_destroy()
* @see media_album_foreach_album_from_db()
*/
int media_album_clone(media_album_h *dst, media_album_h src);
/**
* @brief Gets a ID of the album.
*
* @param [in] album The handle to media album
* @param [out] album_id A ID of media album
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @see media_album_foreach_album_from_db()
*
*/
int media_album_get_album_id(media_album_h album, int *album_id);
/**
* @brief Gets a name of the album.
*
* @remarks @a album_name must be released with free() by you.
*
* @param [in] album The handle to media album
* @param [out] album_name A name of media album handle
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
*
*/
int media_album_get_name(media_album_h album, char **album_name);
/**
* @brief Gets a name of the artist from album.
*
* @remarks @a artist must be released with free() by you.
*
* @param [in] album The handle to media album
* @param [out] artist A name of media artist
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
*
*/
int media_album_get_artist(media_album_h album, char **artist);
/**
* @brief Gets a album art path from album.
*
* @remarks @a album_art must be released with free() by you.
*
* @param [in] album The handle to media album
* @param [out] album_art A path of media album_art
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
*
*/
int media_album_get_album_art(media_album_h album, char **album_art);
/**
* @brief Gets the media album from the media database.
*
* @details This function creates a new media album handle from the media database by the given album_id.
* media album will be created, which is filled with album information.
*
* @remarks @a folder must be released with media_album_destroy() by you.
*
* @param[in] album_id The ID of media album
* @param[out] album The album handle associated with the album ID
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @pre This function requires opened connection to content service by media_content_connect().
* @see media_content_connect()
* @see media_album_destroy()
*
*/
int media_album_get_album_from_db(int album_id, media_album_h *album);
/**
* @}
*/
/**
* @addtogroup CAPI_CONTENT_MEDIA_GROUP_MODULE
* @{
*/
/**
* @brief Gets the number of group for the passed @a filter from the media database.
*
* @param[in] filter The handle to media filter
* @param [in] group The type of media group
* @param[out] group_count The count of media group
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
* @pre This function requires opened connection to content service by media_content_connect().
* @see media_content_connect()
*
*/
int media_group_get_group_count_from_db(filter_h filter, media_group_e group, int *group_count);
/**
* @brief Iterates through the media group with optional @a filter from the media database.
* @details This function gets the names of media group meeting the given filter.
* The callback function will be invoked for every retrieved media group.
* If NULL is passed to the filter, no filtering is applied.
*
* @param [in] filter The handle to media filter
* @param [in] group The type of media group
* @param [in] callback The callback function to invoke
* @param [in] user_data The user data to be passed to the callback function
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @pre This function requires opened connection to content service by media_content_connect().
* @post This function invokes media_group_cb().
* @see #media_group_cb
* @see media_content_connect()
* @see media_filter_create()
*/
int media_group_foreach_group_from_db(filter_h filter, media_group_e group, media_group_cb callback, void *user_data);
/**
* @brief Gets number of media info for the given media group present in the media database.
*
* @param [in] group_name The name of media group
* @param [in] group The type of media group
* @param [in] filter The handle to media filter
* @param [out] media_count The count of media
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @pre This function requires opened connection to content service by media_content_connect().
* @see media_content_connect()
*/
int media_group_get_media_count_from_db(const char *group_name, media_group_e group, filter_h filter, int *media_count);
/**
* @brief Iterates through the media files with optional @a filter in the given @a group from the media database.
* @details This function gets all media files associated with the given group and
* meeting desired filter option and calls registered callback function for
* every retrieved media info. If NULL is passed to the @a filter, no filtering is applied.
*
* @param [in] group_name The name of media group
* @param [in] group The type of media group
* @param [in] filter The handle to media filter
* @param [in] callback The callback function to invoke
* @param [in] user_data The user data to be passed to the callback function
* @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @pre This function requires opened connection to content service by media_content_connect().
* @post This function invokes media_info_cb().
* @see #media_info_cb
* @see media_content_connect()
* @see media_filter_create()
*/
int media_group_foreach_media_from_db(const char *group_name, media_group_e group, filter_h filter, media_info_cb callback, void *user_data);
/**
* @}
*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __TIZEN_MEDIA_GROUP_H__ */
|