From: dh8210.kim Date: Mon, 19 Jan 2015 05:27:40 +0000 (+0900) Subject: tone-player : Change APIs based on Tizen 2.3 X-Git-Tag: accepted/tizen/common/20150122.095545^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a152311e4bd6b11894876926fc5f0babfe663a4;p=platform%2Fcore%2Fapi%2Ftone-player.git tone-player : Change APIs based on Tizen 2.3 Signed-off-by: dh8210.kim Change-Id: I2d183477a3c816c4f7409485aedd57a730d36102 --- diff --git a/AUTHORS b/AUTHORS index d123f55..7678990 100755 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,2 @@ -JongHyuk Choi -YoungHun Kim +Seungbae Shin +DooHwan Kim diff --git a/CMakeLists.txt b/CMakeLists.txt index 92b6ab8..8c37f5e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,7 @@ FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") IF("${ARCH}" MATCHES "^arm.*") diff --git a/doc/tone_player_doc.h b/doc/tone_player_doc.h new file mode 100755 index 0000000..2655858 --- /dev/null +++ b/doc/tone_player_doc.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#ifndef __TIZEN_MEDIA_TONE_PLAYER_DOC_H__ +#define __TIZEN_MEDIA_TONE_PLAYER_DOC_H__ + + +/** + * @file tone_player_doc.h + * @brief This file contains high level documentation for the Tone Player API. + * + */ + +/** + * @ingroup CAPI_MEDIA_FRAMEWORK + * @defgroup CAPI_MEDIA_TONE_PLAYER_MODULE Tone Player + */ + +/** + * @ingroup CAPI_MEDIA_FRAMEWORK + * @addtogroup CAPI_MEDIA_TONE_PLAYER_MODULE + * @brief The @ref CAPI_MEDIA_TONE_PLAYER_MODULE API provides functions for playing the tone. + * @section CAPI_MEDIA_TONE_PLAYER_MODULE_HEADER Required Header + * \#include + * + * @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(). + */ + +#endif /* __TIZEN_MEDIA_TONE_PLAYER_DOC_H__ */ + diff --git a/include/tone_player.h b/include/tone_player.h old mode 100644 new mode 100755 index 21031b6..6089933 --- a/include/tone_player.h +++ b/include/tone_player.h @@ -162,8 +162,10 @@ typedef enum TONE_TYPE_CDMA_CALLDROP_LITE, /**< CDMA CALLDROP LITE tone: 1480Hz 125ms, 1397Hz 125ms, 784Hz 125ms */ TONE_TYPE_CDMA_NETWORK_BUSY_ONE_SHOT, /**< CDMA_NETWORK_BUSY_ONE_SHOT tone: 425Hz 500ms ON, 500ms OFF. */ TONE_TYPE_CDMA_ABBR_ALERT, /**< CDMA_ABBR_ALERT tone: 1150Hz+770Hz 400ms ON */ - TONE_TYPE_CDMA_SIGNAL_OFF /**< CDMA_SIGNAL_OFF - silent tone */ - + TONE_TYPE_CDMA_SIGNAL_OFF, /**< CDMA_SIGNAL_OFF - silent tone */ + TONE_TYPE_USER_DEFINED_LOW_FRE, /**< User Defined Tone: 100Hz continuous */ + TONE_TYPE_USER_DEFINED_MED_FRE, /**< User Defined Tone: 200Hz continuous */ + TONE_TYPE_USER_DEFINED_HIGH_FRE /**< User Defined Tone: 300Hz continuous */ } tone_type_e; diff --git a/packaging/capi-media-tone-player.spec b/packaging/capi-media-tone-player.spec index 69d4188..1b0b46c 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.0 +Version: 0.1.1 Release: 16 Group: Multimedia/API License: Apache-2.0 diff --git a/src/tone_player.c b/src/tone_player.c index b258f6c..8447e30 100755 --- a/src/tone_player.c +++ b/src/tone_player.c @@ -49,25 +49,25 @@ static int __convert_tone_player_error_code(const char *func, int code){ ret = TONE_PLAYER_ERROR_INVALID_OPERATION; errorstr = "INVALID_OPERATION"; break; - } + } LOGE( "[%s] %s(0x%08x) : core frameworks error code(0x%08x)",func, errorstr, ret, code); return ret; } - int tone_player_start(tone_type_e tone, sound_type_e type, int duration, int *id){ - int ret; - int player; - if( tone < TONE_TYPE_DEFAULT || tone > TONE_TYPE_CDMA_SIGNAL_OFF ) - return __convert_tone_player_error_code(__func__, TONE_PLAYER_ERROR_INVALID_PARAMETER); - - ret = mm_sound_play_tone(tone, type , 1, duration, &player); + int ret; + int player; + 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, &player); - if( ret == 0 && id != NULL) - *id = player; - return __convert_tone_player_error_code(__func__, ret); + if( ret == 0 && id != NULL) + *id = player; + return __convert_tone_player_error_code(__func__, ret); } + int tone_player_stop(int id){ return __convert_tone_player_error_code(__func__, mm_sound_stop_sound(id)); }