Add new API including loop count 97/219297/5 accepted/tizen/unified/20200114.130737 submit/tizen/20200113.053739
authorSangchul Lee <sc11.lee@samsung.com>
Wed, 4 Dec 2019 06:07:41 +0000 (15:07 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 6 Jan 2020 01:21:48 +0000 (10:21 +0900)
It is added as below.
 - int wav_player_start_loop(const char *path,
                            sound_stream_info_h stream_info,
                            unsigned int loop_count,
                            wav_player_playback_completed_cb callback,
                            void *user_data,
                            int *id);

The previous same function in wav_player_internal.h has been removed.

[Version] 0.3.0
[Issue Type] New feature

Change-Id: I56c7f99c8c54d96a5ea871b5ba54e8ef5ed22a48
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/wav_player.h
include/wav_player_internal.h [deleted file]
packaging/capi-media-wav-player.spec
src/wav_player.c
src/wav_player_internal.c [deleted file]
test/wav_player_test.c

index 6d1adba..8cf1251 100644 (file)
@@ -76,11 +76,11 @@ typedef void (*wav_player_playback_completed_cb)(int id, void *user_data);
  * @brief Plays a WAV file with stream information of sound-manager.
  * @since_tizen 3.0
  *
- * @remarks Voice Recognition and VOIP stream types are not supported in this API.
+ * @remarks Voice Recognition and VOIP stream types are not supported by this function.
  *
  * @param[in] path     The file path to play
  * @param[in] stream_info      The sound stream information handle
- * @param[in] callback The callback function to be invoked when a WAV file is no longer being played
+ * @param[in] callback The callback function to be invoked when the WAV file is no longer being played
  * @param[in] user_data        The user data to be passed to the callback function
  * @param[out] id      The WAV player ID (can be set to @c NULL)
  *
@@ -92,7 +92,7 @@ typedef void (*wav_player_playback_completed_cb)(int id, void *user_data);
  * @retval #WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED Not supported format
  * @retval #WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE Not supported stream type
  *
- * @post       It invokes wav_player_playback_completed_cb() when a WAV file is no longer being played.
+ * @post       It invokes wav_player_playback_completed_cb() when the WAV file is no longer being played.
  * @see wav_player_stop()
  * @see wav_player_playback_completed_cb()
  * @see sound_manager_create_stream_information()
@@ -101,6 +101,35 @@ typedef void (*wav_player_playback_completed_cb)(int id, void *user_data);
 int wav_player_start_new(const char *path, sound_stream_info_h stream_info, wav_player_playback_completed_cb callback, void *user_data, int *id);
 
 /**
+ * @brief Plays a WAV file multiple times.
+ * @since_tizen 6.0
+ *
+ * @remarks Voice Recognition and VOIP stream types are not supported by this function.
+ *
+ * @param[in] path     The file path to play
+ * @param[in] stream_info      The sound stream information handle
+ * @param[in] loop_count       The number of times the file should be played (@c 0 indicates infinite loops)
+ * @param[in] callback The callback function to be invoked when the WAV file is no longer being played
+ * @param[in] user_data        The user data to be passed to the callback function
+ * @param[out] id      The WAV player ID (can be set to @c NULL)
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #WAV_PLAYER_ERROR_NONE Successful
+ * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED Not supported format
+ * @retval #WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE Not supported stream type
+ *
+ * @post       It invokes wav_player_playback_completed_cb() when the WAV file is no longer being played.
+ * @see wav_player_stop()
+ * @see wav_player_playback_completed_cb()
+ * @see sound_manager_create_stream_information()
+ * @see sound_manager_destroy_stream_information()
+ */
+int wav_player_start_loop(const char *path, sound_stream_info_h stream_info, unsigned int loop_count, wav_player_playback_completed_cb callback, void *user_data, int *id);
+
+/**
  * @brief Stops playing the WAV file.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @param[in] id       The WAV player ID to stop
diff --git a/include/wav_player_internal.h b/include/wav_player_internal.h
deleted file mode 100644 (file)
index 6673510..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2016 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_WAV_PLAYER_INTERNAL_H__
-#define __TIZEN_MEDIA_WAV_PLAYER_INTERNAL_H__
-
-#include <tizen.h>
-#include <sound_manager.h>
-#include <wav_player.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- * @file wav_player_internal.h
- * @brief This file contains the Wav Player Internal API
- */
-
-/**
- * @addtogroup CAPI_MEDIA_WAV_PLAYER_MODULE
- * @{
- */
-
-/**
- * @internal
- * @brief Plays a WAV file with loop.
- * @since_tizen 3.0
- *
- * @param[in] path     The file path to play
- * @param[in] stream_info      The sound stream information handle
- * @param[in] loop_count       The number of loop (@c 0 = infinite)
- * @param[in] callback The callback function to be invoked when a WAV file is no longer being played
- * @param[in] user_data        The user data to be passed to the callback function
- * @param[out] id      The WAV player ID (can be set to @c NULL)
- *
- * @return @c 0 on success,
- *         otherwise a negative error value
- * @retval #WAV_PLAYER_ERROR_NONE Successful
- * @retval #WAV_PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #WAV_PLAYER_ERROR_INVALID_OPERATION Invalid operation
- * @retval #WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED Not supported format
- * @retval #WAV_PLAYER_ERROR_NOT_SUPPORTED_TYPE Not supported stream type
- *
- * @post       It invokes wav_player_playback_completed_cb() when a WAV file is no longer being played.
- * @see wav_player_stop()
- * @see wav_player_playback_completed_cb()
- * @see sound_manager_create_stream_information()
- * @see sound_manager_destroy_stream_information()
- */
-int wav_player_start_loop(const char *path, sound_stream_info_h stream_info, unsigned int loop_count, wav_player_playback_completed_cb callback, void *user_data, int *id);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TIZEN_MEDIA_WAV_PLAYER_INTERNAL_H__ */
index 865d040..5197fbe 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-wav-player
 Summary:    A wav player library in Tizen C API
-Version:    0.2.5
+Version:    0.3.0
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 45dc42d..0c53709 100755 (executable)
@@ -34,6 +34,11 @@ int wav_player_start_new(const char *path, sound_stream_info_h stream_info, wav_
        return _start_with_stream_info(path, stream_info, 1, callback, user_data, id);
 }
 
+int wav_player_start_loop(const char *path, sound_stream_info_h stream_info, unsigned int loop_count, wav_player_playback_completed_cb callback, void *user_data, int *id)
+{
+       return _start_with_stream_info(path, stream_info, loop_count, callback, user_data, id);
+}
+
 int wav_player_stop(int id)
 {
        return _convert_wav_player_error_code(__func__, mm_sound_stop_sound(id));
diff --git a/src/wav_player_internal.c b/src/wav_player_internal.c
deleted file mode 100755 (executable)
index 3adfadf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2016 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 <sound_manager.h>
-#include "wav_player.h"
-#include "wav_player_private.h"
-
-int wav_player_start_loop(const char *path, sound_stream_info_h stream_info, unsigned int loop_count, wav_player_playback_completed_cb callback, void *user_data, int *id)
-{
-       return _start_with_stream_info(path, stream_info, loop_count, callback, user_data, id);
-}
index c8f9471..76cd9e9 100644 (file)
@@ -17,7 +17,7 @@
 
 
 #include <stdio.h>
-#include <wav_player_internal.h>
+#include <wav_player.h>
 #include <sound_manager.h>
 #include <sound_manager_internal.h>
 #include <glib.h>
@@ -63,8 +63,8 @@ void wav_play_test(const char* file_path, int iterate, int stream_type)
        sound_stream_info_h stream_info;
        sound_stream_type_e type;
 
-       if (iterate <= 0 || file_path == NULL || (stream_type > 4 || stream_type < 0)) {
-               printf("invalid param, iterate(%d), file_path(%s), stream_type(%d)\n", iterate, file_path, stream_type);
+       if (file_path == NULL || (stream_type > 4 || stream_type < 0)) {
+               printf("invalid param, file_path(%s), stream_type(%d)\n", file_path, stream_type);
                return;
        }