2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FMediaIAudioInEventListener.h
20 * @brief This is the header file for the %IAudioInEventListener interface.
22 * This header file contains the declarations of the %IAudioInEventListener interface.
25 #ifndef _FMEDIA_IAUDIO_IN_EVENT_LISTENER_H_
26 #define _FMEDIA_IAUDIO_IN_EVENT_LISTENER_H_
28 #include <FBaseRtIEventListener.h>
29 #include <FBaseByteBuffer.h>
31 namespace Tizen { namespace Media
35 * @interface IAudioInEventListener
36 * @brief This interface represents a listener that receives the %AudioIn related events.
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.
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>.
48 class _OSP_EXPORT_ IAudioInEventListener
49 : virtual public Tizen::Base::Runtime::IEventListener
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.
58 virtual ~IAudioInEventListener(void) {}
61 * Called when the device has filled up a buffer with PCM data completely.
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().
68 virtual void OnAudioInBufferIsFilled(Tizen::Base::ByteBuffer* pData) = 0;
71 * Called when an input device is interrupted by a task of higher priority than AudioIn.
75 virtual void OnAudioInInterrupted(void) = 0;
78 * Called when an interrupted input device is released.
82 virtual void OnAudioInReleased(void) = 0;
85 * Called when an audio recording focus is changed to another application.
88 * @remarks After the audio focus is being changed, the recording is stopped and the state of this instance is changed to @c AUDIOIN_STATE_STOPPED.
89 * @remarks User interaction with the device is required for an application in @c AUDIOIN_STATE_STOPPED state to resume recording. This is to avoid the occurrence of a race condition among applications that try to resume without user interaction.
90 * @remarks An application cannot start recording again even in the state of AUDIOIN_STATE_STOPPED due to other applications which have a higher priority.
93 virtual void OnAudioInAudioFocusChanged(void) {}
96 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
98 // This method is reserved and may change its name at any time without prior notice.
102 virtual void IAudioInEventListener_Reserved1(void){}
105 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
107 // This method is reserved and may change its name at any time without prior notice.
111 virtual void IAudioInEventListener_Reserved2(void){}