|
1 /* |
|
2 * Copyright (c) 2008 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: Volume control adjusts engine side volume values. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVTUIVOLUMECONTROL_H |
|
21 #define CVTUIVOLUMECONTROL_H |
|
22 |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <mvtengcommandobserver.h> |
|
26 #include <mvtengaudio.h> |
|
27 |
|
28 class MVtEngCommandHandler; |
|
29 class MVtUiEngineCommandManager; |
|
30 class CVtUiFeatureManager; |
|
31 |
|
32 |
|
33 /** |
|
34 * Volume control adjusts engine side volume values. |
|
35 * |
|
36 * @since Series 60 v5.0 |
|
37 */ |
|
38 class CVtUiVolumeControl |
|
39 : public CBase, |
|
40 private MVtEngCommandObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 // Type for volume settings. |
|
45 typedef MVtEngAudio::TVtEngOutputVolume TVolume; |
|
46 |
|
47 /** |
|
48 * Constructor. |
|
49 * |
|
50 * @param aSelfPtr optional pointer to itself. |
|
51 * @param aCommandHandler command handler. |
|
52 * @param aAudio audio interface. |
|
53 * @param aCommandManager command manager. |
|
54 * @param aFeatureManager Reference to feature manager. |
|
55 */ |
|
56 CVtUiVolumeControl( |
|
57 MVtEngCommandHandler& aCommandHandler, |
|
58 MVtEngAudio& aAudio, |
|
59 MVtUiEngineCommandManager& aCommandManager, |
|
60 CVtUiFeatureManager& aFeatureManager ); |
|
61 |
|
62 /* |
|
63 * 2nd phase constructor |
|
64 */ |
|
65 void ConstructL(); |
|
66 |
|
67 /** |
|
68 * Destructor. |
|
69 */ |
|
70 ~CVtUiVolumeControl(); |
|
71 |
|
72 public: // New functions |
|
73 |
|
74 // Adjust volume to new value |
|
75 void AdjustVolumeL( TVolume aVolume ); |
|
76 |
|
77 private: |
|
78 |
|
79 /** |
|
80 * @see MVtEngCommandObserver::HandleVTCommandPerformedL. |
|
81 */ |
|
82 virtual void HandleVTCommandPerformedL( |
|
83 TVtEngCommandId aCommand, |
|
84 const TInt aError ); |
|
85 |
|
86 // Checks if volume is changed in slider |
|
87 TBool IsVolumeChangedL(); |
|
88 |
|
89 private: |
|
90 |
|
91 // Reference to command handler. |
|
92 MVtEngCommandHandler& iCommandHandler; |
|
93 |
|
94 // Reference to audio interface. |
|
95 MVtEngAudio& iAudio; |
|
96 |
|
97 // Reference to command manager. |
|
98 MVtUiEngineCommandManager& iCommandManager; |
|
99 |
|
100 // ETrue if command is performed. |
|
101 TBool iCommandPerformed; |
|
102 |
|
103 // Volume being updated to engine. |
|
104 TVolume iVolume; |
|
105 |
|
106 // Volume pointer descriptor. |
|
107 TPtrC8 iVolumePtr; |
|
108 |
|
109 // Reference to featuremanager |
|
110 CVtUiFeatureManager& iFeatureManager; |
|
111 |
|
112 // Is control adjusting volume |
|
113 TBool iIsActive; |
|
114 }; |
|
115 |
|
116 #endif // CVtUiVolumeControl_H |
|
117 |
|
118 // End of File |