Tizen 2.0 Release
[framework/osp/media.git] / inc / FMediaIAudioSessionEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19 * @file                 FMediaIAudioSessionEventListener.h
20 * @brief                This is the header file for the AudioSessionEventListener interface.
21 *
22 * This header files contains all the commons things required for IAudioSessionEventListener and associated classes
23 *
24 */
25 #ifndef _FMEDIA_IAUDIO_SESSION_EVENT_LISTENER_H_
26 #define _FMEDIA_IAUDIO_SESSION_EVENT_LISTENER_H_
27
28 #include <FMediaAudioManagerTypes.h>
29 #include "FBaseRtIEventListener.h"
30
31 namespace Tizen { namespace Media
32 {
33 /**
34  * @if VISPARTNER
35  * @interface   IAudioSessionEventListener
36  * @brief               This interface provides a listener that receives events associated with the audio sessions.
37  *
38  * @since               2.0
39  *
40  * @visibility                  partner
41  *
42  * The %IAudioSessionEventListener interface specifies the methods used to notify when the application
43  *  audio session is interrupted or released.
44  *
45  * @endif
46  */
47 class _OSP_EXPORT_ IAudioSessionEventListener
48         : virtual public Tizen::Base::Runtime::IEventListener
49 {
50 public:
51         /**
52         * @if VISPARTNER
53         * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor@n
54         * of this interface is called.
55         *
56         * @since                2.0
57         *
58         *       @visibility                     partner
59         *       @endif
60         */
61         virtual ~IAudioSessionEventListener(void) { }
62
63         /**
64         * @if VISPARTNER
65         *       Called when the audio session is interrupted.
66         *
67         *       @since          2.0
68         *
69         *       @visibility                     partner
70         *       @endif
71         */
72         virtual void OnAudioSessionInterrupted(void) = 0;
73
74         /**
75         * @if VISPARTNER
76         *       Called when the interrupted session is released.
77         *
78         *       @since          2.0
79         *
80         *       @visibility                     partner
81         *       @endif
82         */
83         virtual void OnAudioSessionInterruptReleased(void) = 0;
84         /**
85         *       Called when an audio recording or playback focus is changed to another application.
86         *
87         *       @since          2.0
88         *       @remarks                After the audio focus is being changed, the playback or recording task is paused or stopped.
89         *       @remarks                An application can play or record again, but the interaction between device and user needs for doing it again. Because there is a possibility of a race condition between applications which try to play without the interaction
90         */
91         virtual void OnAudioSessionAudioFocusChanged(void) {}
92 protected:
93         //
94         // This method is for internal use only. Using this method can cause behavioral, security-related,
95         // and consistency-related issues in the application.
96         //
97         // This method is reserved and may change its name at any time without
98         // prior notice.
99         //
100         // @since               2.0
101         //
102         virtual void IAudioSessionEventListener_Reserved1(void) {}
103
104         //
105         // This method is for internal use only. Using this method can cause behavioral, security-related,
106         // and consistency-related issues in the application.
107         //
108         // This method is reserved and may change its name at any time without
109         // prior notice.
110         //
111         // @since               2.0
112         //
113         virtual void IAudioSessionEventListener_Reserved2(void) {}
114
115         //
116         // This method is for internal use only. Using this method can cause behavioral, security-related,
117         // and consistency-related issues in the application.
118         //
119         // This method is reserved and may change its name at any time without
120         // prior notice.
121         //
122         // @since               2.0
123         //
124         virtual void IAudioSessionEventListener_Reserved3(void) {}
125
126 };
127 }}      //Tizen::Media
128 #endif