change mm player apis
[platform/core/messaging/msg-service.git] / include / externals / MsgSoundPlayer.h
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd. All rights reserved
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 #ifndef MSG_SOUND_PLAYER_H
18 #define MSG_SOUND_PLAYER_H
19
20
21 /*==================================================================================================
22                                          TYPES
23 ==================================================================================================*/
24 typedef unsigned char MSG_SOUND_TYPE_T;
25
26 /*==================================================================================================
27                                          ENUMS
28 ==================================================================================================*/
29 enum _MSG_SOUND_TYPE_E
30 {
31         MSG_SOUND_PLAY_DEFAULT = 0,
32         MSG_SOUND_PLAY_USER,
33         MSG_SOUND_PLAY_EMERGENCY,
34         MSG_SOUND_PLAY_VOICEMAIL,
35 };
36
37 /*==================================================================================================
38                                 CLASS DEFINITIONS
39 ==================================================================================================*/
40 class MsgSoundPlayer {
41 public:
42         static MsgSoundPlayer* instance();
43
44         void MsgSoundPlayStart(const MSG_ADDRESS_INFO_S *pAddrInfo, MSG_SOUND_TYPE_T soundType);
45         void MsgSoundPlayStop();
46
47         int MsgStreamStart(MSG_SOUND_TYPE_T soundType);
48         void MsgStreamStop();
49
50         void MsgSoundInitRepeatAlarm();
51
52         void MsgGetRingtonePath(char *userRingtonePath, char **msg_tone_file_path_p);
53         void MsgGetPlayStatus(bool bVoiceMail, bool *bPlaySound, bool *bPlayVibration, bool *bOnCall);
54
55 private:
56         MsgSoundPlayer();
57         ~MsgSoundPlayer();
58
59         void MsgSoundPlayMelody(char *pMsgToneFilePath);
60         void MsgSoundPlayVibration(char *vibrationPath);
61
62         void MsgSoundSetRepeatAlarm();
63         void MsgSoundCreateRepeatAlarm(int RepeatTime);
64         int MsgSoundGetUnreadMsgCnt();
65         void MsgGetPlayStatus(bool bOnCall, bool bSound, bool bVibration, bool bMsgSound, bool bMsgVibration, bool *bPlaySound, bool *bPlayVibration);
66
67         static MsgSoundPlayer* pInstance;
68
69         bool bPlaying;
70         bool bVibrating;
71         bool bFeedbackInit;
72
73         int g_alarmId;
74
75         char *defaultRingtonePath;
76 };
77
78 #endif /* MSG_SOUND_PLAYER_H */
79