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_ISESSION_LISTENER_H
17 #define OHOS_ISESSION_LISTENER_H
18 
19 #include "iremote_broker.h"
20 #include "avsession_info.h"
21 
22 namespace OHOS::AVSession {
23 class ISessionListener : public IRemoteBroker {
24 public:
25     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.avsession.ISessionListener");
26 
27     enum {
28         LISTENER_CMD_ON_CREATE,
29         LISTENER_CMD_ON_RELEASE,
30         LISTENER_CMD_TOP_CHANGED,
31         LISTENER_CMD_AUDIO_CHECKED,
32         LISTENER_CMD_DEVICE_AVAILABLE,
33         LISTENER_CMD_DEVICE_LOG_EVENT,
34         LISTENER_CMD_DEVICE_OFFLINE,
35         LISTENER_CMD_MAX
36     };
37 
38     virtual void OnSessionCreate(const AVSessionDescriptor& descriptor) = 0;
39 
40     virtual void OnSessionRelease(const AVSessionDescriptor& descriptor) = 0;
41 
42     virtual void OnTopSessionChange(const AVSessionDescriptor& descriptor) = 0;
43 
44     virtual void OnAudioSessionChecked(const int32_t uid) = 0;
45 
46     virtual void OnDeviceAvailable(const OutputDeviceInfo& castOutputDeviceInfo) = 0;
47 
48     virtual void OnDeviceLogEvent(const DeviceLogEventCode eventId, const int64_t param) = 0;
49 
50     virtual void OnDeviceOffline(const std::string& deviceId) = 0;
51 };
52 }
53 #endif // OHOS_ISESSION_LISTENER_H
54