2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_MEDIA_AUDIO_IO_IAUDIO_SESSION_EVENT_LISTENER_H__
18 #define __TIZEN_MEDIA_AUDIO_IO_IAUDIO_SESSION_EVENT_LISTENER_H__
25 #include <mm_sound_focus.h>
28 namespace tizen_media_audio {
32 * Called by ASM Thread
34 class CAudioSessionHandler;
35 class IAudioSessionEventListener {
37 enum class EInterruptCode : unsigned int {
38 INTERRUPT_COMPLETED = 0, /**< Interrupt completed */
39 INTERRUPT_BY_MEDIA, /**< Interrupted by a media application */
40 INTERRUPT_BY_CALL, /**< Interrupted by an incoming call */
41 INTERRUPT_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones */
42 INTERRUPT_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */
43 INTERRUPT_BY_ALARM, /**< Interrupted by an alarm */
44 INTERRUPT_BY_EMERGENCY, /**< Interrupted by an emergency */
45 INTERRUPT_BY_NOTIFICATION, /**< Interrupted by a notification */
49 static EInterruptCode convertInterruptedCode(int code, const char *reason_for_change);
50 virtual void onInterrupt(CAudioSessionHandler* pHandler, int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info) = 0;
51 virtual void onSignal(CAudioSessionHandler* pHandler, mm_sound_signal_name_t signal, int value) = 0;
55 } /* namespace tizen_media_audio */
58 #endif /* __TIZEN_MEDIA_AUDIO_IO_IAUDIO_SESSION_EVENT_LISTENER_H__ */