2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_SOUNDPOOL_INTERNAL_STREAM_H__
18 #define __TIZEN_SOUNDPOOL_INTERNAL_STREAM_H__
21 #include "sound_pool_private.h"
22 #include "internal/source.h"
33 * @brief Sound Pool stream type.
37 typedef struct sound_stream_s {
39 sound_source_t *parent_source;
45 sound_pool_stream_priority_policy_e priority_policy;
46 sound_pool_stream_state_e state;
47 sound_pool_stream_state_e state_previous;
53 sound_pool_stream_state_changed_cb callback;
60 sound_pool_error_e _sound_stream_create(sound_source_t *src, unsigned loop,
61 float volume, unsigned priority, sound_pool_stream_priority_policy_e priority_policy,
62 sound_pool_stream_state_changed_cb cb, void *data, sound_stream_t **stream);
64 sound_pool_error_e _sound_stream_destroy(sound_stream_t *src);
66 sound_pool_error_e _sound_stream_play(sound_stream_t *stream);
68 sound_pool_error_e _sound_stream_pause(sound_stream_t *stream);
70 sound_pool_error_e _sound_stream_resume(sound_stream_t *stream);
72 sound_pool_error_e _sound_stream_suspend(sound_stream_t *stream);
74 sound_pool_error_e _sound_stream_stop(sound_stream_t *stream);
76 sound_pool_error_e _sound_stream_set_loop(sound_stream_t *stream, unsigned loop);
78 sound_pool_error_e _sound_stream_set_volume(sound_stream_t *stream, float volume);
79 sound_pool_error_e _sound_stream_get_volume(sound_stream_t *stream, float *volume);
81 sound_pool_error_e _sound_stream_set_mute(sound_stream_t *stream, gboolean mute);
83 sound_pool_error_e _sound_stream_set_priority(sound_stream_t *stream, unsigned rank);
84 sound_pool_error_e _sound_stream_get_priority(sound_stream_t *stream, unsigned *rank);
86 sound_pool_error_e _sound_stream_set_priority_policy(sound_stream_t *stream,
87 sound_pool_stream_priority_policy_e priority_policy);
89 sound_pool_error_e _sound_stream_get_state(sound_stream_t *stream,
90 sound_pool_stream_state_e *state);
92 sound_pool_error_e _sound_stream_set_callback(sound_stream_t *stream,
93 sound_pool_stream_state_changed_cb callback, void *data);
95 sound_pool_error_e _sound_stream_send_event(sound_stream_t *stream,
96 sound_pool_stream_state_e state);
98 sound_pool_error_e _sound_pool_get_stream_by_id(sound_pool_t *pool, unsigned id,
99 sound_stream_t **stream);
102 #endif /* __cplusplus */
104 #endif /* __TIZEN_SOUNDPOOL_INTERNAL_STREAM_H__ */