28 #include <MAudioOutputObserver.h> |
28 #include <MAudioOutputObserver.h> |
29 #include <AccMonitor.h> |
29 #include <AccMonitor.h> |
30 #include <AccMonitorInfo.h> |
30 #include <AccMonitorInfo.h> |
31 |
31 |
32 |
32 |
33 |
33 class CMMAVolumeControl; |
34 |
34 |
35 // CONSTANTS |
35 // CONSTANTS |
36 _LIT(KAMMSAudioOutputControl, "AudioOutputControl"); |
36 _LIT(KAMMSAudioOutputControl, "AudioOutputControl"); |
37 // CLASS DECLARATION |
37 // CLASS DECLARATION |
38 |
38 |
43 * |
43 * |
44 * |
44 * |
45 * @since X.X |
45 * @since X.X |
46 */ |
46 */ |
47 NONSHARABLE_CLASS(CAMMSAudioOutputControl) |
47 NONSHARABLE_CLASS(CAMMSAudioOutputControl) |
48 : public CAMMSControl, public MMMAPlayerStateListener ,public MAudioOutputObserver,public MAccMonitorObserver |
48 : public CAMMSControl, public MMMAPlayerStateListener , |
|
49 public MAccMonitorObserver |
49 { |
50 { |
50 public: |
51 public: |
51 // Constructors and destructor |
52 // Constructors and destructor |
52 /** |
53 /** |
53 * Two-phased constructor. |
54 * Two-phased constructor. |
122 void StateChanged(TInt aState); |
123 void StateChanged(TInt aState); |
123 |
124 |
124 |
125 |
125 public: |
126 public: |
126 // From MAudioOutputObserver |
127 // From MAudioOutputObserver |
127 void DefaultAudioOutputChanged(CAudioOutput& aAudioOutput, CAudioOutput::TAudioOutputPreference aNewDefault); |
128 |
128 void DisconnectedL(CAccMonitorInfo *aAccessoryInfo); |
129 void DisconnectedL(CAccMonitorInfo *aAccessoryInfo); |
129 void ConnectedL(CAccMonitorInfo* aAccessoryInfo); |
130 void ConnectedL(CAccMonitorInfo* aAccessoryInfo); |
130 void AccMonitorObserverError(TInt aError); |
131 void AccMonitorObserverError(TInt aError); |
131 |
132 |
132 public: |
133 public: |
150 /** |
151 /** |
151 * Symbian 2nd phase constructor. |
152 * Symbian 2nd phase constructor. |
152 */ |
153 */ |
153 void ConstructL(); |
154 void ConstructL(); |
154 |
155 |
|
156 CMMAVolumeControl* GetVolumeControl(); |
|
157 |
155 private: |
158 private: |
156 //Data |
159 //Data |
157 // Preference visible in AMMS. |
160 // Preference visible in AMMS. |
158 CAudioOutput::TAudioOutputPreference iRoutingUserPreference; |
161 CAudioOutput::TAudioOutputPreference iRoutingUserPreference; |
159 // Preference of the device changes by inserting/removing Jack. |
162 // Preference of the device changes by inserting/removing Jack. |
160 CAudioOutput::TAudioOutputPreference iDefaultDevicePreference; |
163 CAudioOutput::TAudioOutputPreference iDefaultDevicePreference; |
161 // Preference of the device changes by inserting/removing Jack. |
164 // Preference of the device changes by inserting/removing Jack. |
162 TInt iCurrentPreference; |
165 TInt iCurrentPreference; |
163 // owned |
166 // owned |
164 CAudioOutput* iAudioOutput; |
167 CAudioOutput* iAudioOutput; |
165 CMMAPlayer::TPlayerState playerState; |
168 CMMAPlayer::TPlayerState iPlayerState; |
166 //To get the peripheral attached/detached notification |
169 // Reference to volume control to set the current audio o/p preference. |
167 CAccMonitorInfo* iAccessoryInfo; |
170 // Not owning |
168 RAccMonCapabilityArray capabilityArray; |
171 CMMAVolumeControl* iVolumeControl; |
|
172 // Owning |
169 CAccMonitor *iAccMonitor; |
173 CAccMonitor *iAccMonitor; |
170 RConnectedAccessories array; |
174 RConnectedAccessories iArray; |
171 jobject iJavaAudioOutputObj; |
175 jobject iJavaAudioOutputObj; |
172 JNIEnv* iJni; |
176 JNIEnv* iJni; |
173 |
177 |
174 }; |
178 }; |
175 |
179 |