|
1 /* |
|
2 * Copyright (c) 2004-2007 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: Definition of the class that handles tone playing for the |
|
15 * VoiceUIRecognition |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef VUICTONEPLAYER_H |
|
21 #define VUICTONEPLAYER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <mdaaudiosampleplayer.h> |
|
25 |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // DATA TYPES |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CMdaAudioPlayerUtility; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Initializes and plays tones |
|
38 */ |
|
39 NONSHARABLE_CLASS( CTonePlayer ) : public CBase, |
|
40 public MMdaAudioPlayerCallback |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Two-phased constructor. |
|
46 */ |
|
47 static CTonePlayer* NewL(); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CTonePlayer(); |
|
53 |
|
54 public: // New functions |
|
55 |
|
56 /** |
|
57 * Sets the observer |
|
58 * @param aObserver The class requesting the tone callbacks |
|
59 */ |
|
60 void RegisterObserver( MMdaAudioPlayerCallback* aObserver ); |
|
61 |
|
62 /** |
|
63 * Performs initialization for playing tones |
|
64 * @param aSid The sound ID |
|
65 */ |
|
66 void InitToneL( TInt aSid ); |
|
67 |
|
68 /** |
|
69 * Plays initialized tone |
|
70 * @param aSid The sound ID |
|
71 */ |
|
72 void PlayTone( TInt aSid ); |
|
73 |
|
74 public: // Functions from base classes |
|
75 |
|
76 /** |
|
77 * From MMdaAudioPlayerCallback. |
|
78 * @see MMdaAudioPlayerCallback for more information. |
|
79 */ |
|
80 void MapcInitComplete( TInt aError, |
|
81 const TTimeIntervalMicroSeconds& aDuration ); |
|
82 |
|
83 /** |
|
84 * From MMdaAudioPlayerCallback |
|
85 * @see MMdaAudioPlayerCallback for more information. |
|
86 */ |
|
87 void MapcPlayComplete( TInt aError ); |
|
88 |
|
89 private: // Constructors & Destructor |
|
90 |
|
91 /** |
|
92 * By default constructor is private. |
|
93 */ |
|
94 void ConstructL(); |
|
95 |
|
96 /** |
|
97 * C++ default constructor. |
|
98 */ |
|
99 CTonePlayer(); |
|
100 |
|
101 private: // New functions |
|
102 |
|
103 /** |
|
104 * Returns scaled volume value |
|
105 * @return Volume value, range [0 - MaxVolume] |
|
106 */ |
|
107 TInt ScaledVolume(); |
|
108 |
|
109 private: // Data |
|
110 |
|
111 // Audio player |
|
112 CMdaAudioPlayerUtility* iAudioPlayer; |
|
113 |
|
114 // Playback observer |
|
115 MMdaAudioPlayerCallback* iObserver; |
|
116 |
|
117 // Start sound path |
|
118 HBufC* iStartSound; |
|
119 |
|
120 // Confirmation sound path |
|
121 HBufC* iConfirmationSound; |
|
122 |
|
123 // Volume |
|
124 TInt iVolume; |
|
125 }; |
|
126 |
|
127 #endif // VUICTONEPLAYER_H |
|
128 |
|
129 // End of File |