40 |
40 |
41 using namespace NMusResourceApi; |
41 using namespace NMusResourceApi; |
42 using namespace MusSettingsKeys; |
42 using namespace MusSettingsKeys; |
43 |
43 |
44 |
44 |
|
45 const TInt KMusUiIntervalToPlay = 5000000; |
45 // ----------------------------------------------------------------------------- |
46 // ----------------------------------------------------------------------------- |
46 // |
47 // |
47 // ----------------------------------------------------------------------------- |
48 // ----------------------------------------------------------------------------- |
48 // |
49 // |
49 CMusUiLiveSharingController* CMusUiLiveSharingController::NewL( |
50 CMusUiLiveSharingController* CMusUiLiveSharingController::NewL( |
140 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::PlayL" ); |
142 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::PlayL" ); |
141 } |
143 } |
142 |
144 |
143 |
145 |
144 // ----------------------------------------------------------------------------- |
146 // ----------------------------------------------------------------------------- |
|
147 // When orientation changed , Camera instances has to be recreated inorder |
|
148 // to receive proper orientated frames. |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 void CMusUiLiveSharingController::RefreshCameraOrientationL() |
|
152 { |
|
153 MUS_LOG( "mus: [MUSUI ] -> CMusUiLiveSharingController::RefreshCameraOrientationL" ); |
|
154 if ( IsPlayingL() ) |
|
155 { |
|
156 MUS_LOG( "mus: [MUSUI ] -> Playing, pause/stop to restart camera" ); |
|
157 TTimeIntervalMicroSeconds32 interval( KMusUiIntervalToPlay ); |
|
158 PauseL(); |
|
159 EnableDisplayL(false); |
|
160 EnableDisplayL(true); |
|
161 User::After( interval ); |
|
162 PlayL(); |
|
163 } |
|
164 else |
|
165 { |
|
166 MUS_LOG( "mus: [MUSUI ] -> Not Playing, try display to restart camera"); |
|
167 if ( IsDisplayEnabledL() ) |
|
168 { |
|
169 //Disabling of display will cause disabling of viewfinder and in its |
|
170 //turn releasing of camera, enabling of display will recreate a camera |
|
171 //with new orientation |
|
172 MUS_LOG( "mus: [MUSUI ] -> display is enabled, disable/enable it"); |
|
173 EnableDisplayL(false); |
|
174 EnableDisplayL(true); |
|
175 } |
|
176 else |
|
177 { |
|
178 MUS_LOG( "mus: [MUSUI ] -> Not refreshing "); |
|
179 } |
|
180 } |
|
181 MUS_LOG( "mus: [MUSUI ] <- CMusUiLiveSharingController::RefreshCameraOrientationL" ); |
|
182 } |
145 // |
183 // |
146 // ----------------------------------------------------------------------------- |
184 // ----------------------------------------------------------------------------- |
147 // |
185 // |
148 void CMusUiLiveSharingController::PauseL() |
186 void CMusUiLiveSharingController::PauseL() |
149 { |
187 { |