19 #define STSPLAYER_H_ |
19 #define STSPLAYER_H_ |
20 |
20 |
21 #include <mdaaudiosampleplayer.h> |
21 #include <mdaaudiosampleplayer.h> |
22 #include <systemtoneservice.h> |
22 #include <systemtoneservice.h> |
23 |
23 |
|
24 class MProEngEngine; |
|
25 class MProEngProfile; |
|
26 |
24 class MStsPlayerObserver |
27 class MStsPlayerObserver |
25 { |
28 { |
26 public: |
29 public: |
27 virtual void PlayComplete(unsigned int aContext) = 0; |
30 virtual void PlayComplete(unsigned int aContext) = 0; |
28 }; |
31 }; |
29 |
32 |
30 class CStsPlayer : private MMdaAudioPlayerCallback |
33 class CStsPlayer : private MMdaAudioPlayerCallback |
31 { |
34 { |
32 public: |
35 public: |
|
36 |
33 static CStsPlayer* CreateTonePlayer(MStsPlayerObserver& aObserver, |
37 static CStsPlayer* CreateTonePlayer(MStsPlayerObserver& aObserver, |
34 CSystemToneService::TToneType aTone, unsigned int aContext); |
38 CSystemToneService::TToneType aTone, unsigned int aContext); |
35 static CStsPlayer* CreateAlarmPlayer(MStsPlayerObserver& aObserver, |
39 static CStsPlayer* CreateAlarmPlayer(MStsPlayerObserver& aObserver, |
36 CSystemToneService::TAlarmType aAlarm, unsigned int aContext); |
40 CSystemToneService::TAlarmType aAlarm, unsigned int aContext); |
37 virtual ~CStsPlayer(); |
41 virtual ~CStsPlayer(); |
38 void Play(); |
42 void Play(); |
39 void Stop(); |
43 void Stop(); |
40 |
44 |
|
45 |
41 protected: |
46 protected: |
|
47 |
|
48 void LoadActiveProfileSettingsL(); |
|
49 void SetToneSettings(CSystemToneService::TToneType aTone); |
|
50 void SetAlarmSettings(CSystemToneService::TAlarmType aAlarm); |
42 CStsPlayer(MStsPlayerObserver& aObserver, const TDesC& aFileName, |
51 CStsPlayer(MStsPlayerObserver& aObserver, const TDesC& aFileName, |
43 int aRepeatNumberOfTimes, unsigned int aContext); |
52 int aRepeatNumberOfTimes, unsigned int aContext); |
44 bool Init(); |
53 bool Init(); |
45 |
54 |
46 private: |
55 private: |
47 void MapcInitComplete(TInt aError, |
56 void MapcInitComplete(TInt aError, |
48 const TTimeIntervalMicroSeconds& aDuration); |
57 const TTimeIntervalMicroSeconds& aDuration); |
51 MStsPlayerObserver& iObserver; |
60 MStsPlayerObserver& iObserver; |
52 CMdaAudioPlayerUtility* iPlayer; |
61 CMdaAudioPlayerUtility* iPlayer; |
53 TPtrC iFileName; |
62 TPtrC iFileName; |
54 int iRepeatNumberOfTimes; |
63 int iRepeatNumberOfTimes; |
55 unsigned int iContext; |
64 unsigned int iContext; |
|
65 |
|
66 MProEngEngine* iEngine; |
|
67 MProEngProfile* iProfile; |
|
68 |
|
69 TInt iVolume; |
|
70 TBool iWarningToneEnabled; |
|
71 TUint iAudioPreference; |
|
72 TUint iAudioPriority; |
|
73 |
56 }; |
74 }; |
57 |
75 |
58 #endif // STSPLAYER_H_ |
76 #endif // STSPLAYER_H_ |