Please refer following deprecation policy.
https://developer.tizen.org/development/training/native-application/understanding-tizen-programming/api-versioning-and-deprecation-policy-tizen-platform
[Version] 0.2.0
[Issue Type] Deprecation
Change-Id: I12ca26e413963ee98ec1c0c904a06cdf8f860e94
* \#include <wav_player.h>
*
* @section CAPI_MEDIA_WAV_PLAYER_OVERVIEW Overview
- * The @ref CAPI_MEDIA_WAV_PLAYER_MODULE API allows you to simply play and stop a wav file. To play a certain wav file, call wave_player_start() with a path to the .wav file.
+ * The @ref CAPI_MEDIA_WAV_PLAYER_MODULE API allows you to simply play and stop a wav file. To play a certain wav file, call wav_player_start_new() with a path to the .wav file.
* When playing a wav file is finished, wav_player_playback_completed_cb() will be invoked.
*/
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @param[in] id The completed wav player ID
* @param[in] user_data The user data passed from the callback registration function
- * @see wav_player_start()
+ * @see wav_player_start_new()
*/
typedef void (*wav_player_playback_completed_cb)(int id, void *user_data);
-
-/**
- * @deprecated Deprecated since 3.0. Use wav_player_start_new() instead.
- * @brief Plays a WAV file.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- *
- * @remarks Sound can be mixed with other sounds if you don't control the sound session in sound-manager module since 3.0.\n
- * You can refer to @ref CAPI_MEDIA_SOUND_MANAGER_MODULE.
- *
- * @param[in] path The file path to play
- * @param[in] type The sound type
- * @param[in] callback The callback function to invoke when a WAV file is finished playing
- * @param[in] user_data The user data to be passed to the callback function
- * @param[out] id The WAV player ID ( can be set to NULL )
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #WAV_PLAYER_ERROR_NONE Successful
- * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation
- * @retval #WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED Not supported format
- *
- * @post It invokes wav_player_playback_completed_cb() when a WAV file has finished playing.
- * @see wav_player_stop()
- * @see wav_player_playback_completed_cb()
- */
-int wav_player_start(const char *path, sound_type_e type, wav_player_playback_completed_cb callback, void *user_data, int *id) TIZEN_DEPRECATED_API;
-
/**
* @brief Plays a WAV file with stream information of sound-manager.
* @since_tizen 3.0
* @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation
*
- * @see wav_player_start()
+ * @see wav_player_start_new()
*/
int wav_player_stop(int id);
Name: capi-media-wav-player
Summary: A wav player library in Tizen C API
-Version: 0.1.26
+Version: 0.2.0
Release: 0
Group: Multimedia/API
License: Apache-2.0
#include "wav_player.h"
#include "wav_player_private.h"
-#define DEPRECATED_WARN_INSTEAD(msg) do { \
- LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release. Use %s() instead.", __func__, msg); \
-} while (0)
-
-int wav_player_start(const char *path, sound_type_e type, wav_player_playback_completed_cb cb, void *user_data, int *id)
-{
- int ret = MM_ERROR_NONE;
- int player = -1;
- char m_path[PATH_MAX];
- void (*_completed_cb)(void *, int);
- _completed_cb = NULL;
- _cb_data *cb_data = NULL;
-
- DEPRECATED_WARN_INSTEAD("wav_player_start_new");
-
- if (path == NULL)
- return _convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_INVALID_PARAMETER);
-
- if (type >= SOUND_TYPE_NUM)
- return _convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_INVALID_PARAMETER);
-
- m_path[0] = '\0';
- if (path[0] != '/') {
- if (getcwd(m_path, PATH_MAX) != NULL)
- strncat(m_path, "/", PATH_MAX - strlen(m_path) - 1);
- }
- strncat(m_path, path, PATH_MAX - strlen(m_path) - 1);
-
- if (cb) {
- _completed_cb = _internal_complete_cb;
- cb_data = (_cb_data *)malloc(sizeof(_cb_data));
- if (cb_data == NULL)
- return _convert_wav_player_error_code(__func__, WAV_PLAYER_ERROR_INVALID_OPERATION);
- cb_data->cb = cb;
- cb_data->user_data = user_data;
- }
-
- ret = mm_sound_play_sound(m_path, type, _completed_cb , cb_data, &player);
- if (ret == 0 && id != NULL)
- *id = player;
-
- if (ret != 0 && cb_data != NULL)
- free(cb_data);
-
- return _convert_wav_player_error_code(__func__, ret);
-}
-
int wav_player_start_new(const char *path, sound_stream_info_h stream_info, wav_player_playback_completed_cb callback, void *user_data, int *id)
{
return _start_with_stream_info(path, stream_info, 1, callback, user_data, id);
printf("Play Wav, File Path : %s, Iterate : %d\n", file_path, iterate);
ret = wav_player_start_loop(file_path, stream_info, iterate, _player_stop_cb, (void*)stream_info, &gid);
- printf("wav_player_start(id=%d) ret = %d\n", gid, ret);
+ printf("wav_player_start_loop(id=%d) ret = %d\n", gid, ret);
if (ret) {
sound_manager_destroy_stream_information(stream_info);
return;