19
|
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 |
/**
|
|
75 |
* Check Bt Accessory Status
|
|
76 |
* @
|
|
77 |
*/
|
|
78 |
void ChekcAccesoryStatusL();
|
|
79 |
|
|
80 |
public: // Functions from base classes
|
|
81 |
|
|
82 |
/**
|
|
83 |
* From MMdaAudioPlayerCallback.
|
|
84 |
* @see MMdaAudioPlayerCallback for more information.
|
|
85 |
*/
|
|
86 |
void MapcInitComplete( TInt aError,
|
|
87 |
const TTimeIntervalMicroSeconds& aDuration );
|
|
88 |
|
|
89 |
/**
|
|
90 |
* From MMdaAudioPlayerCallback
|
|
91 |
* @see MMdaAudioPlayerCallback for more information.
|
|
92 |
*/
|
|
93 |
void MapcPlayComplete( TInt aError );
|
|
94 |
|
|
95 |
private: // Constructors & Destructor
|
|
96 |
|
|
97 |
/**
|
|
98 |
* By default constructor is private.
|
|
99 |
*/
|
|
100 |
void ConstructL();
|
|
101 |
|
|
102 |
/**
|
|
103 |
* C++ default constructor.
|
|
104 |
*/
|
|
105 |
CTonePlayer();
|
|
106 |
|
|
107 |
private: // New functions
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Returns scaled volume value
|
|
111 |
* @return Volume value, range [0 - MaxVolume]
|
|
112 |
*/
|
|
113 |
TInt ScaledVolume();
|
|
114 |
|
|
115 |
private: // Data
|
|
116 |
|
|
117 |
// Audio player
|
|
118 |
CMdaAudioPlayerUtility* iAudioPlayer;
|
|
119 |
|
|
120 |
// Playback observer
|
|
121 |
MMdaAudioPlayerCallback* iObserver;
|
|
122 |
|
|
123 |
// Start sound path
|
|
124 |
HBufC* iStartSound;
|
|
125 |
|
|
126 |
// Bluetooth start sound path
|
|
127 |
HBufC* iBtStartSound;
|
|
128 |
|
|
129 |
// Confirmation sound path
|
|
130 |
HBufC* iConfirmationSound;
|
|
131 |
|
|
132 |
// Volume
|
|
133 |
TInt iVolume;
|
|
134 |
|
|
135 |
//BT Accessory flag
|
|
136 |
TBool iBTAcc;
|
|
137 |
};
|
|
138 |
|
|
139 |
#endif // VUICTONEPLAYER_H
|
|
140 |
|
|
141 |
// End of File
|