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 * @remarks The OnAudioInInterrupted() method is called when an application is interrupted by another application, and the OnAudioInReleased() method is called at the end of this interruption.
41 * The OnAudioInAudioFocusChanged() method is called when an application is interrupted by another application, but the end of this interruption is not notified.
42 * So, an application must handle both the events accordingly when audio switching occurs between various applications.
45 * The %IAudioInEventListener interface provides various methods that are called during the operations of AudioIn.
46 * %AudioIn captures audio data from a device in the asynchronous mode,
47 * and calls the listener's methods to pass the captured audio data.
49 * 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>.
53 class _OSP_EXPORT_ IAudioInEventListener
54 : virtual public Tizen::Base::Runtime::IEventListener
59 * This polymorphic destructor should be overridden if required. @n
60 * This way, the destructors of the derived classes are called when the destructor of this interface is called.
64 virtual ~IAudioInEventListener(void) {}
67 * Called when the device has filled up a buffer with PCM data completely.
71 * @param[in] pData A pointer to the buffer that contains the filled data @n
72 * The data address is same as the address added by AudioIn::AddBuffer().
74 virtual void OnAudioInBufferIsFilled(Tizen::Base::ByteBuffer* pData) = 0;
77 * Called when an input device is interrupted by a task of higher priority than AudioIn.
81 virtual void OnAudioInInterrupted(void) = 0;
84 * Called when an interrupted input device is released.
88 virtual void OnAudioInReleased(void) = 0;
91 * Called when the audio recording focus is changed to another application.
95 * - After the audio focus is changed, the recording is stopped and the state of this instance is changed to ::AUDIOIN_STATE_STOPPED.
96 * - User interaction with the device is required for an application in the ::AUDIOIN_STATE_STOPPED state to resume recording.
97 * This is to avoid the occurrence of a race condition among applications that try to resume without user interaction.
98 * - An application cannot start recording again even in the ::AUDIOIN_STATE_STOPPED state due to other applications which have a higher priority.
101 virtual void OnAudioInAudioFocusChanged(void) {}
104 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
106 // This method is reserved and may change its name at any time without prior notice.
110 virtual void IAudioInEventListener_Reserved1(void){}
113 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
115 // This method is reserved and may change its name at any time without prior notice.
119 virtual void IAudioInEventListener_Reserved2(void){}