20 #define CMMAVOLUMECONTROL_H |
20 #define CMMAVOLUMECONTROL_H |
21 |
21 |
22 // INCLUDES |
22 // INCLUDES |
23 #include "cmmacontrol.h" |
23 #include "cmmacontrol.h" |
24 #include "mmmaplayerstatelistener.h" |
24 #include "mmmaplayerstatelistener.h" |
25 #include <mprofilechangeobserver.h> |
25 #include <MProfileChangeObserver.h> |
26 |
26 |
27 // CONSTANS |
27 // CONSTANS |
28 _LIT(KMMAVolumeControlName, "VolumeControl"); |
28 _LIT(KMMAVolumeControlName, "VolumeControl"); |
29 const TInt KMMAVolumeMaxLevel = 100; |
29 const TInt KMMAVolumeMaxLevel = 100; |
30 |
30 |
45 static void StaticSetLevelL(CMMAVolumeControl* aVolumeControl, |
45 static void StaticSetLevelL(CMMAVolumeControl* aVolumeControl, |
46 TInt aLevel); |
46 TInt aLevel); |
47 static void StaticGetLevelL(CMMAVolumeControl* aVolumeControl, |
47 static void StaticGetLevelL(CMMAVolumeControl* aVolumeControl, |
48 TInt* aLevel); |
48 TInt* aLevel); |
49 |
49 |
50 ~CMMAVolumeControl(); |
50 IMPORT_C ~CMMAVolumeControl(); |
51 |
51 |
52 protected: |
52 protected: |
53 CMMAVolumeControl(CMMAPlayer* aPlayer); |
53 IMPORT_C CMMAVolumeControl(CMMAPlayer* aPlayer); |
54 void ConstructBaseL(); |
54 IMPORT_C void ConstructBaseL(); |
55 |
55 |
56 /** |
56 /** |
57 * Sets the level to player. |
57 * Sets the level to player. |
58 * @param aLevel Sound level to set. |
58 * @param aLevel Sound level to set. |
59 */ |
59 */ |
64 * @return Current level. |
64 * @return Current level. |
65 */ |
65 */ |
66 virtual TInt DoGetLevelL() = 0; |
66 virtual TInt DoGetLevelL() = 0; |
67 |
67 |
68 public: // From CMMAControl |
68 public: // From CMMAControl |
69 const TDesC& ClassName() const; |
69 IMPORT_C const TDesC& ClassName() const; |
70 |
70 |
71 /** |
71 /** |
72 * Refresh volume control. |
72 * Refresh volume control. |
73 */ |
73 */ |
74 void RefreshControl(); |
74 IMPORT_C void RefreshControl(); |
75 |
75 |
76 public: // From MMMAPlayerStateListener |
76 public: // From MMMAPlayerStateListener |
77 void StateChanged(TInt aState); |
77 IMPORT_C void StateChanged(TInt aState); |
78 |
78 |
79 public: // from MProfileChangeObserver |
79 public: // from MProfileChangeObserver |
80 void HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId ); |
80 IMPORT_C void HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId ); |
81 |
81 |
82 public: // New methods |
82 public: // New methods |
83 /** |
83 /** |
84 * Adds new volume level to volume control. Actual volume level will |
84 * Adds new volume level to volume control. Actual volume level will |
85 * be calculated using all levels added to the control. |
85 * be calculated using all levels added to the control. |
103 /** |
103 /** |
104 * Sets the audio o/p preference. Based on this the profile based |
104 * Sets the audio o/p preference. Based on this the profile based |
105 * volume setting is done. |
105 * volume setting is done. |
106 */ |
106 */ |
107 IMPORT_C void SetAudioOutputPreferenceL( TInt aRoutingPreference); |
107 IMPORT_C void SetAudioOutputPreferenceL( TInt aRoutingPreference); |
|
108 |
|
109 void InitializeGlobalVolumeLevel(TInt aGlobalVolumeLevel); |
108 |
110 |
109 private: // New methods |
111 private: // New methods |
110 |
112 |
111 /** |
113 /** |
112 * Refresh volume level, basically set the volume level again. |
114 * Refresh volume level, basically set the volume level again. |
142 CProfileChangeNotifyHandler* iProfChangeNotifier; |
144 CProfileChangeNotifyHandler* iProfChangeNotifier; |
143 // Current audio o/p preference. |
145 // Current audio o/p preference. |
144 TInt iAudioOutputPreference; |
146 TInt iAudioOutputPreference; |
145 // Current profile Id. |
147 // Current profile Id. |
146 TInt iProfileId; |
148 TInt iProfileId; |
|
149 private: |
|
150 // The Global Volume level at the time when a player is created |
|
151 TInt iInitialGlobalVolumeLevel; |
147 }; |
152 }; |
148 |
153 |
149 #endif // CMMAVOLUMECONTROL_H |
154 #endif // CMMAVOLUMECONTROL_H |