tkchin | e54467f | 2016-03-15 16:54:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_AUDIO_DEVICE_IOS_AUDIO_SESSION_OBSERVER_H_ |
| 12 | #define MODULES_AUDIO_DEVICE_IOS_AUDIO_SESSION_OBSERVER_H_ |
tkchin | e54467f | 2016-03-15 16:54:03 -0700 | [diff] [blame] | 13 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 14 | #include "rtc_base/asyncinvoker.h" |
| 15 | #include "rtc_base/thread.h" |
tkchin | e54467f | 2016-03-15 16:54:03 -0700 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | // Observer interface for listening to AVAudioSession events. |
| 20 | class AudioSessionObserver { |
| 21 | public: |
| 22 | // Called when audio session interruption begins. |
| 23 | virtual void OnInterruptionBegin() = 0; |
| 24 | |
| 25 | // Called when audio session interruption ends. |
| 26 | virtual void OnInterruptionEnd() = 0; |
| 27 | |
| 28 | // Called when audio route changes. |
| 29 | virtual void OnValidRouteChange() = 0; |
| 30 | |
tkchin | d251196 | 2016-05-06 18:54:15 -0700 | [diff] [blame] | 31 | // Called when the ability to play or record changes. |
| 32 | virtual void OnCanPlayOrRecordChange(bool can_play_or_record) = 0; |
Tze Kwang Chin | 307a092 | 2016-03-21 13:57:40 -0700 | [diff] [blame] | 33 | |
henrika | af35f83 | 2017-06-16 13:22:13 +0200 | [diff] [blame] | 34 | virtual void OnChangedOutputVolume() = 0; |
| 35 | |
tkchin | e54467f | 2016-03-15 16:54:03 -0700 | [diff] [blame] | 36 | protected: |
| 37 | virtual ~AudioSessionObserver() {} |
| 38 | }; |
| 39 | |
| 40 | } // namespace webrtc |
| 41 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 42 | #endif // MODULES_AUDIO_DEVICE_IOS_AUDIO_SESSION_OBSERVER_H_ |