19 |
19 |
20 |
20 |
21 #include "musindicatorapi.h" |
21 #include "musindicatorapi.h" |
22 #include "musresourcefinderutil.h" |
22 #include "musresourcefinderutil.h" |
23 #include "muslogger.h" |
23 #include "muslogger.h" |
24 #include "musindicatordsa.h" |
|
25 #include "mussettings.h" |
24 #include "mussettings.h" |
26 #include "mussettingskeys.h" |
25 #include "mussettingskeys.h" |
27 #include "mussoundplayer.h" |
26 #include "mussoundplayer.h" |
28 #include "musresourceutil.h" |
27 #include "musresourceutil.h" |
29 #include <musindicator.rsg> |
28 #include <musindicator.rsg> |
80 MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::~CMusIndicatorApi" ); |
79 MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::~CMusIndicatorApi" ); |
81 |
80 |
82 Cancel(); |
81 Cancel(); |
83 delete iIndicatorWindow; |
82 delete iIndicatorWindow; |
84 delete iSoundPlayer; |
83 delete iSoundPlayer; |
85 if ( !IsSubscriber() ) |
84 |
86 { |
85 Indicator( EFalse ); |
87 Indicator( EFalse ); |
86 |
88 } |
|
89 |
87 |
90 iProperty.Close(); |
88 iProperty.Close(); |
91 |
89 |
92 MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::~CMusIndicatorApi" ); |
90 MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::~CMusIndicatorApi" ); |
93 } |
|
94 |
|
95 |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 // ----------------------------------------------------------------------------- |
|
99 // |
|
100 TBool CMusIndicatorApi::IsSubscriber() const |
|
101 { |
|
102 return !iObserver; |
|
103 } |
91 } |
104 |
92 |
105 |
93 |
106 // ----------------------------------------------------------------------------- |
94 // ----------------------------------------------------------------------------- |
107 // Indicates VS availability to user. |
95 // Indicates VS availability to user. |
110 // ----------------------------------------------------------------------------- |
98 // ----------------------------------------------------------------------------- |
111 // |
99 // |
112 EXPORT_C void CMusIndicatorApi::IndicateAvailabilityL() |
100 EXPORT_C void CMusIndicatorApi::IndicateAvailabilityL() |
113 { |
101 { |
114 MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::IndicateAvailabilityL" ) |
102 MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::IndicateAvailabilityL" ) |
115 __ASSERT_ALWAYS( !IsSubscriber(), User::Leave( KErrArgument ) ); |
|
116 |
|
117 Indicator( ETrue ); |
103 Indicator( ETrue ); |
118 |
104 |
119 if( MultimediaSharingSettings::AuditoryNotificationSettingL() == |
105 if( MultimediaSharingSettings::AuditoryNotificationSettingL() == |
120 MusSettingsKeys::EAuditoryNotificationOn ) |
106 MusSettingsKeys::EAuditoryNotificationOn ) |
121 { |
107 { |
134 // |
120 // |
135 void CMusIndicatorApi::RunL() |
121 void CMusIndicatorApi::RunL() |
136 { |
122 { |
137 MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::RunL" ) |
123 MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::RunL" ) |
138 |
124 |
139 if ( !IsSubscriber() ) |
125 |
140 { |
126 MUS_LOG( "mus: [MUSIND ] : publisher" ) |
141 MUS_LOG( "mus: [MUSIND ] : publisher" ) |
127 StartLiveSharingL(); |
142 StartLiveSharingL(); |
128 |
143 } |
|
144 else |
|
145 { |
|
146 MUS_LOG( "mus: [MUSIND ] : subscriber" ) |
|
147 ToggleIndicatorL(); |
|
148 } |
|
149 |
129 |
150 MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::RunL" ) |
130 MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::RunL" ) |
151 } |
131 } |
152 |
132 |
153 |
133 |
170 MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::StartLiveSharingL" ) |
150 MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::StartLiveSharingL" ) |
171 } |
151 } |
172 |
152 |
173 |
153 |
174 // ----------------------------------------------------------------------------- |
154 // ----------------------------------------------------------------------------- |
175 // |
|
176 // ----------------------------------------------------------------------------- |
|
177 // |
|
178 void CMusIndicatorApi::ToggleIndicatorL() |
|
179 { |
|
180 MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::ToggleIndicatorL" ) |
|
181 TInt val; |
|
182 |
|
183 |
|
184 |
|
185 User::LeaveIfError( RProperty::Get( KPSUidCoreApplicationUIs, |
|
186 KCoreAppUIsVideoSharingIndicator, |
|
187 val ) ); |
|
188 iProperty.Subscribe( iStatus ); |
|
189 SetActive(); |
|
190 |
|
191 TBool on = ( val == ECoreAppUIsVideoSharingIndicatorOn ); |
|
192 |
|
193 if ( on && !iIndicatorWindow |
|
194 && MultimediaSharingSettings::OperatorVariantSettingL() == |
|
195 MusSettingsKeys::EOperatorSpecific ) |
|
196 { |
|
197 iIndicatorWindow = CMusIndicatorDsa::NewL(); |
|
198 } |
|
199 else if ( !on ) |
|
200 { |
|
201 delete iIndicatorWindow; |
|
202 iIndicatorWindow = NULL; |
|
203 } |
|
204 else |
|
205 { |
|
206 //NOP |
|
207 } |
|
208 |
|
209 MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::ToggleIndicatorL" ) |
|
210 } |
|
211 |
|
212 |
|
213 // ----------------------------------------------------------------------------- |
|
214 // From CActive. |
155 // From CActive. |
215 // Cancels an outstanding asynchronous request. |
156 // Cancels an outstanding asynchronous request. |
216 // ----------------------------------------------------------------------------- |
157 // ----------------------------------------------------------------------------- |
217 // |
158 // |
218 void CMusIndicatorApi::DoCancel() |
159 void CMusIndicatorApi::DoCancel() |
219 { |
160 { |
220 MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::DoCancel" ) |
161 MUS_LOG( "mus: [MUSIND] <- CMusIndicatorApi::DoCancel" ) |
221 |
162 |
222 if ( IsSubscriber() ) |
163 |
223 { |
|
224 iProperty.Cancel(); |
|
225 } |
|
226 MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::DoCancel" ) |
164 MUS_LOG( "mus: [MUSIND] -> CMusIndicatorApi::DoCancel" ) |
227 } |
165 } |
228 |
166 |
229 |
167 |
230 // ----------------------------------------------------------------------------- |
168 // ----------------------------------------------------------------------------- |
280 // |
218 // |
281 void CMusIndicatorApi::ConstructL() |
219 void CMusIndicatorApi::ConstructL() |
282 { |
220 { |
283 MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::ConstructL" ) |
221 MUS_LOG( "mus: [MUSIND ] -> MusIndicatorApi::ConstructL" ) |
284 |
222 |
285 if ( IsSubscriber() ) |
223 |
286 { |
224 MUS_LOG( "mus: [MUSIND ] : publisher (called by manager)" ) |
287 MUS_LOG( "mus: [MUSIND ] : subscriber (called by aiwprovider)" ) |
225 CActiveScheduler::Add( this ); |
288 |
226 |
289 User::LeaveIfError( iProperty.Attach( KPSUidCoreApplicationUIs, |
|
290 KCoreAppUIsVideoSharingIndicator ) ); |
|
291 CActiveScheduler::Add( this ); |
|
292 iProperty.Subscribe( iStatus ); |
|
293 SetActive(); |
|
294 } |
|
295 else |
|
296 { |
|
297 MUS_LOG( "mus: [MUSIND ] : publisher (called by manager)" ) |
|
298 CActiveScheduler::Add( this ); |
|
299 } |
|
300 MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::ConstructL" ) |
227 MUS_LOG( "mus: [MUSIND ] <- MusIndicatorApi::ConstructL" ) |
301 } |
228 } |
302 |
229 |
303 |
230 |
304 // ----------------------------------------------------------------------------- |
231 // ----------------------------------------------------------------------------- |