4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, YeJin Cho <cho.yejin@samsung.com>,
7 * Seungbae Shin <seungbae.shin@samsung.com>, YoungHwan An <younghwan_.an@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 #ifndef __MM_PLAYER_SNDEFFECT_H__
24 #define __MM_PLAYER_SNDEFFECT_H__
32 #define MM_AUDIO_FILTER_EQ_BAND_MAX 8
33 #define MM_AUDIO_FILTER_CUSTOM_LEVEL_INIT 0
36 @addtogroup PLAYER_INTERNAL
41 * Enumerations of Preset Filter Type
44 MM_AUDIO_FILTER_PRESET_AUTO = 0, /**< Filter Preset type Auto */
45 MM_AUDIO_FILTER_PRESET_NORMAL, /**< Filter Preset type Normal */
46 MM_AUDIO_FILTER_PRESET_POP, /**< Filter Preset type Pop */
47 MM_AUDIO_FILTER_PRESET_ROCK, /**< Filter Preset type Rock */
48 MM_AUDIO_FILTER_PRESET_DANCE, /**< Filter Preset type Dance */
49 MM_AUDIO_FILTER_PRESET_JAZZ, /**< Filter Preset type Jazz */
50 MM_AUDIO_FILTER_PRESET_CLASSIC, /**< Filter Preset type Classic */
51 MM_AUDIO_FILTER_PRESET_VOCAL, /**< Filter Preset type Vocal */
52 MM_AUDIO_FILTER_PRESET_BASS_BOOST, /**< Filter Preset type Bass Boost */
53 MM_AUDIO_FILTER_PRESET_TREBLE_BOOST, /**< Filter Preset type Treble Boost */
54 MM_AUDIO_FILTER_PRESET_MTHEATER, /**< Filter Preset type MTheater */
55 MM_AUDIO_FILTER_PRESET_EXT, /**< Filter Preset type Externalization */
56 MM_AUDIO_FILTER_PRESET_CAFE, /**< Filter Preset type Cafe */
57 MM_AUDIO_FILTER_PRESET_CONCERT_HALL, /**< Filter Preset type Concert Hall */
58 MM_AUDIO_FILTER_PRESET_VOICE, /**< Filter Preset type Voice */
59 MM_AUDIO_FILTER_PRESET_MOVIE, /**< Filter Preset type Movie */
60 MM_AUDIO_FILTER_PRESET_VIRT51, /**< Filter Preset type Virtual 5.1 */
61 MM_AUDIO_FILTER_PRESET_NUM, /**< Number of Filter Preset type */
62 } MMAudioFilterPresetType;
65 * Enumerations of Custom Filter Type
68 MM_AUDIO_FILTER_CUSTOM_EQ = 0, /**< Filter Custom type Equalizer */
69 MM_AUDIO_FILTER_CUSTOM_3D, /**< Filter Custom type 3D */
70 MM_AUDIO_FILTER_CUSTOM_BASS, /**< Filter Custom type Bass */
71 MM_AUDIO_FILTER_CUSTOM_ROOM_SIZE, /**< Filter Custom type Room Size */
72 MM_AUDIO_FILTER_CUSTOM_REVERB_LEVEL, /**< Filter Custom type Reverb Level */
73 MM_AUDIO_FILTER_CUSTOM_CLARITY, /**< Filter Custom type Clarity */
74 MM_AUDIO_FILTER_CUSTOM_NUM, /**< Number of Filter Custom type */
75 } MMAudioFilterCustomType;
78 * Enumerations of Filter Type
81 MM_AUDIO_FILTER_TYPE_NONE,
82 MM_AUDIO_FILTER_TYPE_PRESET,
83 MM_AUDIO_FILTER_TYPE_CUSTOM,
88 * Enumerations of Output Mode
91 MM_AUDIO_FILTER_OUTPUT_SPK, /**< Speaker out */
92 MM_AUDIO_FILTER_OUTPUT_EAR /**< Earjack out */
93 } MMAudioFilterOutputMode;
97 * Structure of FilterInfo
100 MMAudioFilterType filter_type; /**< Filter type, (NONE,PRESET,CUSTOM)*/
101 MMAudioFilterPresetType preset; /**< for preset type*/
102 int *custom_ext_level_for_plugin; /**< for custom type, level value list of extension filters*/
103 int custom_eq_level[MM_AUDIO_FILTER_EQ_BAND_MAX]; /**< for custom type, EQ info*/
104 int custom_ext_level[MM_AUDIO_FILTER_CUSTOM_NUM-1]; /**< for custom type, extension filter info*/
109 * @brief Called to get each supported sound filter.
111 * @param filter_type [in] Type of filter (preset filter or custom filter).
112 * @param filter [in] Supported sound filter.
113 * @param user_data [in] Pointer of user data.
115 * @return True to continue with the next iteration of the loop, False to break outsp of the loop.
116 * @see mm_player_get_foreach_present_supported_filter_type()
118 typedef bool (*mmplayer_supported_sound_filter_cb) (int filter_type, int type, void *user_data);
121 * This function is to get supported filter type.
123 * @param hplayer [in] Handle of player.
124 * @param filter_type [in] Type of filter.
125 * @param foreach_cb [in] Callback function to be passed the result.
126 * @param user_data [in] Pointer of user data.
128 * @return This function returns zero on success, or negative value with error code.
134 int mm_player_get_foreach_present_supported_filter_type(MMHandleType player, MMAudioFilterType filter_type, mmplayer_supported_sound_filter_cb foreach_cb, void *user_data);
137 * This function is to bypass sound effect.
139 * @param hplayer [in] Handle of player.
141 * @return This function returns zero on success, or negative value with error code.
147 int mm_player_sound_filter_bypass (MMHandleType hplayer);
150 * This function is to apply preset filter.
152 * @param hplayer [in] Handle of player.
153 * @param type [in] Preset type filter.
155 * @return This function returns zero on success, or negative value with error code.
158 * @see MMAudioFilterPresetType
161 int mm_player_sound_filter_preset_apply(MMHandleType hplayer, MMAudioFilterPresetType type);
164 * This function is to apply custom filter(Equalizer and Extension filters).
166 * @param hplayer [in] Handle of player.
168 * @return This function returns zero on success, or negative value with error code.
174 int mm_player_sound_filter_custom_apply(MMHandleType hplayer);
177 * This function is to clear Equalizer custom filter.
179 * @param hplayer [in] Handle of player.
181 * @return This function returns zero on success, or negative value with error code.
187 int mm_player_sound_filter_custom_clear_eq_all(MMHandleType hplayer);
190 * This function is to clear Extension custom filters.
192 * @param hplayer [in] Handle of player.
194 * @return This function returns zero on success, or negative value with error code.
200 int mm_player_sound_filter_custom_clear_ext_all(MMHandleType hplayer);
203 * This function is to get the number of equalizer bands.
205 * @param hplayer [in] Handle of player.
206 * @param bands [out] The number of bands.
208 * @return This function returns zero on success, or negative value with error code.
214 int mm_player_sound_filter_custom_get_eq_bands_number(MMHandleType hplayer, int *bands);
217 * This function is to get the level of the custom filter.
219 * @param hplayer [in] Handle of player.
220 * @param type [in] Custom type filter.
221 * @param eq_index [in] Equalizer band index. This parameter is available only when the type is MM_AUDIO_FILTER_CUSTOM_EQ.
222 * @param level [out] The level of the custom filter.
224 * @return This function returns zero on success, or negative value with error code.
227 * @see MMAudioFilterCustomType
230 int mm_player_sound_filter_custom_get_level(MMHandleType hplayer, MMAudioFilterCustomType type, int eq_index, int *level);
233 * This function is to get range of the level of the custom filter.
235 * @param hplayer [in] Handle of player.
236 * @param type [in] Custom type filter.
237 * @param min [out] Minimal value of level.
238 * @param max [out] Maximum value of level.
240 * @return This function returns zero on success, or negative value with error code.
243 * @see MMAudioFilterCustomType
246 int mm_player_sound_filter_custom_get_level_range(MMHandleType hplayer, MMAudioFilterCustomType type, int *min, int *max);
249 * This function is to set the level of the custom filter.
251 * @param hplayer [in] Handle of player.
252 * @param type [in] Custom type filter.
253 * @param eq_index [in] Equalizer band index. This parameter is available only when the type is MM_AUDIO_FILTER_CUSTOM_EQ.
254 * @param level [in] The level of the custom filter.
256 * @return This function returns zero on success, or negative value with error code.
259 * @see MMAudioFilterCustomType
262 int mm_player_sound_filter_custom_set_level(MMHandleType hplayer, MMAudioFilterCustomType filter_custom_type, int eq_index, int level);
265 * This function is to set the bands level of equalizer custom filter using input list.
267 * @param hplayer [in] Handle of player.
268 * @param level_list [in] list of bands level of equalizer custom filter want to set.
269 * @param size [in] size of level_list.
271 * @return This function returns zero on success, or negative value with error code.
277 int mm_player_sound_filter_custom_set_level_eq_from_list(MMHandleType hplayer, int *level_list, int size);
280 * This function is to decide if the preset type filter is supported or not
282 * @param hplayer [in] Handle of player.
283 * @param filter [in] Preset type filter.
285 * @return This function returns zero on success, or negative value with error code.
291 int mm_player_is_supported_preset_filter_type(MMHandleType hplayer, MMAudioFilterPresetType filter);
294 * This function is to decide if the custom type filter is supported or not
296 * @param hplayer [in] Handle of player.
297 * @param filter [in] Custom type filter.
299 * @return This function returns zero on success, or negative value with error code.
305 int mm_player_is_supported_custom_filter_type(MMHandleType hplayer, MMAudioFilterCustomType filter);
315 #endif /* __MM_PLAYER_SNDEFFECT_H__ */