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
)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-#ADD_SUBDIRECTORY(test)
+ADD_SUBDIRECTORY(test)
IF(UNIX)
* \#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__ */
* @{
*/
-
-/**
- * @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.
*
* @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);
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
#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;
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;
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)
#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
" -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);
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)