1 /* 2 * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_DAUDIO_EVENTS_H 17 #define OHOS_DAUDIO_EVENTS_H 18 19 namespace OHOS { 20 namespace DistributedHardware { 21 typedef enum AudioEventType { 22 HDF_AUDIO_DEVICE_ADD = 0x1, 23 HDF_AUDIO_DEVICE_REMOVE = 0x2, 24 HDF_AUDIO_LOAD_SUCCESS = 0x3, 25 HDF_AUDIO_LOAD_FAILURE = 0x4, 26 HDF_AUDIO_UNLOAD = 0x5, 27 HDF_AUDIO_SERVICE_VALID = 0x7, 28 HDF_AUDIO_SERVICE_INVALID = 0x8, 29 HDF_AUDIO_CAPTURE_THRESHOLD = 0x9, 30 HDF_AUDIO_EVENT_TYPE_UNKNOWN, 31 } EVENT_TYPE; 32 33 typedef enum AudioDeviceType { 34 HDF_AUDIO_LINEOUT = 0x1, 35 HDF_AUDIO_HEADPHONE = 0x2, 36 HDF_AUDIO_HEADSET = 0x4, 37 HDF_AUDIO_USB_HEADSET = 0x8, 38 HDF_AUDIO_USB_HEADPHONE = 0x10, 39 HDF_AUDIO_USBA_HEADSET = 0x20, 40 HDF_AUDIO_USBA_HEADPHONE = 0x40, 41 HDF_AUDIO_PRIMARY_DEVICE = 0x80, 42 HDF_AUDIO_USB_DEVICE = 0x100, 43 HDF_AUDIO_A2DP_DEVICE = 0x200, 44 HDF_AUDIO_DEVICE_UNKNOWN, 45 } DEVICE_TYPE; 46 47 typedef enum AudioExtParamEvent { 48 HDF_AUDIO_EVENT_PARAM_UNKNOWN = 0, 49 HDF_AUDIO_EVENT_VOLUME_SET = 1, 50 HDF_AUDIO_EVENT_VOLUME_GET = 2, 51 HDF_AUDIO_EVENT_VOLUME_CHANGE = 3, 52 HDF_AUDIO_EVENT_OPEN_SPK_RESULT = 4, 53 HDF_AUDIO_EVENT_CLOSE_SPK_RESULT = 5, 54 HDF_AUDIO_EVENT_OPEN_MIC_RESULT = 6, 55 HDF_AUDIO_EVENT_CLOSE_MIC_RESULT = 7, 56 HDF_AUDIO_EVENT_SPK_CLOSED = 8, 57 HDF_AUDIO_EVENT_MIC_CLOSED = 9, 58 HDF_AUDIO_EVENT_FOCUS_CHANGE = 10, 59 HDF_AUDIO_EVENT_RENDER_STATE_CHANGE = 11, 60 HDF_AUDIO_EVNET_MUTE_SET = 12, 61 HDF_AUDIO_EVENT_CHANGE_PLAY_STATUS = 13, 62 HDF_AUDIO_EVENT_MMAP_START = 14, 63 HDF_AUDIO_EVENT_MMAP_STOP = 15, 64 HDF_AUDIO_EVENT_MMAP_START_MIC = 16, 65 HDF_AUDIO_EVENT_MMAP_STOP_MIC = 17, 66 HDF_AUDIO_EVENT_START = 18, 67 HDF_AUDIO_EVENT_STOP = 19, 68 HDF_AUDIO_EVENT_SPK_DUMP = 20, 69 HDF_AUDIO_EVENT_MIC_DUMP = 21, 70 } EXT_PARAM_EVENT; 71 72 typedef enum AudioVolumeEvent { 73 VOLUME_EVENT_UNKNOWN = 0, 74 VOLUME_EVENT_BASE = 1, 75 VOLUME_EVENT_MIN = 2, 76 VOLUME_EVENT_MAX = 3, 77 VOLUME_EVENT_MUTE = 4, 78 } VOL_EVENT; 79 } // DistributedHardware 80 } // OHOS 81 #endif // OHOS_DAUDIO_EVENTS_H