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 FMediaIAudioOutEventListener.h
20 * @brief This is the header file for the %IAudioOutEventListener interface.
22 * This header file contains the declarations of the %IAudioOutEventListener interface.
25 #ifndef _FMEDIA_IAUDIO_OUT_EVENT_LISTENER_H_
26 #define _FMEDIA_IAUDIO_OUT_EVENT_LISTENER_H_
28 #include <FBaseRtIEventListener.h>
30 namespace Tizen { namespace Media
34 * @interface IAudioOutEventListener
35 * @brief This interface represents a listener that receives the AudioOut related events.
39 * The %IAudioOutEventListener interface represents a listener that receives the AudioOut related events. The %AudioOut class works in asynchronous mode, and when the application plays audio data with the %AudioOut class,
40 * the caller must implement this interface to receive an event from %AudioOut.
42 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/playing_pcm_audio.htm">Playing PCM Audio</a>.
45 class _OSP_EXPORT_ IAudioOutEventListener
46 : virtual public Tizen::Base::Runtime::IEventListener
51 * 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 virtual ~IAudioOutEventListener(void) {}
58 * Called when the device has written a buffer completely.
62 * @param[in] src An instance of AudioOut that fires the event
64 virtual void OnAudioOutBufferEndReached(Tizen::Media::AudioOut& src) = 0;
67 * Called when the output device is interrupted by a task of higher priority than AudioOut.
71 * @param[in] src An instance of AudioOut that fires the event
73 virtual void OnAudioOutInterrupted(Tizen::Media::AudioOut& src) = 0;
76 * Called when the interrupted output device is released.
80 * @param[in] src An instance of AudioOut that fires the event
82 virtual void OnAudioOutReleased(Tizen::Media::AudioOut& src) = 0;
85 * Called when an audio playback focus is changed to another application.
89 * @param[in] src An instance of AudioOut that fires the event
90 * @remarks After the audio focus is being changed, the playback is stopped and the state of this instance is changed to @c AUDIOOUT_STATE_STOPPED.
91 * @remarks User interaction with the device is required for an application in @c AUDIOOUT_STATE_STOPPED state to resume playing. This is to avoid the occurrence of a race condition among applications that try to start without user interaction.
92 * @remarks An application cannot start playback again even in the state of AUDIOOUT_STATE_STOPPED due to other applications which have a higher priority.
94 virtual void OnAudioOutAudioFocusChanged(Tizen::Media::AudioOut& src) {}
97 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
99 // This method is reserved and may change its name at any time without prior notice.
103 virtual void IAudioOutEventListener_Reserved1(void){}
106 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
108 // This method is reserved and may change its name at any time without prior notice.
112 virtual void IAudioOutEventListener_Reserved2(void){}