Remove 3.0 deprecated API 88/160288/5 accepted/tizen/unified/20180313.162808 submit/tizen/20180227.071319 submit/tizen/20180312.021420
authorSeungbae Shin <seungbae.shin@samsung.com>
Wed, 15 Nov 2017 08:15:40 +0000 (17:15 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Fri, 26 Jan 2018 10:30:49 +0000 (19:30 +0900)
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: I6efbb32ea1210b8aada5104d1a6de738f95a6824

CMakeLists.txt
doc/tone_player_doc.h
include/tone_player.h
packaging/capi-media-tone-player.spec
src/tone_player.c
test/CMakeLists.txt
test/multimedia_tone_player_test.c

index 8c37f5e..fdfff13 100755 (executable)
@@ -87,7 +87,7 @@ CONFIGURE_FILE(
 )
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
-#ADD_SUBDIRECTORY(test)
+ADD_SUBDIRECTORY(test)
 
 IF(UNIX)
 
index 2655858..291ece9 100755 (executable)
@@ -38,7 +38,7 @@
  *    \#include <tone_player.h>
  *
  * @section CAPI_MEDIA_TONE_PLAYER_OVERVIEW Overview
- * The @ref CAPI_MEDIA_TONE_PLAYER_MODULE API allows you to play and stop playing the tone. To play a particular type of tone(#tone_type_e), use tone_player_start(). To stop playing the tone, call tone_player_stop().
+ * The @ref CAPI_MEDIA_TONE_PLAYER_MODULE API allows you to play and stop playing the tone. To play a particular type of tone(#tone_type_e), use tone_player_start_new(). To stop playing the tone, call tone_player_stop().
  */
 
 #endif /* __TIZEN_MEDIA_TONE_PLAYER_DOC_H__ */
index 1e8aff5..465a678 100755 (executable)
@@ -180,32 +180,6 @@ typedef enum {
  * @{
  */
 
-
-/**
- * @deprecated Deprecated since 3.0. Use tone_player_start_new() instead.
- * @brief Plays a tone.
- *
- * @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] tone     The tone type to play
- * @param[in] type     The sound type
- * @param[in] duration_ms      The tone duration in milliseconds \n
- *                                 @c -1 indicates an infinite duration.
- * @param[out] id      The tone player ID ( can be set to @c NULL )
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #TONE_PLAYER_ERROR_NONE Successful
- * @retval #TONE_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #TONE_PLAYER_ERROR_INVALID_OPERATION Invalid operation
- *
- * @see tone_player_stop()
- */
-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.
  *
@@ -244,7 +218,7 @@ int tone_player_start_new(tone_type_e tone, sound_stream_info_h stream_info, int
  * @retval #TONE_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
  * @retval #TONE_PLAYER_ERROR_INVALID_OPERATION Invalid operation
  *
- * @see tone_player_start()
+ * @see tone_player_start_new()
  */
 int tone_player_stop(int id);
 
index 0e68f97..0780885 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-tone-player
 Summary:    A tone player library in Tizen C API
-Version:    0.1.15
+Version:    0.2.0
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index f1c21ef..17b7ab7 100755 (executable)
 #include <unistd.h>
 #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,24 +54,6 @@ static int __convert_tone_player_error_code(const char *func, int code)
        return ret;
 }
 
-int tone_player_start(tone_type_e tone, sound_type_e type, int duration_ms, int *id)
-{
-       int ret;
-       int player;
-
-       DEPRECATED_WARN_INSTEAD("tone_player_start_new");
-
-       if (tone < TONE_TYPE_DEFAULT || tone > TONE_TYPE_USER_DEFINED_HIGH_FRE)
-               return __convert_tone_player_error_code(__func__, TONE_PLAYER_ERROR_INVALID_PARAMETER);
-
-       ret = mm_sound_play_tone(tone, type , 1, duration_ms, &player);
-
-       if (ret == 0 && id != NULL)
-       *id = player;
-
-       return __convert_tone_player_error_code(__func__, ret);
-}
-
 int tone_player_start_new(tone_type_e tone, sound_stream_info_h stream_info, int duration_ms, int *id)
 {
        int ret;
index 74802de..07a6abf 100644 (file)
@@ -9,9 +9,6 @@ ENDFOREACH()
 
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -pie")
 
-#ADD_EXECUTABLE("system-sensor" system-sensor.c)
-#TARGET_LINK_LIBRARIES("system-sensor" ${fw_name} ${${fw_test}_LDFLAGS})
-
 aux_source_directory(. sources)
 FOREACH(src ${sources})
     GET_FILENAME_COMPONENT(src_name ${src} NAME_WE)
index 044e913..7aa38dd 100755 (executable)
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <getopt.h>
+#include <sound_manager.h>
 
 #define TONE_FIRST          TONE_TYPE_DTMF_0
 #define TONE_LAST           TONE_TYPE_USER_DEFINED_HIGH_FRE
@@ -47,9 +48,17 @@ void help()
                        "  -h, --help                help\n");
 }
 
+static void stream_focus_cb(sound_stream_info_h stream_info, sound_stream_focus_mask_e focus_mask, sound_stream_focus_state_e focus_state,
+                       sound_stream_focus_change_reason_e reason, int sound_behavior, const char *extra_info, void *user_data)
+{
+       return;
+}
+
+
 void tone_play_test(int from, int to, int duration, int sleep_time)
 {
        int i;
+       sound_stream_info_h stream_info;
 
        printf("From : %2d,   To : %2d,    Duration : %4d,  sleep_time : %4d\n", from, to, duration, sleep_time);
 
@@ -57,12 +66,19 @@ void tone_play_test(int from, int to, int duration, int sleep_time)
                printf("Wrong Parameter\n");
                return;
        }
+       
+       if (sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, stream_focus_cb, NULL, &stream_info)) {
+               printf("failed to create stream info\n");
+               return;
+       }
 
        for (i = from; i <= to; i++) {
                printf("Play Tone : %d\n", i);
-               tone_player_start(i, SOUND_TYPE_MEDIA, duration, NULL);
+               tone_player_start_new(i, stream_info, duration, NULL);
                usleep(sleep_time * 1000);
        }
+       
+       sound_manager_destroy_stream_information(stream_info);
 }
 
 int main(int argc, char **argv)