* limitations under the License.
*/
-#ifndef __TIZEN_MEDIA_PLAYLIST_H__
-#define __TIZEN_MEDIA_PLAYLIST_H__
+#ifndef __TIZEN_CONTENT_MEDIA_PLAYLIST_H__
+#define __TIZEN_CONTENT_MEDIA_PLAYLIST_H__
#include <media_content_type.h>
/**
* @brief Gets the number of playlists for the passed @a filter from the media database.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] filter The handle to the filter
+ * @param[in] filter The handle to the media filter
* @param[out] playlist_count The count of the media playlist
*
* @return @c 0 on success,
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
*
* @pre This function requires opened connection to content service by media_content_connect().
*
* The callback function will be invoked for every retrieved media playlist.
* If @c NULL is passed to the filter, no filtering is applied.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] filter The handle to the audio filter
- * @param[in] callback The callback function to be invoked
+ * @param[in] filter The handle to the media filter
+ * @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
*
* @return @c 0 on success,
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
*
* @pre This function requires opened connection to content service by media_content_connect().
* @post This function invokes media_playlist_cb().
/**
* @brief Gets the number of the media info for the given playlist present in the media database.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist_id The ID of the media playlist
- * @param[in] filter The media filter handle
- * @param[out] media_count The number of media items
+ * @param[in] playlist_id The ID of the media playlist
+ * @param[in] filter The handle to the media filter
+ * @param[out] media_count The number of media items
*
* @return @c 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_PERMISSION_DENIED Permission denied
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
*
* @pre This function requires opened connection to content service by media_content_connect().
*
/**
* @brief Iterates through the media files with an optional @a filter in the given audio playlist from the media database.
* @details This function gets all media files associated with the given media playlist and
- * meeting desired filter option and calls registered callback function for
+ * meeting desired filter option and calls @a callback for
* every retrieved media info. If @c NULL is passed to the @a filter, no filtering is applied.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[in] playlist_id The ID of the media playlist
- * @param[in] filter The audio filter handle
- * @param[in] callback The callback function to be invoked
- * @param[in] user_data The user data to be passed to the callback function
+ * @param[in] filter The handle to the media filter
+ * @param[in] callback The callback function to be invoked
+ * @param[in] user_data The user data to be passed to the callback function
*
* @return @c 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
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
*
* @pre This function requires opened connection to content service by media_content_connect().
* @post This function invokes media_info_cb().
/**
* @brief Inserts a new playlist with the given name into the media database.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @privlevel public
* @privilege %http://tizen.org/privilege/content.write
*
- * @remarks You must release the created handle using media_playlist_destroy().
+ * @remarks The @a playlist should be released using media_playlist_destroy().
*
- * @param[in] name The name of the inserted playlist
- * @param[out] playlist A created handle to media playlist
+ * @param[in] name The name of the inserted playlist
+ * @param[out] playlist The handle to the media playlist
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Deletes the given playlist from the media database.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @privlevel public
* @privilege %http://tizen.org/privilege/content.write
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
* @pre This function requires opened connection to content service by media_content_connect().
* @details This function creates a new media playlist handle from the media database by the given @a playlist_id.
* The media playlist will be created and will be filled with the playlist information.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @remarks You must release @a playlist using media_playlist_destroy().
+ * @remarks The @a playlist should be released using media_playlist_destroy().
*
- * @param[in] playlist_id The ID of the media playlist
- * @param[out] playlist The media playlist handle associated with the playlist ID
+ * @param[in] playlist_id The ID of the media playlist
+ * @param[out] playlist The handle to the media playlist
*
* @return @c 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_PERMISSION_DENIED Permission denied
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
*
* @pre This function requires opened connection to content service by media_content_connect().
*
/**
* @brief Destroys a playlist handle.
* @details This function frees all resources related to the playlist handle. This
- * handle no longer can be used to perform any operation. A new handle has to
+ * handle no longer can be used to perform any operations. A new handle has to
* be created before next usage.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist The media playlist handle
+ * @param[in] playlist The handle to the media playlist
*
* @return @c 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_PERMISSION_DENIED Permission denied
*
* @pre Get a copy of playlist handle by calling media_playlist_clone() or media_playlist_insert_to_db().
*
* media playlist foreach function such as media_playlist_foreach_playlist_from_db().
* To use this handle outside of these foreach functions, use this function.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @remarks The destination handle must be released using media_playlist_destroy().
+ * @remarks The @a dst should be released using media_playlist_destroy().
*
- * @param[in] src The source handle of a media playlist
- * @param[out] dst The destination handle to a media playlist
+ * @param[out] dst The destination handle to the media playlist
+ * @param[in] src The source handle to the media playlist
*
* @return @c 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
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
* @see media_playlist_destroy()
* @see media_playlist_foreach_playlist_from_db()
/**
* @brief Gets the media playlist ID.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist The media playlist handle
+ * @param[in] playlist The handle to the media playlist
* @param[out] playlist_id The ID of the media playlist
*
* @return @c 0 on success,
*
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_playlist_get_playlist_id(media_playlist_h playlist, int *playlist_id);
/**
* @brief Gets a name of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @remarks You must release @a playlist_name using free().
+ * @remarks The @a playlist_name should be released using free().
*
- * @param[in] playlist The media playlist handle
+ * @param[in] playlist The handle to the media playlist
* @param[out] playlist_name The playlist name
*
* @return @c 0 on success,
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_playlist_get_name(media_playlist_h playlist, char **playlist_name);
/**
* @brief Sets the name of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist The media playlist handle
+ * @param[in] playlist The handle to the media playlist
* @param[in] playlist_name The name of the media playlist
*
* @return @c 0 on success,
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
* @post media_playlist_update_to_db()
*
/**
* @brief Gets a thumbnail path of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @remarks You must release @a path using free().
+ * @remarks The @a path should be released using free().
*
- * @param[in] playlist The media playlist handle
- * @param[out] path The path of the thumbnail
+ * @param[in] playlist The handle to the media playlist
+ * @param[out] path The path of the thumbnail
*
* @return @c 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
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_playlist_get_thumbnail_path(media_playlist_h playlist, char **path);
/**
* @brief Sets the thumbnail path of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist The media playlist handle
- * @param[in] path The path of the thumbnail
+ * @param[in] playlist The handle to the media playlist
+ * @param[in] path The path of the thumbnail
*
* @return @c 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
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
* @post media_playlist_update_to_db()
*/
/**
* @brief Sets the playing order in the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist The media playlist handle
- * @param[in] playlist_member_id The playlist member ID
- * @param[in] play_order The playing order
+ * @param[in] playlist The handle to the media playlist
+ * @param[in] playlist_member_id The ID of the playlist member
+ * @param[in] play_order The playing order
*
* @return @c 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
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
* @post media_playlist_update_to_db()
*/
/**
* @brief Adds a new media info to the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist The media playlist handle
- * @param[in] media_id The ID to the media info which is added
+ * @param[in] playlist The handle to the media playlist
+ * @param[in] media_id The media ID
*
* @return @c 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
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
* @pre This function requires opened connection to content service by media_content_connect().
* @post media_playlist_update_to_db()
/**
* @brief Removes the playlist members related with the media from the given playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist The media playlist handle
- * @param[in] playlist_member_id The playlist member ID
+ * @param[in] playlist The handle to the media playlist
+ * @param[in] playlist_member_id The ID of the playlist member
*
* @return @c 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
- * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
* @pre This function requires opened connection to content service by media_content_connect().
* @post media_playlist_update_to_db()
/**
* @brief Gets the played order of the playlist.
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
- * @param[in] playlist The media playlist handle
- * @param[in] playlist_member_id The playlist member ID
- * @param[out] play_order The played order
+ * @param[in] playlist The handle to the media playlist
+ * @param[in] playlist_member_id The ID of the playlist member
+ * @param[out] play_order The played order
*
* @return @c 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_PERMISSION_DENIED Permission denied
*/
int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member_id, int *play_order);
* media_playlist_update_to_db() function should be called so as to update
* the given playlist attributes in the media database.
*
- * @since_tizen 2.3
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @privlevel public
* @privilege %http://tizen.org/privilege/content.write
*
- * @param[in] playlist The media playlist handle
+ * @param[in] playlist The handle to the media playlist
*
* @return @c 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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
* @pre This function requires opened connection to content service by media_content_connect().
int media_playlist_update_to_db(media_playlist_h playlist);
/**
+ * @brief Imports the playlist from m3u playlist file.
+ * @details This function reads a playlist from the m3u playlist file and insert into the db.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks The @a playlist should be released using media_playlist_destroy().
+ * @remarks %http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
+ * %http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
+ * This function does not support the file of extended m3u playlist.
+ *
+ * @param[in] playlist_name The name of the media playlist to save
+ * @param[in] path The path to import the playlist file
+ * @param[out] playlist The handle to the media playlist
+ *
+ * @return @c 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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_playlist_import_from_file(const char *playlist_name, const char *path, media_playlist_h *playlist);
+
+/**
+ * @brief Exports the playlist to m3u playlist file.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks %http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
+ * %http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage.
+ *
+ * @param[in] playlist The handle to the media playlist
+ * @param[in] path path The path to export the playlist
+ *
+ * @return @c 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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_playlist_export_to_file(media_playlist_h playlist, const char* path);
+
+/**
* @}
*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
-#endif /*__TIZEN_MEDIA_PLAYLIST_H__*/
+#endif /*__TIZEN_CONTENT_MEDIA_PLAYLIST_H__*/