150a07fd2Sopenharmony_ci/* 250a07fd2Sopenharmony_ci * Copyright (c) 2022-2023 Huawei Device Co., Ltd. 350a07fd2Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 450a07fd2Sopenharmony_ci * you may not use this file except in compliance with the License. 550a07fd2Sopenharmony_ci * You may obtain a copy of the License at 650a07fd2Sopenharmony_ci * 750a07fd2Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 850a07fd2Sopenharmony_ci * 950a07fd2Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1050a07fd2Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1150a07fd2Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1250a07fd2Sopenharmony_ci * See the License for the specific language governing permissions and 1350a07fd2Sopenharmony_ci * limitations under the License. 1450a07fd2Sopenharmony_ci */ 1550a07fd2Sopenharmony_ci 1650a07fd2Sopenharmony_ci#ifndef OHOS_DAUDIO_AUDIO_EVENT_H 1750a07fd2Sopenharmony_ci#define OHOS_DAUDIO_AUDIO_EVENT_H 1850a07fd2Sopenharmony_ci 1950a07fd2Sopenharmony_ci#include <string> 2050a07fd2Sopenharmony_ci 2150a07fd2Sopenharmony_cinamespace OHOS { 2250a07fd2Sopenharmony_cinamespace DistributedHardware { 2350a07fd2Sopenharmony_citypedef enum { 2450a07fd2Sopenharmony_ci EVENT_UNKNOWN = 0, 2550a07fd2Sopenharmony_ci OPEN_CTRL = 1, 2650a07fd2Sopenharmony_ci CLOSE_CTRL = 2, 2750a07fd2Sopenharmony_ci CTRL_OPENED = 3, 2850a07fd2Sopenharmony_ci CTRL_CLOSED = 4, 2950a07fd2Sopenharmony_ci NOTIFY_OPEN_CTRL_RESULT = 5, 3050a07fd2Sopenharmony_ci NOTIFY_CLOSE_CTRL_RESULT = 6, 3150a07fd2Sopenharmony_ci DATA_OPENED = 7, 3250a07fd2Sopenharmony_ci DATA_CLOSED = 8, 3350a07fd2Sopenharmony_ci 3450a07fd2Sopenharmony_ci OPEN_SPEAKER = 11, 3550a07fd2Sopenharmony_ci CLOSE_SPEAKER = 12, 3650a07fd2Sopenharmony_ci SPEAKER_OPENED = 13, 3750a07fd2Sopenharmony_ci SPEAKER_CLOSED = 14, 3850a07fd2Sopenharmony_ci NOTIFY_OPEN_SPEAKER_RESULT = 15, 3950a07fd2Sopenharmony_ci NOTIFY_CLOSE_SPEAKER_RESULT = 16, 4050a07fd2Sopenharmony_ci NOTIFY_HDF_SPK_DUMP = 17, 4150a07fd2Sopenharmony_ci NOTIFY_HDF_MIC_DUMP = 18, 4250a07fd2Sopenharmony_ci 4350a07fd2Sopenharmony_ci OPEN_MIC = 21, 4450a07fd2Sopenharmony_ci CLOSE_MIC = 22, 4550a07fd2Sopenharmony_ci MIC_OPENED = 23, 4650a07fd2Sopenharmony_ci MIC_CLOSED = 24, 4750a07fd2Sopenharmony_ci NOTIFY_OPEN_MIC_RESULT = 25, 4850a07fd2Sopenharmony_ci NOTIFY_CLOSE_MIC_RESULT = 26, 4950a07fd2Sopenharmony_ci DISABLE_DEVICE = 27, 5050a07fd2Sopenharmony_ci 5150a07fd2Sopenharmony_ci VOLUME_SET = 31, 5250a07fd2Sopenharmony_ci VOLUME_GET = 32, 5350a07fd2Sopenharmony_ci VOLUME_CHANGE = 33, 5450a07fd2Sopenharmony_ci VOLUME_MIN_GET = 34, 5550a07fd2Sopenharmony_ci VOLUME_MAX_GET = 35, 5650a07fd2Sopenharmony_ci VOLUME_MUTE_SET = 36, 5750a07fd2Sopenharmony_ci 5850a07fd2Sopenharmony_ci AUDIO_FOCUS_CHANGE = 41, 5950a07fd2Sopenharmony_ci AUDIO_RENDER_STATE_CHANGE = 42, 6050a07fd2Sopenharmony_ci 6150a07fd2Sopenharmony_ci SET_PARAM = 51, 6250a07fd2Sopenharmony_ci SEND_PARAM = 52, 6350a07fd2Sopenharmony_ci 6450a07fd2Sopenharmony_ci AUDIO_ENCODER_ERR = 61, 6550a07fd2Sopenharmony_ci AUDIO_DECODER_ERR = 62, 6650a07fd2Sopenharmony_ci 6750a07fd2Sopenharmony_ci CHANGE_PLAY_STATUS = 71, 6850a07fd2Sopenharmony_ci 6950a07fd2Sopenharmony_ci MMAP_SPK_START = 81, 7050a07fd2Sopenharmony_ci MMAP_SPK_STOP = 82, 7150a07fd2Sopenharmony_ci MMAP_MIC_START = 83, 7250a07fd2Sopenharmony_ci MMAP_MIC_STOP = 84, 7350a07fd2Sopenharmony_ci AUDIO_START = 85, 7450a07fd2Sopenharmony_ci AUDIO_STOP = 86, 7550a07fd2Sopenharmony_ci} AudioEventType; 7650a07fd2Sopenharmony_ci 7750a07fd2Sopenharmony_citypedef enum { 7850a07fd2Sopenharmony_ci AUDIO_EVENT_UNKNOWN = 0, 7950a07fd2Sopenharmony_ci AUDIO_EVENT_VOLUME_SET = 1, 8050a07fd2Sopenharmony_ci AUDIO_EVENT_VOLUME_GET = 2, 8150a07fd2Sopenharmony_ci AUDIO_EVENT_VOLUME_CHANGE = 3, 8250a07fd2Sopenharmony_ci AUDIO_EVENT_OPEN_SPK_RESULT = 4, 8350a07fd2Sopenharmony_ci AUDIO_EVENT_CLOSE_SPK_RESULT = 5, 8450a07fd2Sopenharmony_ci AUDIO_EVENT_OPEN_MIC_RESULT = 6, 8550a07fd2Sopenharmony_ci AUDIO_EVENT_CLOSE_MIC_RESULT = 7, 8650a07fd2Sopenharmony_ci AUDIO_EVENT_SPK_CLOSED = 8, 8750a07fd2Sopenharmony_ci AUDIO_EVENT_MIC_CLOSED = 9, 8850a07fd2Sopenharmony_ci AUDIO_EVENT_FOCUS_CHANGE = 10, 8950a07fd2Sopenharmony_ci AUDIO_EVENT_RENDER_STATE_CHANGE = 11, 9050a07fd2Sopenharmony_ci AUDIO_EVENT_MUTE_SET = 12, 9150a07fd2Sopenharmony_ci AUDIO_EVENT_CHANGE_PLAY_STATUS = 13, 9250a07fd2Sopenharmony_ci AUDIO_EVENT_MMAP_START_SPK = 14, 9350a07fd2Sopenharmony_ci AUDIO_EVENT_MMAP_STOP_SPK = 15, 9450a07fd2Sopenharmony_ci AUDIO_EVENT_MMAP_START_MIC = 16, 9550a07fd2Sopenharmony_ci AUDIO_EVENT_MMAP_STOP_MIC = 17, 9650a07fd2Sopenharmony_ci AUDIO_EVENT_START = 18, 9750a07fd2Sopenharmony_ci AUDIO_EVENT_STOP = 19, 9850a07fd2Sopenharmony_ci AUDIO_EVENT_SPK_DUMP = 20, 9950a07fd2Sopenharmony_ci AUDIO_EVENT_MIC_DUMP = 21, 10050a07fd2Sopenharmony_ci} AudioEventHDF; 10150a07fd2Sopenharmony_ciclass AudioEvent { 10250a07fd2Sopenharmony_cipublic: 10350a07fd2Sopenharmony_ci AudioEvent() = default; 10450a07fd2Sopenharmony_ci AudioEvent(const AudioEventType t, const std::string &c) : type(t), content(c) {}; 10550a07fd2Sopenharmony_ci AudioEvent(const int32_t t, const std::string &c) : type(static_cast<AudioEventType>(t)), content(c) {}; 10650a07fd2Sopenharmony_ci ~AudioEvent() = default; 10750a07fd2Sopenharmony_ci AudioEventType type = EVENT_UNKNOWN; 10850a07fd2Sopenharmony_ci std::string content; 10950a07fd2Sopenharmony_ci}; 11050a07fd2Sopenharmony_ci} // namespace DistributedHardware 11150a07fd2Sopenharmony_ci} // namespace OHOS 11250a07fd2Sopenharmony_ci#endif // OHOS_DAUDIO_AUDIO_EVENT_H 113