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 FMediaITonePlayerEventListener.h
20 * @brief This is the header file for the %ITonePlayerEventListener interface.
22 * This header file contains the declarations of the %ITonePlayerEventListener interface.
25 #ifndef _FMEDIA_ITONE_PLAYER_EVENT_LISTENER_H_
26 #define _FMEDIA_ITONE_PLAYER_EVENT_LISTENER_H_
28 #include <FBaseRtIEventListener.h>
29 #include <FMediaTonePlayer.h>
31 namespace Tizen { namespace Media
35 * @interface ITonePlayerEventListener
36 * @brief This interface provides a listener for the tone player events.
40 * The %ITonePlayerEventListener interface specifies the methods used to notify the status of the tone player.
43 class _OSP_EXPORT_ ITonePlayerEventListener
44 : virtual public Tizen::Base::Runtime::IEventListener
48 * 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.
52 virtual ~ITonePlayerEventListener(void) {}
55 * Called when the tone player reaches the end of the tone or the end of the list of tones.
59 * @param[in] src An instance of TonePlayer that fires the event
62 virtual void OnTonePlayerEndOfTone(Tizen::Media::TonePlayer& src) = 0;
65 * Called when the tone player is interrupted by a task of higher priority than the tone player.
69 * @param[in] src An instance of TonePlayer that fires the event
72 virtual void OnTonePlayerInterrupted(Tizen::Media::TonePlayer& src) = 0;
75 * Called when the interrupted tone player is released.
79 * @param[in] src An instance of TonePlayer that fires the event
82 virtual void OnTonePlayerReleased(Tizen::Media::TonePlayer& src) = 0;
85 * Called to notify an application that an error has occurred while the tone is played.
89 * @param[in] src An instance of TonePlayer that fires the event
90 * @param[in] r The cause of the error
91 * @exception E_SYSTEM A system error has occurred.
93 virtual void OnTonePlayerErrorOccurred(Tizen::Media::TonePlayer& src, result r) = 0;
96 * Called when an audio playback focus is changed to another application.
100 * @param[in] src An instance of TonePlayer that fires the event
102 * - After the audio focus is being changed, the playback is paused and the state of this instance is changed to ::TONE_PLAYER_STATE_PAUSED.
103 * - User interaction with the device is required for an application in @c TONE_PLAYER_STATE_PAUSED state to resume playing.
104 * This is to avoid the occurrence of a race condition among applications that try to play without user interaction.
105 * - An application cannot start playback again even in the state of @c TONE_PLAYER_STATE_PAUSED due to other applications which have a higher priority.
107 virtual void OnTonePlayerAudioFocusChanged(Tizen::Media::TonePlayer& src) {}
111 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
113 // This method is reserved and may change its name at any time without prior notice.
117 virtual void ITonePlayerEventListener_Reserved1(void) {}
120 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
122 // This method is reserved and may change its name at any time without prior notice.
126 virtual void ITonePlayerEventListener_Reserved2(void) {}
129 // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
131 // This method is reserved and may change its name at any time without prior notice.
135 virtual void ITonePlayerEventListener_Reserved3(void) {}