Tizen 2.1 base
authorJinkun Jang <jinkun.jang@samsung.com>
Tue, 12 Mar 2013 16:46:17 +0000 (01:46 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Tue, 12 Mar 2013 16:46:17 +0000 (01:46 +0900)
AUTHORS [new file with mode: 0755]
CMakeLists.txt [new file with mode: 0755]
LICENSE.APLv2.0 [new file with mode: 0755]
NOTICE [new file with mode: 0644]
capi-media-tone-player.manifest [new file with mode: 0755]
capi-media-tone-player.pc.in [new file with mode: 0644]
include/tone_player.h [new file with mode: 0644]
packaging/capi-media-tone-player.spec [new file with mode: 0755]
src/tone_player.c [new file with mode: 0755]
test/CMakeLists.txt [new file with mode: 0644]
test/multimedia_tone_player_test.c [new file with mode: 0755]

diff --git a/AUTHORS b/AUTHORS
new file mode 100755 (executable)
index 0000000..d123f55
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,2 @@
+JongHyuk Choi <jhchoi.choi at samsung dot com>
+YoungHun Kim <yh8004.kim at samsung dot com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..c6f3adb
--- /dev/null
@@ -0,0 +1,121 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(Services 
+        "application"
+        "base"
+        "content"
+        "location"
+        "media"
+        "messaging"
+        "network"
+        "social"
+        "telephony"
+        "system"
+   )
+
+
+# project
+SET(project_prefix "capi")
+SET(prefix "/usr")
+SET(version "0.0.1")
+SET(maintainer "Seungkeun Lee <sngn.lee@samsung.com>, Kangho Hur<kagho.hur@samsung.com>")
+SET(description "A tone player library in Tizen Native API")
+SET(service "media")
+SET(submodule "tone-player")
+
+# for package file
+SET(dependents "mm-sound dlog capi-base-common capi-media-sound-manager")
+SET(pc_dependents "capi-base-common capi-media-sound-manager")
+
+SET(fw_name "${project_prefix}-${service}-${submodule}")
+
+PROJECT(${fw_name})
+
+SET(CMAKE_INSTALL_PREFIX ${prefix})
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(VERSION ${version})
+
+SET(INC_DIR include)
+INCLUDE_DIRECTORIES(${INC_DIR})
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_name} REQUIRED ${dependents})
+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_DEBUG "-O0 -g")
+
+IF("${ARCH}" MATCHES "^arm.*")
+    ADD_DEFINITIONS("-DTARGET")
+ENDIF("${ARCH}" MATCHES "^arm.*")
+
+ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
+ADD_DEFINITIONS("-DTIZEN_DEBUG")
+
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
+
+aux_source_directory(src SOURCES)
+ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
+
+TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
+
+SET_TARGET_PROPERTIES(${fw_name}
+     PROPERTIES
+     VERSION ${FULLVER}
+     SOVERSION ${MAJORVER}
+     CLEAN_DIRECT_OUTPUT 1
+)
+
+INSTALL(TARGETS ${fw_name} DESTINATION lib)
+INSTALL(
+        DIRECTORY ${INC_DIR}/ DESTINATION include/${service}
+        FILES_MATCHING
+        PATTERN "*_private.h" EXCLUDE
+        PATTERN "${INC_DIR}/*.h"
+        )
+
+SET(PC_NAME ${fw_name})
+SET(PC_REQUIRED ${pc_dependents})
+SET(PC_LDFLAGS -l${fw_name})
+
+CONFIGURE_FILE(
+    ${fw_name}.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION lib/pkgconfig)
+
+#ADD_SUBDIRECTORY(test)
+
+IF(UNIX)
+
+ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
+ADD_CUSTOM_COMMAND(
+        DEPENDS clean 
+        COMMENT "distribution clean"
+        COMMAND find
+        ARGS    . 
+        -not -name config.cmake -and \(
+        -name tester.c -or
+        -name Testing -or
+        -name CMakeFiles -or
+        -name cmake.depends -or
+        -name cmake.check_depends -or
+        -name CMakeCache.txt -or
+        -name cmake.check_cache -or
+        -name *.cmake -or
+        -name Makefile -or
+        -name core -or
+        -name core.* -or
+        -name gmon.out -or
+        -name install_manifest.txt -or
+        -name *.pc -or
+        -name *~ \)
+        | grep -v TC | xargs rm -rf
+        TARGET  distclean
+        VERBATIM
+)
+
+ENDIF(UNIX)
diff --git a/LICENSE.APLv2.0 b/LICENSE.APLv2.0
new file mode 100755 (executable)
index 0000000..5554685
--- /dev/null
@@ -0,0 +1,204 @@
+                                 Apache License\r
+                           Version 2.0, January 2004\r
+                        http://www.apache.org/licenses/\r
+\r
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+   1. Definitions.\r
+\r
+      "License" shall mean the terms and conditions for use, reproduction,\r
+      and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+      "Licensor" shall mean the copyright owner or entity authorized by\r
+      the copyright owner that is granting the License.\r
+\r
+      "Legal Entity" shall mean the union of the acting entity and all\r
+      other entities that control, are controlled by, or are under common\r
+      control with that entity. For the purposes of this definition,\r
+      "control" means (i) the power, direct or indirect, to cause the\r
+      direction or management of such entity, whether by contract or\r
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+      outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+      "You" (or "Your") shall mean an individual or Legal Entity\r
+      exercising permissions granted by this License.\r
+\r
+      "Source" form shall mean the preferred form for making modifications,\r
+      including but not limited to software source code, documentation\r
+      source, and configuration files.\r
+\r
+      "Object" form shall mean any form resulting from mechanical\r
+      transformation or translation of a Source form, including but\r
+      not limited to compiled object code, generated documentation,\r
+      and conversions to other media types.\r
+\r
+      "Work" shall mean the work of authorship, whether in Source or\r
+      Object form, made available under the License, as indicated by a\r
+      copyright notice that is included in or attached to the work\r
+      (an example is provided in the Appendix below).\r
+\r
+      "Derivative Works" shall mean any work, whether in Source or Object\r
+      form, that is based on (or derived from) the Work and for which the\r
+      editorial revisions, annotations, elaborations, or other modifications\r
+      represent, as a whole, an original work of authorship. For the purposes\r
+      of this License, Derivative Works shall not include works that remain\r
+      separable from, or merely link (or bind by name) to the interfaces of,\r
+      the Work and Derivative Works thereof.\r
+\r
+      "Contribution" shall mean any work of authorship, including\r
+      the original version of the Work and any modifications or additions\r
+      to that Work or Derivative Works thereof, that is intentionally\r
+      submitted to Licensor for inclusion in the Work by the copyright owner\r
+      or by an individual or Legal Entity authorized to submit on behalf of\r
+      the copyright owner. For the purposes of this definition, "submitted"\r
+      means any form of electronic, verbal, or written communication sent\r
+      to the Licensor or its representatives, including but not limited to\r
+      communication on electronic mailing lists, source code control systems,\r
+      and issue tracking systems that are managed by, or on behalf of, the\r
+      Licensor for the purpose of discussing and improving the Work, but\r
+      excluding communication that is conspicuously marked or otherwise\r
+      designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+      "Contributor" shall mean Licensor and any individual or Legal Entity\r
+      on behalf of whom a Contribution has been received by Licensor and\r
+      subsequently incorporated within the Work.\r
+\r
+   2. Grant of Copyright License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      copyright license to reproduce, prepare Derivative Works of,\r
+      publicly display, publicly perform, sublicense, and distribute the\r
+      Work and such Derivative Works in Source or Object form.\r
+\r
+   3. Grant of Patent License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      (except as stated in this section) patent license to make, have made,\r
+      use, offer to sell, sell, import, and otherwise transfer the Work,\r
+      where such license applies only to those patent claims licensable\r
+      by such Contributor that are necessarily infringed by their\r
+      Contribution(s) alone or by combination of their Contribution(s)\r
+      with the Work to which such Contribution(s) was submitted. If You\r
+      institute patent litigation against any entity (including a\r
+      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+      or a Contribution incorporated within the Work constitutes direct\r
+      or contributory patent infringement, then any patent licenses\r
+      granted to You under this License for that Work shall terminate\r
+      as of the date such litigation is filed.\r
+\r
+   4. Redistribution. You may reproduce and distribute copies of the\r
+      Work or Derivative Works thereof in any medium, with or without\r
+      modifications, and in Source or Object form, provided that You\r
+      meet the following conditions:\r
+\r
+      (a) You must give any other recipients of the Work or\r
+          Derivative Works a copy of this License; and\r
+\r
+      (b) You must cause any modified files to carry prominent notices\r
+          stating that You changed the files; and\r
+\r
+      (c) You must retain, in the Source form of any Derivative Works\r
+          that You distribute, all copyright, patent, trademark, and\r
+          attribution notices from the Source form of the Work,\r
+          excluding those notices that do not pertain to any part of\r
+          the Derivative Works; and\r
+\r
+      (d) If the Work includes a "NOTICE" text file as part of its\r
+          distribution, then any Derivative Works that You distribute must\r
+          include a readable copy of the attribution notices contained\r
+          within such NOTICE file, excluding those notices that do not\r
+          pertain to any part of the Derivative Works, in at least one\r
+          of the following places: within a NOTICE text file distributed\r
+          as part of the Derivative Works; within the Source form or\r
+          documentation, if provided along with the Derivative Works; or,\r
+          within a display generated by the Derivative Works, if and\r
+          wherever such third-party notices normally appear. The contents\r
+          of the NOTICE file are for informational purposes only and\r
+          do not modify the License. You may add Your own attribution\r
+          notices within Derivative Works that You distribute, alongside\r
+          or as an addendum to the NOTICE text from the Work, provided\r
+          that such additional attribution notices cannot be construed\r
+          as modifying the License.\r
+\r
+      You may add Your own copyright statement to Your modifications and\r
+      may provide additional or different license terms and conditions\r
+      for use, reproduction, or distribution of Your modifications, or\r
+      for any such Derivative Works as a whole, provided Your use,\r
+      reproduction, and distribution of the Work otherwise complies with\r
+      the conditions stated in this License.\r
+\r
+   5. Submission of Contributions. Unless You explicitly state otherwise,\r
+      any Contribution intentionally submitted for inclusion in the Work\r
+      by You to the Licensor shall be under the terms and conditions of\r
+      this License, without any additional terms or conditions.\r
+      Notwithstanding the above, nothing herein shall supersede or modify\r
+      the terms of any separate license agreement you may have executed\r
+      with Licensor regarding such Contributions.\r
+\r
+   6. Trademarks. This License does not grant permission to use the trade\r
+      names, trademarks, service marks, or product names of the Licensor,\r
+      except as required for reasonable and customary use in describing the\r
+      origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+   7. Disclaimer of Warranty. Unless required by applicable law or\r
+      agreed to in writing, Licensor provides the Work (and each\r
+      Contributor provides its Contributions) on an "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+      implied, including, without limitation, any warranties or conditions\r
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+      PARTICULAR PURPOSE. You are solely responsible for determining the\r
+      appropriateness of using or redistributing the Work and assume any\r
+      risks associated with Your exercise of permissions under this License.\r
+\r
+   8. Limitation of Liability. In no event and under no legal theory,\r
+      whether in tort (including negligence), contract, or otherwise,\r
+      unless required by applicable law (such as deliberate and grossly\r
+      negligent acts) or agreed to in writing, shall any Contributor be\r
+      liable to You for damages, including any direct, indirect, special,\r
+      incidental, or consequential damages of any character arising as a\r
+      result of this License or out of the use or inability to use the\r
+      Work (including but not limited to damages for loss of goodwill,\r
+      work stoppage, computer failure or malfunction, or any and all\r
+      other commercial damages or losses), even if such Contributor\r
+      has been advised of the possibility of such damages.\r
+\r
+   9. Accepting Warranty or Additional Liability. While redistributing\r
+      the Work or Derivative Works thereof, You may choose to offer,\r
+      and charge a fee for, acceptance of support, warranty, indemnity,\r
+      or other liability obligations and/or rights consistent with this\r
+      License. However, in accepting such obligations, You may act only\r
+      on Your own behalf and on Your sole responsibility, not on behalf\r
+      of any other Contributor, and only if You agree to indemnify,\r
+      defend, and hold each Contributor harmless for any liability\r
+      incurred by, or claims asserted against, such Contributor by reason\r
+      of your accepting any such warranty or additional liability.\r
+\r
+   END OF TERMS AND CONDITIONS\r
+\r
+   APPENDIX: How to apply the Apache License to your work.\r
+\r
+      To apply the Apache License to your work, attach the following\r
+      boilerplate notice, with the fields enclosed by brackets "[]"\r
+      replaced with your own identifying information. (Don't include\r
+      the brackets!)  The text should be enclosed in the appropriate\r
+      comment syntax for the file format. We also recommend that a\r
+      file or class name and description of purpose be included on the\r
+      same "printed page" as the copyright notice for easier\r
+      identification within third-party archives.\r
+\r
+   Copyright [yyyy] [name of copyright owner]\r
+\r
+   Licensed under the Apache License, Version 2.0 (the "License");\r
+   you may not use this file except in compliance with the License.\r
+   You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+\r
+\r
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..ffbca8e
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,4 @@
+Copyright (c) Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE file for Apache License terms and conditions.
+
diff --git a/capi-media-tone-player.manifest b/capi-media-tone-player.manifest
new file mode 100755 (executable)
index 0000000..a76fdba
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_" />
+       </request>
+</manifest>
diff --git a/capi-media-tone-player.pc.in b/capi-media-tone-player.pc.in
new file mode 100644 (file)
index 0000000..5d02f8d
--- /dev/null
@@ -0,0 +1,15 @@
+
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=/usr/lib
+includedir=/usr/include/media
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@ 
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
+
diff --git a/include/tone_player.h b/include/tone_player.h
new file mode 100644 (file)
index 0000000..21031b6
--- /dev/null
@@ -0,0 +1,224 @@
+/*
+* 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_H__
+#define __TIZEN_MEDIA_TONE_PLAYER_H__
+
+#include <tizen.h>
+#include <sound_manager.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define TONE_PLAYER_ERROR_CLASS          TIZEN_ERROR_MULTIMEDIA_CLASS | 0x60
+
+/**
+ * @file tone_player.h
+ * @brief This file contains the tone player API
+ */
+
+/**
+ * @addtogroup CAPI_MEDIA_TONE_PLAYER_MODULE
+ * @{
+ */
+
+/**
+ * @brief Enumerations of error codes for wav player
+ */
+typedef enum
+{
+    TONE_PLAYER_ERROR_NONE        = TIZEN_ERROR_NONE,                      /**< Successful */
+    TONE_PLAYER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,       /**< Invalid parameter */
+    TONE_PLAYER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,       /**< Invalid operation */
+} tone_player_error_e;
+
+/**
+ * @brief Enumerations of tone
+ */
+typedef enum
+{
+       TONE_TYPE_DEFAULT = 0,                  /**< The default tone */
+       TONE_TYPE_DTMF_0 = 0,                           /**< Predefined DTMF 0 */
+       TONE_TYPE_DTMF_1,                               /**< Predefined DTMF 1 */
+       TONE_TYPE_DTMF_2,                               /**< Predefined DTMF 2 */
+       TONE_TYPE_DTMF_3,                               /**< Predefined DTMF 3 */
+       TONE_TYPE_DTMF_4,                               /**< Predefined DTMF 4 */
+       TONE_TYPE_DTMF_5,                               /**< Predefined DTMF 5 */
+       TONE_TYPE_DTMF_6,                               /**< Predefined DTMF 6 */
+       TONE_TYPE_DTMF_7,                               /**< Predefined DTMF 7 */
+       TONE_TYPE_DTMF_8,                               /**< Predefined DTMF 8 */
+       TONE_TYPE_DTMF_9,                               /**< Predefined DTMF 9 */
+       TONE_TYPE_DTMF_S,                          /**< Predefined DTMF Star - Asterisk (*) */
+       TONE_TYPE_DTMF_P,                               /**< Predefined DTMF sharP (#) */
+       TONE_TYPE_DTMF_A,                               /**< Predefined DTMF A (A) */
+       TONE_TYPE_DTMF_B,                               /**< Predefined DTMF B (B) */   
+       TONE_TYPE_DTMF_C,                               /**< Predefined DTMF C (C) */   
+       TONE_TYPE_DTMF_D,                               /**< Predefined DTMF D (D) */
+       TONE_TYPE_SUP_DIAL,     /**< Call supervisory tone, Dial tone: CEPT: 425Hz, continuous */
+       TONE_TYPE_ANSI_DIAL,    /**< Call supervisory tone, Dial tone: ANSI (IS-95): 350Hz+440Hz, continuous */
+       TONE_TYPE_JAPAN_DIAL,    /**< Call supervisory tone, Dial tone: JAPAN: 400Hz, continuous*/
+       TONE_TYPE_SUP_BUSY,    /**< Call supervisory tone, Busy: CEPT: 425Hz, 500ms ON, 500ms OFF... */
+       TONE_TYPE_ANSI_BUSY,     /**< Call supervisory tone, Busy: ANSI (IS-95): 480Hz+620Hz, 500ms ON, 500ms OFF... */
+       TONE_TYPE_JAPAN_BUSY,     /**< Call supervisory tone, Busy: JAPAN: 400Hz, 500ms ON, 500ms OFF...*/
+       TONE_TYPE_SUP_CONGESTION,   /**< Call supervisory tone, Congestion: CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF */
+       TONE_TYPE_ANSI_CONGESTION,  /**< Call supervisory tone, Congestion: ANSI (IS-95): 480Hz+620Hz, 250ms ON, 250ms OFF... */
+       TONE_TYPE_SUP_RADIO_ACK,   /**< Call supervisory tone, Radio path acknowledgment : CEPT, ANSI: 425Hz, 200ms ON  */
+       TONE_TYPE_JAPAN_RADIO_ACK,  /**< Call supervisory tone, Radio path acknowledgment : JAPAN: 400Hz, 1s ON, 2s OFF...*/
+       TONE_TYPE_SUP_RADIO_NOTAVAIL,  /**< Call supervisory tone, Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts */
+       TONE_TYPE_SUP_ERROR,    /**< Call supervisory tone, Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... */
+       TONE_TYPE_SUP_CALL_WAITING,  /**< Call supervisory tone, Call Waiting: CEPT, JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF...  */
+       TONE_TYPE_ANSI_CALL_WAITING,  /**< Call supervisory tone, Call Waiting: ANSI (IS-95): 440 Hz, 300 ms ON, 9.7 s OFF, (100 ms ON, 100 ms OFF, 100 ms ON, 9.7s OFF ...) */
+       TONE_TYPE_SUP_RINGTONE,   /**< Call supervisory tone, Ring Tone: CEPT, JAPAN: 425Hz, 1s ON, 4s OFF... */
+       TONE_TYPE_ANSI_RINGTONE,   /**< Call supervisory tone, Ring Tone: ANSI (IS-95): 440Hz + 480Hz, 2s ON, 4s OFF... */
+       TONE_TYPE_PROP_BEEP,    /**< General beep: 400Hz+1200Hz, 35ms ON */
+       TONE_TYPE_PROP_ACK,     /**< Proprietary tone, positive acknowledgment: 1200Hz, 100ms ON, 100ms OFF 2 bursts */
+       TONE_TYPE_PROP_NACK,     /**< Proprietary tone, negative acknowledgment: 300Hz+400Hz+500Hz, 400ms ON */
+       TONE_TYPE_PROP_PROMPT,    /**< Proprietary tone, prompt tone: 400Hz+1200Hz, 200ms ON  */
+       TONE_TYPE_PROP_BEEP2,     /**< Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON */
+       TONE_TYPE_SUP_INTERCEPT,       /**< Call supervisory tone (IS-95), intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms */
+       TONE_TYPE_SUP_INTERCEPT_ABBREV,    /**< Call supervisory tone (IS-95), abbreviated intercept: intercept tone limited to 4 seconds */
+       TONE_TYPE_SUP_CONGESTION_ABBREV,     /**< Call supervisory tone (IS-95), abbreviated congestion: congestion tone limited to 4 seconds */
+       TONE_TYPE_SUP_CONFIRM,       /**< Call supervisory tone (IS-95), confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle */
+       TONE_TYPE_SUP_PIP,        /**< Call supervisory tone (IS-95), pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). */
+       TONE_TYPE_CDMA_DIAL_TONE_LITE,     /**< 425Hz continuous */
+       TONE_TYPE_CDMA_NETWORK_USA_RINGBACK,   /**< CDMA USA Ringback: 440Hz+480Hz 2s ON, 4000 OFF ...*/
+       TONE_TYPE_CDMA_INTERCEPT,      /**< CDMA Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON ...*/
+       TONE_TYPE_CDMA_ABBR_INTERCEPT,     /**< CDMA Abbr Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON */
+       TONE_TYPE_CDMA_REORDER,       /**< CDMA Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF... */
+       TONE_TYPE_CDMA_ABBR_REORDER,     /**< CDMA Abbr Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF repeated for 8 times */
+       TONE_TYPE_CDMA_NETWORK_BUSY,     /**< CDMA Network Busy tone: 480Hz+620Hz 500ms ON, 500ms OFF continuous */
+       TONE_TYPE_CDMA_CONFIRM,       /**< CDMA Confirm tone: 350Hz+440Hz 100ms ON, 100ms OFF repeated for 3 times */
+       TONE_TYPE_CDMA_ANSWER,       /**< CDMA answer tone: silent tone - definition Frequency 0, 0ms ON, 0ms OFF */
+       TONE_TYPE_CDMA_NETWORK_CALLWAITING,    /**< CDMA Network Callwaiting tone: 440Hz 300ms ON */
+       TONE_TYPE_CDMA_PIP,        /**< CDMA PIP tone: 480Hz 100ms ON, 100ms OFF repeated for 4 times */
+       TONE_TYPE_CDMA_CALL_SIGNAL_ISDN_NORMAL,   /**< ISDN Call Signal Normal tone: {2091Hz 32ms ON, 2556 64ms ON} 20 times, 2091 32ms ON, 2556 48ms ON, 4s OFF */
+       TONE_TYPE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP,  /**< ISDN Call Signal Intergroup tone: {2091Hz 32ms ON, 2556 64ms ON} 8 times, 2091Hz 32ms ON, 400ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 8times, 2091Hz 32ms ON, 4s OFF.*/
+       TONE_TYPE_CDMA_CALL_SIGNAL_ISDN_SP_PRI,   /**< ISDN Call Signal SP PRI tone:{2091Hz 32ms ON, 2556 64ms ON} 4 times 2091Hz 16ms ON, 200ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 4 times, 2091Hz 16ms ON, 200ms OFF */
+       TONE_TYPE_CDMA_CALL_SIGNAL_ISDN_PAT3,   /**< SDN Call sign PAT3 tone: silent tone */
+       TONE_TYPE_CDMA_CALL_SIGNAL_ISDN_PING_RING,  /**< ISDN Ping Ring tone: {2091Hz 32ms ON, 2556Hz 64ms ON} 5 times 2091Hz 20ms ON */
+       TONE_TYPE_CDMA_CALL_SIGNAL_ISDN_PAT5,   /**< ISDN Pat5 tone: silent tone */
+       TONE_TYPE_CDMA_CALL_SIGNAL_ISDN_PAT6,   /**< ISDN Pat6 tone: silent tone */
+       TONE_TYPE_CDMA_CALL_SIGNAL_ISDN_PAT7,   /**< ISDN Pat7 tone: silent tone */
+       TONE_TYPE_CDMA_HIGH_L,       /**< TONE_CDMA_HIGH_L tone: {3700Hz 25ms, 4000Hz 25ms} 40 times 4000ms OFF, Repeat .... */
+       TONE_TYPE_CDMA_MED_L,       /**< TONE_CDMA_MED_L tone: {2600Hz 25ms, 2900Hz 25ms} 40 times 4000ms OFF, Repeat .... */
+       TONE_TYPE_CDMA_LOW_L,       /**< TONE_CDMA_LOW_L tone: {1300Hz 25ms, 1450Hz 25ms} 40 times, 4000ms OFF, Repeat .... */
+       TONE_TYPE_CDMA_HIGH_SS,       /**< CDMA HIGH SS tone: {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 400ms OFF, repeat .... */
+       TONE_TYPE_CDMA_MED_SS,       /**< CDMA MED SS tone: {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 400ms OFF, repeat .... */
+       TONE_TYPE_CDMA_LOW_SS,       /**< CDMA LOW SS tone: {1300z 25ms, 1450Hz 25ms} repeat 16 times, 400ms OFF, repeat .... */
+       TONE_TYPE_CDMA_HIGH_SSL,       /**< CDMA HIGH SSL tone: {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... */
+       TONE_TYPE_CDMA_MED_SSL,       /**< CDMA MED SSL tone: {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... */
+       TONE_TYPE_CDMA_LOW_SSL,       /**< CDMA LOW SSL tone: {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 16 times, 4000ms OFF, repeat ... */
+       TONE_TYPE_CDMA_HIGH_SS_2,      /**< CDMA HIGH SS2 tone: {3700Hz 25ms, 4000Hz 25ms} 20 times, 1000ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 3000ms OFF, repeat .... */
+       TONE_TYPE_CDMA_MED_SS_2,       /**< CDMA MED SS2 tone: {2600Hz 25ms, 2900Hz 25ms} 20 times, 1000ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 3000ms OFF, repeat .... */
+       TONE_TYPE_CDMA_LOW_SS_2,       /**< CDMA LOW SS2 tone: {1300Hz 25ms, 1450Hz 25ms} 20 times, 1000ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 3000ms OFF, repeat .... */
+       TONE_TYPE_CDMA_HIGH_SLS,       /**< CDMA HIGH SLS tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 3000ms OFF, REPEAT */
+       TONE_TYPE_CDMA_MED_SLS,       /**< CDMA MED SLS tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 3000ms OFF, REPEAT */
+       TONE_TYPE_CDMA_LOW_SLS,       /**< CDMA LOW SLS tone: {1300Hz 25ms, 1450Hz 25ms} 10 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 10 times, 3000ms OFF, REPEAT */
+       TONE_TYPE_CDMA_HIGH_S_X4,      /**< CDMA HIGH S X4 tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 2500ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_MED_S_X4,       /**< CDMA MED S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_LOW_S_X4,       /**< CDMA LOW S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT....*/
+       TONE_TYPE_CDMA_HIGH_PBX_L,      /**< CDMA HIGH PBX L: {3700Hz 25ms, 4000Hz 25ms}20 times, 2000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_MED_PBX_L,      /**< CDMA MED PBX L: {2600Hz 25ms, 2900Hz 25ms}20 times, 2000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_LOW_PBX_L,      /**< CDMA LOW PBX L: {1300Hz 25ms,1450Hz 25ms}20 times, 2000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_HIGH_PBX_SS,      /**< CDMA HIGH PBX SS tone: {3700Hz 25ms, 4000Hz 25ms} 8 times 200 ms OFF, {3700Hz 25ms 4000Hz 25ms}8 times, 2000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_MED_PBX_SS,      /**< CDMA MED PBX SS tone: {2600Hz 25ms, 2900Hz 25ms} 8 times 200 ms OFF, {2600Hz 25ms 2900Hz 25ms}8 times, 2000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_LOW_PBX_SS,      /**< CDMA LOW PBX SS tone: {1300Hz 25ms, 1450Hz 25ms} 8 times 200 ms OFF, {1300Hz 25ms 1450Hz 25ms}8 times, 2000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_HIGH_PBX_SSL,      /**< CDMA HIGH PBX SSL tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 1000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_MED_PBX_SSL,      /**< CDMA MED PBX SSL tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 1000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_LOW_PBX_SSL,      /**< CDMA LOW PBX SSL tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 1000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_HIGH_PBX_SLS,      /**< CDMA HIGH PBX SLS tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 1000ms OFF, REPEAT....  */
+       TONE_TYPE_CDMA_MED_PBX_SLS,      /**< CDMA MED PBX SLS tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 1000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_LOW_PBX_SLS,      /**< CDMA LOW PBX SLS tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 1000ms OFF, REPEAT.... */
+       TONE_TYPE_CDMA_HIGH_PBX_S_X4,     /**< CDMA HIGH PBX X S4 tone: {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 800ms OFF, REPEAT... */
+       TONE_TYPE_CDMA_MED_PBX_S_X4,      /**< CDMA MED PBX X S4 tone: {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 800ms OFF, REPEAT... */
+       TONE_TYPE_CDMA_LOW_PBX_S_X4,      /**< CDMA LOW PBX X S4 tone: {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 800ms OFF, REPEAT... */
+       TONE_TYPE_CDMA_ALERT_NETWORK_LITE,    /**< CDMA Alert Network Lite tone: 1109Hz 62ms ON, 784Hz 62ms ON, 740Hz 62ms ON 622Hz 62ms ON, 1109Hz 62ms ON */
+       TONE_TYPE_CDMA_ALERT_AUTOREDIAL_LITE,   /**< CDMA Alert Auto Redial tone: {1245Hz 62ms ON, 659Hz 62ms ON} 3 times, 1245 62ms ON */
+       TONE_TYPE_CDMA_ONE_MIN_BEEP,      /**< CDMA One Min Beep tone: 1150Hz+770Hz 400ms ON */
+       TONE_TYPE_CDMA_KEYPAD_VOLUME_KEY_LITE,   /**< CDMA KEYPAD Volume key lite tone: 941Hz+1477Hz 120ms ON */
+       TONE_TYPE_CDMA_PRESSHOLDKEY_LITE,    /**< CDMA PRESSHOLDKEY LITE tone: 587Hz 375ms ON, 1175Hz 125ms ON */
+       TONE_TYPE_CDMA_ALERT_INCALL_LITE,     /**< CDMA ALERT INCALL LITE tone: 587Hz 62ms, 784 62ms, 831Hz 62ms, 784Hz 62ms, 1109 62ms, 784Hz 62ms, 831Hz 62ms, 784Hz 62ms*/
+       TONE_TYPE_CDMA_EMERGENCY_RINGBACK,    /**< CDMA EMERGENCY RINGBACK tone: {941Hz 125ms ON, 10ms OFF} 3times 4990ms OFF, REPEAT... */
+       TONE_TYPE_CDMA_ALERT_CALL_GUARD,    /**< CDMA ALERT CALL GUARD tone: {1319Hz 125ms ON, 125ms OFF} 3 times */
+       TONE_TYPE_CDMA_SOFT_ERROR_LITE,     /**< CDMA SOFT ERROR LITE tone: 1047Hz 125ms ON, 370Hz 125ms */
+       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_e;
+
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup CAPI_MEDIA_TONE_PLAYER_MODULE
+ * @{
+ */
+
+
+/**
+ * @brief Plays a tone.
+ *
+ * @param[in] tone     The tone type to play
+ * @param[in] type     The sound type
+ * @param[in] duration_ms      The tone duration in milliseconds\n
+ *             -1 indicates an infinite duration
+ * @param[out] id      The tone player ID ( can be set to NULL ) 
+ * 
+ * @return 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);
+
+/**
+ * @brief Stops playing the tone.
+ *
+ * @param[in] id       The tone player ID to stop
+ *
+ * @return 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_start()
+ */
+int tone_player_stop(int id);
+
+
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __TIZEN_MEDIA_TONE_PLAYER_H__ */
diff --git a/packaging/capi-media-tone-player.spec b/packaging/capi-media-tone-player.spec
new file mode 100755 (executable)
index 0000000..67471ba
--- /dev/null
@@ -0,0 +1,60 @@
+#sbs-git:slp/api/tone-player capi-media-tone-player 0.1.0 b0f7320c6e26c5aab7708be00e7f20d018e39262
+Name:       capi-media-tone-player
+Summary:    A tone player library in Tizen C API
+Version:    0.1.0
+Release:    16
+Group:      TO_BE/FILLED_IN
+License:    Apache License, Version 2.0
+Source0:    %{name}-%{version}.tar.gz
+BuildRequires:  cmake
+BuildRequires:  pkgconfig(mm-sound)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(capi-base-common)
+BuildRequires:  pkgconfig(capi-media-sound-manager)
+Requires(post): /sbin/ldconfig  
+Requires(postun): /sbin/ldconfig
+
+%description
+
+
+%package devel
+Summary:  A tone player library in Tizen C API (Development)
+Group:    TO_BE/FILLED_IN
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+
+
+
+%prep
+%setup -q
+
+
+%build
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+
+
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/usr/share/license
+cp LICENSE.APLv2.0 %{buildroot}/usr/share/license/%{name}
+
+%make_install
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%manifest capi-media-tone-player.manifest
+%{_libdir}/libcapi-media-tone-player.so.*
+%{_datadir}/license/%{name}
+
+%files devel
+%{_includedir}/media/*.h
+%{_libdir}/pkgconfig/*.pc
+%{_libdir}/libcapi-media-tone-player.so
diff --git a/src/tone_player.c b/src/tone_player.c
new file mode 100755 (executable)
index 0000000..ec81871
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+* 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. 
+*/
+
+
+
+
+#define LOG_TAG "TIZEN_N_TONE_PLAYER"
+
+#include <sound_manager.h>
+#include <tone_player.h>
+#include <mm_sound.h>
+#include <mm_sound_private.h>
+#include <stdio.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+#include <dlog.h>
+
+
+static int __convert_tone_player_error_code(const char *func, int code){
+       int ret = TONE_PLAYER_ERROR_NONE;
+       char *errorstr = NULL;
+       switch(code)
+       {
+               case MM_ERROR_NONE:
+                       ret = TONE_PLAYER_ERROR_NONE;
+                       errorstr = "ERROR_NONE";
+                       break;
+               case TONE_PLAYER_ERROR_INVALID_PARAMETER:
+               case MM_ERROR_INVALID_ARGUMENT: 
+               case MM_ERROR_SOUND_INVALID_POINTER:
+                       ret = TONE_PLAYER_ERROR_INVALID_PARAMETER;
+                       errorstr = "INVALID_PARAMETER";
+                       break;
+               case MM_ERROR_SOUND_INTERNAL:
+                       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);
+
+       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));
+}
+
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..353da53
--- /dev/null
@@ -0,0 +1,21 @@
+SET(fw_test "${fw_name}-test")
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${fw_test} REQUIRED mm-sound glib-2.0 gthread-2.0 capi-media-sound-manager)
+FOREACH(flag ${${fw_test}_CFLAGS})
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+    MESSAGE(${flag})
+ENDFOREACH()
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall")
+
+#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)
+    MESSAGE("${src_name}")
+    ADD_EXECUTABLE(${src_name} ${src})
+    TARGET_LINK_LIBRARIES(${src_name} ${fw_name} ${${fw_test}_LDFLAGS})
+ENDFOREACH()
diff --git a/test/multimedia_tone_player_test.c b/test/multimedia_tone_player_test.c
new file mode 100755 (executable)
index 0000000..01a1710
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+* 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. 
+*/
+
+
+
+#include <stdio.h>
+#include <tone_player.h>
+#include <glib.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+static GMainLoop *g_mainloop = NULL;
+static GThread *event_thread;
+
+gpointer GmainThread(gpointer data){
+       g_mainloop = g_main_loop_new (NULL, 0);
+       g_main_loop_run (g_mainloop);
+
+       return NULL;
+}
+
+void tone_play_test(){
+       int i ;
+       
+       for( i =0 ; i <= 106 ; i++){
+               printf("play %d sound\n", i);
+               tone_player_start(i, SOUND_TYPE_MEDIA ,500,NULL);
+               usleep(1000);
+
+       }
+
+//     tone_player_start(SOUND_TONE_DTMF_C, SOUND_TYPE_MEDIA ,100000,NULL);    
+       sleep(1000);
+}
+
+int main(int argc, char**argv)
+{
+       if( !g_thread_supported() )
+       {
+               g_thread_init(NULL);
+       }
+
+       GError *gerr = NULL;
+       event_thread = g_thread_create(GmainThread, NULL, 1, &gerr);
+
+       tone_play_test();
+       return 0;
+}