* @brief Called when updating the playlist of the media controller server.
* @since_tizen 5.0
*
- * @remarks The callback is called in the dbus event loop. @a data is a bundle. A bundle is a set of key-value pairs. "item id" is the key and "item metadata" is the value.
+ * @remarks The callback is called in the dbus event loop. @a data is a bundle. A bundle is a set of key-value pairs. "index" is the key and "media metadata" is the value.
*
* @param[in] server_name The app_id of the media controller server which sent the notification. It can be used only in the callback. To use outside, make a copy.
* @param[in] mode The playlist update mode of the updated media controller server
* @param[in] playlist_name Updated playlist name. It can be used only in the callback. To use outside, make a copy.
- * @param[in] data The playlist of the media controller server. When the playlist has been removed or it has no items after the change, @a data is NULL. It can be used only in the callback. To use outside, make a copy using @c bundle_dup().
+ * @param[in] data The playlist of the media controller server. When the playlist has been removed or it has no media after the change, @a data is NULL. It can be used only in the callback. To use outside, make a copy using @c bundle_dup().
* @param[in] user_data The user data passed from the mc_client_set_playlist_update_cb() function
*
* @pre mc_client_set_playlist_update_cb()
* @privilege %http://tizen.org/privilege/mediacontroller.client
*
* @remarks The @a playlist_name should be released using free(). \n
- * @a playlist is a bundle. A bundle is a set of key-value pairs. "item id" is the key and "item metadata" is the value. \n
+ * @a playlist is a bundle. A bundle is a set of key-value pairs. "index" is the key and "media metadata" is the value. \n
* And also the @a playlist should be released using @c bundle_free(). \n
* If there is no playlist, return value of @a playlist_name and @a playlist is NULL.
*
/**
* @brief Sends the playlist command to server.
- * @details The media controller client can send "item id" of the playlist to the media controller server with playback action and position.
+ * @details The media controller client can send "index" of the playlist to the media controller server with playback action and position.
* @since_tizen 5.0
*
* @privlevel public
* @param[in] client The handle to the media controller client
* @param[in] server_name The app_id of the media controller server
* @param[in] playlist_name The playlist name of the server
- * @param[in] media_id The ID of the media in playlist to send to the media controller server
+ * @param[in] index The index of the media in playlist to send to the media controller server
* @param[in] action The playback action command to send to the media controller server
* @param[in] position The position of the playback in milliseconds to send to media controller server
* @return @c 0 on success,
* @pre Create a media controller client handle by calling mc_client_create().
* @see mc_client_create()
*/
-int mc_client_send_playlist_command(mc_client_h client, const char *server_name, const char *playlist_name, const char *media_id, mc_playback_action_e action, unsigned long long position);
+int mc_client_send_playlist_command(mc_client_h client, const char *server_name, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position);
/**
* @brief Destroys client.
*
* @param[in] client_name The app_id of the media controller client. It can be used only in the callback. To use outside, make a copy.
* @param[in] playlist_name The name of the server playlist. It can be used only in the callback. To use outside, make a copy.
- * @param[in] media_id The ID of the media in playlist. It can be used only in the callback. To use outside, make a copy.
+ * @param[in] index The index of the media in playlist. It can be used only in the callback. To use outside, make a copy.
* @param[in] action The received playback action
* @param[in] position The received playback position (milliseconds)
* @param[in] user_data The user data passed from the mc_server_set_playlist_command_received_cb() function
*
* @see mc_server_set_playlist_command_received_cb()
*/
-typedef void (*mc_server_playlist_command_received_cb)(const char* client_name, const char *playlist_name, const char *media_id, mc_playback_action_e action, unsigned long long position, void *user_data);
+typedef void (*mc_server_playlist_command_received_cb)(const char* client_name, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position, void *user_data);
/**
* @brief Creates a media controller server.
* @brief Updates the modified playlist info.
* @details If this function is called, the updated playlist will be sent to all clients. \n
* The server can register only one playlist. If a new one is registered, the old one is removed. \n
- * @a data is a bundle. A bundle is a set of key-value pairs. "item id" is the key and "item metadata" is the value. \n
+ * @a data is a bundle. A bundle is a set of key-value pairs. "index" is the key and "media metadata" is the value. \n
* Therefore you should fill the metadata order using #mc_meta_e. \n
* If there are no playlist items or the server wants to remove the playlist, set @data to NULL.
* @since_tizen 5.0
return ret;
}
-int mc_client_send_playlist_command(mc_client_h client, const char *server_name, const char *playlist_name, const char *media_id, mc_playback_action_e action, unsigned long long position)
+int mc_client_send_playlist_command(mc_client_h client, const char *server_name, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position)
{
int ret = MEDIA_CONTROLLER_ERROR_NONE;
char *message = NULL;
mc_retvm_if(mc_client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
mc_retvm_if(!MC_STRING_VALID(server_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid server_name");
mc_retvm_if(!MC_STRING_VALID(playlist_name), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid playlist_name");
- mc_retvm_if(!MC_STRING_VALID(media_id), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid media_id");
+ mc_retvm_if(!MC_STRING_VALID(index), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid index");
mc_retvm_if(((action < MC_PLAYBACK_ACTION_PLAY) || (action > MC_PLAYBACK_ACTION_TOGGLE_PLAY_PAUSE)), MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid action");
ret = mc_db_check_server_table_exist(mc_client->db_handle, server_name, &exist_server);
ret = mc_util_set_command_available(mc_client->client_name, MC_COMMAND_PLAY_PLAYLIST, NULL);
mc_retvm_if(ret != MEDIA_CONTROLLER_ERROR_NONE, ret, "Error mc_util_set_command_available [%d]", ret);
- message = g_strdup_printf("%s%s%s%s%s%s%d%s%llu", mc_client->client_name, MC_STRING_DELIMITER, playlist_name, MC_STRING_DELIMITER, media_id, MC_STRING_DELIMITER, action, MC_STRING_DELIMITER, position);
+ message = g_strdup_printf("%s%s%s%s%s%s%d%s%llu", mc_client->client_name, MC_STRING_DELIMITER, playlist_name, MC_STRING_DELIMITER, index, MC_STRING_DELIMITER, action, MC_STRING_DELIMITER, position);
mc_retvm_if(message == NULL, MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "fail making message [%d]", ret);
char *interface_name = mc_util_get_interface_name(MC_SERVER, server_name);
mc_debug("[%s] recieved repeat mode:[%d] from [%s]", client_name, repeat_mode, client_name);
}
-void __playlist_play_received_cb(const char* client_name, const char *playlist_name, const char *media_id, mc_playback_action_e action, unsigned long long position, void *user_data)
+void __playlist_play_received_cb(const char* client_name, const char *playlist_name, const char *index, mc_playback_action_e action, unsigned long long position, void *user_data)
{
- mc_debug("recieved playlist play : playlist_name[%s] media_id[%s] action[%d] position[%llu] from [%s]", playlist_name, media_id, action, position, client_name);
+ mc_debug("recieved playlist play : playlist_name[%s] index[%s] action[%d] position[%llu] from [%s]", playlist_name, index, action, position, client_name);
}
void __custom_command_received_cb(const char *client_name, const char *command, bundle *data, void *user_data)