4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Jonghyuk Choi <jhchoi.choi@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __AVSYS_AUDIO_HANDLE_H__
23 #define __AVSYS_AUDIO_HANDLE_H__
26 #include "avsys-audio-logical-volume.h"
28 #define AVSYS_AUDIO_HANDLE_MAX 64 /* this is related with allocated bit size in avsys_audio_handle_info_t*/
29 #define AVSYS_AUDIO_LOCK_SLOT_MAX 4
32 AVSYS_AUDIO_PRIMARY_VOLUME_CLEAR = 0,
33 AVSYS_AUDIO_PRIMARY_VOLUME_SET
37 AVSYS_AUDIO_HANDLE_PRIORITY_TYPE_0 = 0, /**< normal */
38 AVSYS_AUDIO_HANDLE_PRIORITY_TYPE_1, /**< solo */
39 AVSYS_AUDIO_HANDLE_PRIORITY_TYPE_2, /**< solo with transition effect */
40 AVSYS_AUDIO_HANDLE_PRIORITY_TYPE_MAX,
44 AVSYS_AUDIO_HANDLE_EXT_DEV_NONE = 0x00000000,
45 AVSYS_AUDIO_HANDLE_EXT_DEV_FMRADIO = 0x00000001,
62 avsys_audio_volume_setting_t gain_setting;
63 avsys_audio_volume_t setting_vol;
64 avsys_audio_volume_t working_vol;
66 int fadeup_multiplier;
69 /* routing information */
70 char during_cp_audio;/* if this value set 1, this handle created during cp audio status (means call) */
75 /* backend specific */
77 } avsys_audio_handle_t;
80 long long int allocated;
81 int handle_amp; /* 1 for unmute, 0 for mute per each handle*/
83 int ext_device_status;
84 int volume_value[AVSYS_AUDIO_VOLUME_TYPE_MAX];
85 int primary_volume_type;
86 pid_t primary_volume_pid;
87 char handle_priority[AVSYS_AUDIO_HANDLE_MAX];
88 pid_t handlelock_pid[AVSYS_AUDIO_LOCK_SLOT_MAX];
89 avsys_audio_handle_t handles[AVSYS_AUDIO_HANDLE_MAX];
90 } avsys_audio_handle_info_t;
93 HANDLE_PTR_MODE_NORMAL,
98 int avsys_audio_handle_init(void);
99 int avsys_audio_handle_fini(void);
100 int avsys_audio_handle_reset(int *volume_value);
101 int avsys_audio_handle_dump(void);
102 int avsys_audio_handle_rejuvenation(void);
103 int avsys_audio_handle_alloc(int *handle);
104 int avsys_audio_handle_free(int handle);
105 int avsys_audio_handle_get_ptr(int handle, avsys_audio_handle_t **ptr, const int mode);
106 int avsys_audio_handle_release_ptr(int handle, const int mode);
107 int avsys_audio_handle_set_mute(int handle, int mute);
108 int avsys_audio_handle_ext_dev_set_mute(avsysaudio_ext_device_t device_type, int mute);
109 int avsys_audio_handle_ext_dev_status(avsysaudio_ext_device_t device_type, int *onoff);
110 int avsys_audio_handle_ext_dev_status_update(avsysaudio_ext_device_t device_type, int onoff);
111 int avsys_audio_handle_current_playing_volume_type(int *type);
112 int avsys_audio_handle_update_volume(avsys_audio_handle_t *p, const int volume_config);
113 int avsys_audio_handle_update_volume_by_type(const int volume_type, const int volume_value);
114 int avsys_audio_handle_set_primary_volume_type(const int pid, const int type, const int command);
115 int avsys_audio_handle_update_priority(int handle, int priority, int handle_route, int cmd);
116 int avsys_audio_handle_current_capture_status(int *on_capture);
117 #endif /* __AVSYS_AUDIO_HANDLE_H__ */