1 /* 2 * Copyright (c) 2021 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 BLUETOOTH_A2DP_SRC_OBSERVER_H 17 #define BLUETOOTH_A2DP_SRC_OBSERVER_H 18 19 #include "bluetooth_a2dp_audio_src_observer_stub.h" 20 #include "audio_bluetooth_manager.h" 21 22 class BluetoothA2dpSrcObserver : public OHOS::Bluetooth::BluetoothA2dpAudioSrcObserverStub { 23 public: BluetoothA2dpSrcObserver(OHOS::Bluetooth::BtA2dpAudioCallback * callbacks)24 BluetoothA2dpSrcObserver(OHOS::Bluetooth::BtA2dpAudioCallback *callbacks) : callbacks_(callbacks) {}; ~BluetoothA2dpSrcObserver()25 ~BluetoothA2dpSrcObserver() {}; 26 27 void OnConnectionStateChanged(const OHOS::bluetooth::RawAddress &device, int state); 28 void OnPlayingStatusChanged(const OHOS::bluetooth::RawAddress &device, int playingState, int error); 29 void OnConfigurationChanged 30 (const OHOS::bluetooth::RawAddress &device, const OHOS::Bluetooth::BluetoothA2dpCodecInfo &info, int error); 31 32 private: 33 OHOS::Bluetooth::BtA2dpAudioCallback *callbacks_; 34 BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(BluetoothA2dpSrcObserver); 35 }; 36 37 #endif