Apply DEPRECATION macro 67/89067/1
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 22 Sep 2016 03:41:00 +0000 (12:41 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 22 Sep 2016 03:47:23 +0000 (12:47 +0900)
[Version] 0.1.10
[Profile] Common
[Issue Type] Deprecation

Change-Id: Ie1153fb2cf447be95ae3c21aca1baa62f9c59f17

include/tone_player.h
packaging/capi-media-tone-player.spec
src/tone_player.c

index 75a4ed9..3740e2e 100755 (executable)
@@ -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.
index 09e3166..3ea6d11 100755 (executable)
@@ -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
index 1581e5b..6edf40a 100755 (executable)
 #include <dlog.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)
+
 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)