1.Disconnecting call when no network 2.Support for Automatic:4dir
[apps/osp/Call.git] / inc / CallSoundManager.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                CallSoundManager.h
19  * @brief               This is the header file for the %SoundManager class.
20  *
21  * This header file contains the declarations for %SoundManager class.
22  */
23 #ifndef _PHN_SOUND_MANAGER_H_
24 #define _PHN_SOUND_MANAGER_H_
25
26 #include <FBase.h>
27 #include <FSystem.h>
28 #include <FMedia.h>
29 #include "sound_manager.h"
30 #include "vconf.h"
31 #include "vconf-keys.h"
32 #include "CallTypes.h"
33
34 using namespace Tizen::Base::Runtime;
35 /**
36  * @class SoundManager
37  * @brief This class presents sound related functionality required in call module.
38  *
39  */
40 class SoundManager
41         : public Tizen::Media::IPlayerEventListener
42         , public Tizen::Base::Runtime::ITimerEventListener
43 {
44 public:
45         SoundManager(void);
46         virtual ~SoundManager(void);
47         //start the sound manager session
48         result StartSession(void);
49         //Change the speaker status
50         result SetSpeakerStatus(bool setSpeaker);
51         //Set the sound mode for the call
52         result SetSoundMode(SoundMode soundMode);
53         void StartAlert(Tizen::Base::String& contactRingTone);
54         void StopAlert(void);
55         //set connect tone
56         void SetConnectTone(void);
57         void SetMinuteReminderTone(void);
58         void SetDisconnectTone(void);
59         result StopSession(void);
60         Timer* GetTimer();
61         bool GetLastConferenceCall();
62         void SetlastEndedConferenceCall();
63
64 protected:
65                 virtual void OnPlayerOpened(result r);
66                 virtual void OnPlayerEndOfClip(void);
67                 virtual void OnPlayerSeekCompleted(result r);
68                 virtual void OnPlayerBuffering(int percent);
69                 virtual void OnPlayerErrorOccurred(Tizen::Media::PlayerErrorReason r);
70                 virtual void OnPlayerInterrupted(void);
71                 virtual void OnPlayerReleased(void);
72                 virtual void OnTimerExpired(Timer& timer);
73
74 private:
75         bool IsEarJackConnected(void);
76
77 private:
78         //Sound manager handle
79         sound_call_session_h __pSoundCallSession;
80         //For notifying via vibrate during incoming call
81         Tizen::System::Vibrator* __pVibrator;
82         // Audio player
83         Tizen::Media::Player* __pPlayer;
84         bool __isSoundStatusOn;
85         bool __isVibrateStatusOn;
86     Timer __timer;
87         bool __lastEndedConferenceCall;
88 };
89
90 #endif /* _PHN_SOUND_MANAGER_H_ */