4 * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Sangchul Lee <sc11.lee@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.
23 * @file mm_sound_device.h
24 * @brief Application interface library for sound module.
27 * Application interface library for sound module.
30 #ifndef __MM_SOUND_DEVICE_H__
31 #define __MM_SOUND_DEVICE_H__
40 #define MAX_DEVICE_NAME_NUM 256
41 #define MAX_DEVICE_TYPE_STR_LEN 30
42 #define MAX_STREAM_ON_DEVICE 32
44 char type[MAX_DEVICE_TYPE_STR_LEN];
47 char name[MAX_DEVICE_NAME_NUM];
50 /* This is filled only when device handle is passed through callback */
51 int stream_id[MAX_STREAM_ON_DEVICE];
52 /* When this value is less than 0, should query to server-side */
55 /* For USB device from udev, if not -1 */
64 bool is_new_device_list;
65 } mm_sound_device_list_t;
68 DEVICE_IO_DIRECTION_IN = 0x1,
69 DEVICE_IO_DIRECTION_OUT = 0x2,
70 DEVICE_IO_DIRECTION_BOTH = DEVICE_IO_DIRECTION_IN | DEVICE_IO_DIRECTION_OUT,
71 } device_io_direction_e;
74 DEVICE_STATE_DEACTIVATED,
75 DEVICE_STATE_ACTIVATED,
79 DEVICE_CHANGED_INFO_STATE,
80 DEVICE_CHANGED_INFO_IO_DIRECTION,
81 } device_changed_info_e;
84 DEVICE_UPDATE_STATUS_DISCONNECTED = 0,
85 DEVICE_UPDATE_STATUS_CONNECTED,
86 DEVICE_UPDATE_STATUS_CHANGED_INFO_STATE,
87 DEVICE_UPDATE_STATUS_CHANGED_INFO_IO_DIRECTION,
88 } device_update_status_e;
91 DEVICE_TYPE_BUILTIN_SPEAKER, /**< Built-in speaker. */
92 DEVICE_TYPE_BUILTIN_RECEIVER, /**< Built-in receiver. */
93 DEVICE_TYPE_BUILTIN_MIC, /**< Built-in mic. */
94 DEVICE_TYPE_AUDIOJACK, /**< Audio jack such as headphone, headset, and so on. */
95 DEVICE_TYPE_BLUETOOTH, /**< Bluetooth */
96 DEVICE_TYPE_HDMI, /**< HDMI. */
97 DEVICE_TYPE_MIRRORING, /**< MIRRORING. */
98 DEVICE_TYPE_USB_AUDIO, /**< USB Audio. */
102 DEVICE_IO_DIRECTION_IN_FLAG = 0x0001, /**< Flag for input devices */
103 DEVICE_IO_DIRECTION_OUT_FLAG = 0x0002, /**< Flag for output devices */
104 DEVICE_IO_DIRECTION_BOTH_FLAG = 0x0004, /**< Flag for input/output devices (both directions are available) */
105 DEVICE_TYPE_INTERNAL_FLAG = 0x0010, /**< Flag for built-in devices */
106 DEVICE_TYPE_EXTERNAL_FLAG = 0x0020, /**< Flag for external devices */
107 DEVICE_STATE_DEACTIVATED_FLAG = 0x1000, /**< Flag for deactivated devices */
108 DEVICE_STATE_ACTIVATED_FLAG = 0x2000, /**< Flag for activated devices */
109 DEVICE_ALL_FLAG = 0xFFFF, /**< Flag for all devices */
113 DEVICE_IO_DIRECTION_FLAGS = 0x000F, /**< Flag for io direction */
114 DEVICE_TYPE_FLAGS = 0x00F0, /**< Flag for device type */
115 DEVICE_STATE_FLAGS = 0xF000, /**< Flag for device state */
116 } device_flags_type_e;
118 #define IS_INTERNAL_DEVICE(x_device_type) (((DEVICE_TYPE_BUILTIN_SPEAKER <= x_device_type) && (x_device_type <= DEVICE_TYPE_BUILTIN_MIC)) ? true : false)
124 #endif /* __MM_SOUND_DEVICE_H__ */