ff9517acd45365fdececda3acfef415f6cabe000
[framework/osp/media.git] / inc / FMediaIAudioInEventListener.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                        FMediaIAudioInEventListener.h
20  * @brief                       This is the header file for the %IAudioInEventListener interface.
21  *
22  * This header file contains the declarations of the %IAudioInEventListener interface.
23  */
24
25 #ifndef _FMEDIA_IAUDIO_IN_EVENT_LISTENER_H_
26 #define _FMEDIA_IAUDIO_IN_EVENT_LISTENER_H_
27
28 #include <FBaseRtIEventListener.h>
29 #include <FBaseByteBuffer.h>
30
31 namespace Tizen { namespace Media
32 {
33
34 /**
35  * @interface   IAudioInEventListener
36  * @brief                       This interface represents a listener that receives the %AudioIn related events.
37  *
38  * @since               2.0
39  *
40  * The %IAudioInEventListener interface provides various methods that are called during the operations of %AudioIn.
41  * %AudioIn captures audio data from the device in asynchronous mode,
42  * and calls the listener's methods to pass the captured audio data.
43  *
44  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/recording_pcm_audio.htm">Recording PCM Audio</a>.
45  *
46  */
47
48 class _OSP_EXPORT_ IAudioInEventListener
49         : virtual public Tizen::Base::Runtime::IEventListener
50 {
51
52 public:
53         /**
54         * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
55         *
56         * @since                2.0
57         */
58         virtual ~IAudioInEventListener(void) {}
59
60         /**
61         *       Called when the device has filled up a buffer with PCM data completely.
62         *
63         * @since                2.0
64         *
65         *       @param[in]  pData       A pointer to the buffer containing the filled data @n
66         *                                                       The data address is same as the address added by AudioIn::AddBuffer().
67         */
68         virtual void OnAudioInBufferIsFilled(Tizen::Base::ByteBuffer* pData) = 0;
69
70         /**
71          *      Called when an input device is interrupted by a task of higher priority than AudioIn.
72          *
73          * @since               2.0
74          */
75         virtual void OnAudioInInterrupted(void) = 0;
76
77         /**
78          *      Called when an interrupted input device is released.
79          *
80          * @since               2.0
81          */
82         virtual void OnAudioInReleased(void) = 0;
83
84         /**
85         *   Called when an audio recording focus is changed to another application.
86         *
87         *  @since               2.0
88         *  @remarks             
89         *                               - After the audio focus is being changed, the recording is stopped and the state of this instance is changed to ::AUDIOIN_STATE_STOPPED.
90         *                               - User interaction with the device is required for an application in @c AUDIOIN_STATE_STOPPED state to resume recording. 
91         *                               This is to avoid the occurrence of a race condition among applications that try to resume without user interaction.
92         *                               - An application cannot start recording again even in the state of @c AUDIOIN_STATE_STOPPED due to other applications which have a higher priority.
93         */
94
95         virtual void OnAudioInAudioFocusChanged(void) {}
96 protected:
97         //
98         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
99         //
100         // This method is reserved and may change its name at any time without prior notice.
101         //
102         // @since               2.0
103         //
104         virtual void IAudioInEventListener_Reserved1(void){}
105
106         //
107         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
108         //
109         // This method is reserved and may change its name at any time without prior notice.
110         //
111         // @since               2.0
112         //
113         virtual void IAudioInEventListener_Reserved2(void){}
114 };
115
116 }} // Tizen::Media
117
118 #endif