From: Seungbae Shin Date: Thu, 22 Sep 2016 03:41:00 +0000 (+0900) Subject: Apply DEPRECATION macro X-Git-Tag: accepted/tizen/3.0/common/20161114.105335~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ecaa89e06573a8670ad6bfaf32281712d8b1ea3;p=platform%2Fcore%2Fapi%2Ftone-player.git Apply DEPRECATION macro [Version] 0.1.10 [Profile] Common [Issue Type] Deprecation Change-Id: Ie1153fb2cf447be95ae3c21aca1baa62f9c59f17 --- diff --git a/include/tone_player.h b/include/tone_player.h index 75a4ed9..3740e2e 100755 --- a/include/tone_player.h +++ b/include/tone_player.h @@ -204,7 +204,7 @@ typedef enum { * * @see tone_player_stop() */ -int tone_player_start(tone_type_e tone, sound_type_e type, int duration_ms, int *id); +int tone_player_start(tone_type_e tone, sound_type_e type, int duration_ms, int *id) TIZEN_DEPRECATED_API; /** * @brief Plays a tone with stream information of sound-manager. diff --git a/packaging/capi-media-tone-player.spec b/packaging/capi-media-tone-player.spec index 09e3166..3ea6d11 100755 --- a/packaging/capi-media-tone-player.spec +++ b/packaging/capi-media-tone-player.spec @@ -1,6 +1,6 @@ Name: capi-media-tone-player Summary: A tone player library in Tizen C API -Version: 0.1.9 +Version: 0.1.10 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/tone_player.c b/src/tone_player.c index 1581e5b..6edf40a 100755 --- a/src/tone_player.c +++ b/src/tone_player.c @@ -31,6 +31,10 @@ #include +#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) + static int __convert_tone_player_error_code(const char *func, int code) { int ret = TONE_PLAYER_ERROR_NONE; @@ -59,17 +63,21 @@ int tone_player_start(tone_type_e tone, sound_type_e type, int duration, int *id { int ret; int player; + + DEPRECATED_WARN_INSTEAD("tone_player_start_with_stream_info"); + if (tone < TONE_TYPE_DEFAULT || tone > TONE_TYPE_USER_DEFINED_HIGH_FRE) - return __convert_tone_player_error_code(__func__, TONE_PLAYER_ERROR_INVALID_PARAMETER); + return __convert_tone_player_error_code(__func__, TONE_PLAYER_ERROR_INVALID_PARAMETER); ret = mm_sound_play_tone(tone, type , 1, duration, &player); if (ret == 0 && id != NULL) *id = player; + return __convert_tone_player_error_code(__func__, ret); } -int tone_player_start_with_stream_info(tone_type_e tone, sound_stream_info_h stream_info, int duration, int * id) +int tone_player_start_with_stream_info(tone_type_e tone, sound_stream_info_h stream_info, int duration, int *id) { int ret; int player; @@ -88,18 +96,16 @@ int tone_player_start_with_stream_info(tone_type_e tone, sound_stream_info_h str ret = sound_manager_get_type_from_stream_information(stream_info, &stream_type); if (ret) return __convert_tone_player_error_code(__func__, ret); + ret = sound_manager_get_index_from_stream_information(stream_info, &stream_id); if (ret) return __convert_tone_player_error_code(__func__, ret); ret = mm_sound_play_tone_with_stream_info(tone, stream_type, stream_id, vol, duration, &player); - if (ret == 0 && id != NULL) *id = player; return __convert_tone_player_error_code(__func__, ret); - - } int tone_player_stop(int id)