|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * This file defines an interface to an System Tone Service used by the |
|
16 * STS Server for playing and stopping tones. Only one instance of this |
|
17 * class is created by the server, and it exists for the lifetime of the |
|
18 * server. This class manages all of the active players, and guarantees |
|
19 * that the context values are unique. |
|
20 */ |
|
21 |
|
22 #ifndef STS_H_ |
|
23 #define STS_H_ |
|
24 |
|
25 #include <systemtoneservice.h> |
|
26 #include <map> |
|
27 |
|
28 #include "stsplayer.h" |
|
29 |
|
30 class CSts : private MStsPlayerObserver |
|
31 { |
|
32 public: |
|
33 static CSts* Create(); |
|
34 static void Delete(CSts* aSts); |
|
35 void PlayTone(CSystemToneService::TToneType aToneType, |
|
36 unsigned int& aPlayToneContext); |
|
37 void StopTone(unsigned int aPlayToneContext); |
|
38 |
|
39 protected: |
|
40 CSts(); |
|
41 virtual ~CSts(); |
|
42 bool Init(); |
|
43 |
|
44 private: |
|
45 void CleanUpPlayers(); |
|
46 |
|
47 // inherited from MPlayerObserver |
|
48 virtual void PlayToneComplete(unsigned int aPlayToneContext); |
|
49 |
|
50 private: |
|
51 unsigned int iNextContext; |
|
52 typedef std::map<unsigned int, CStsPlayer*> TPlayerMap; |
|
53 TPlayerMap iMap; |
|
54 }; |
|
55 |
|
56 #endif //STS_H |