sl@0
|
1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// Part of the MVS Application for TechView
|
sl@0
|
15 |
//
|
sl@0
|
16 |
|
sl@0
|
17 |
#include <techview/eikfnlab.h>
|
sl@0
|
18 |
#include <techview/eikcfdlg.h>
|
sl@0
|
19 |
#include <techview/eikbtgpc.h>
|
sl@0
|
20 |
#include <techview/eikdialg.h>
|
sl@0
|
21 |
#include <techview/eikon.rsg>
|
sl@0
|
22 |
#include <eikmobs.h>
|
sl@0
|
23 |
#include <coecntrl.h>
|
sl@0
|
24 |
#include <eikenv.h>
|
sl@0
|
25 |
#include "MVSAppUI.h"
|
sl@0
|
26 |
#include "MVSApp.hrh"
|
sl@0
|
27 |
#include "MVSViewTicker.h"
|
sl@0
|
28 |
#include "MVSConstants.h"
|
sl@0
|
29 |
#include "MVSVolumeDialog.h"
|
sl@0
|
30 |
#include "MVSBalanceDialog.h"
|
sl@0
|
31 |
#include "MVSRepeatDialog.h"
|
sl@0
|
32 |
#include "MVSSelectPluginsDialog.h"
|
sl@0
|
33 |
#include "MVSSaveAsDialog.h"
|
sl@0
|
34 |
#include "MVSEditMetaInfoDialog.h"
|
sl@0
|
35 |
#include "MVSConfigAudioFormatDialog.h"
|
sl@0
|
36 |
#include "MVSConfigVideoFormatDialog.h"
|
sl@0
|
37 |
#include "MVSSystemInfoDialog.h"
|
sl@0
|
38 |
#include "MVSVideoSettingDialog.h"
|
sl@0
|
39 |
#include "MVSAudioSettingDialog.h"
|
sl@0
|
40 |
#include "MVSSetPlayWindowDialog.h"
|
sl@0
|
41 |
#include "MVSViewMetaInfoDialog.h"
|
sl@0
|
42 |
#include "MVSCropDialog.h"
|
sl@0
|
43 |
#include "MVSMultipleScreenDialog.h"
|
sl@0
|
44 |
#include "MVSResourceNotifyDialog.h"
|
sl@0
|
45 |
|
sl@0
|
46 |
const TInt KMaxSupportedPlugins = 10;
|
sl@0
|
47 |
const TInt KMaxSupportedExtension = 10;
|
sl@0
|
48 |
const TInt KMaxSupportedCodecs = 10;
|
sl@0
|
49 |
const TInt KLabelCaptionMaxLength = 16;
|
sl@0
|
50 |
const TInt KTimeValueLength = 12;
|
sl@0
|
51 |
|
sl@0
|
52 |
void CMVSAppUi::ConstructL()
|
sl@0
|
53 |
{
|
sl@0
|
54 |
CEikAppUi::ConstructL();
|
sl@0
|
55 |
User::LeaveIfError(iLogs.Connect());
|
sl@0
|
56 |
iLogs.MkDirAll(KLogsPath);
|
sl@0
|
57 |
iButtons=iEikonEnv->AppUiFactory()->ToolBar();
|
sl@0
|
58 |
//Meta entry initialization
|
sl@0
|
59 |
iMetaTitle = CMMFMetaDataEntry::NewL(KTitle,Ka);
|
sl@0
|
60 |
iMetaAuthor = CMMFMetaDataEntry::NewL(KAuthor,Ka);
|
sl@0
|
61 |
iMetaCopyright = CMMFMetaDataEntry::NewL(KCopyrt,Ka);
|
sl@0
|
62 |
iMetaRevision = CMMFMetaDataEntry::NewL(KRevision,Ka);
|
sl@0
|
63 |
iMetaCategory = CMMFMetaDataEntry::NewL(KCategory,Ka);
|
sl@0
|
64 |
iMetaComments = CMMFMetaDataEntry::NewL(KComments,Ka);
|
sl@0
|
65 |
iVideoPlayAgent = CMVSVideoPlayAgent::NewL(*this);
|
sl@0
|
66 |
iAppView = CMVSAppView::NewL(ClientRect(), *iVideoPlayAgent);
|
sl@0
|
67 |
iPluginArray = new(ELeave) CDesCArrayFlat(KMaxSupportedPlugins);
|
sl@0
|
68 |
iExtArray = new(ELeave) CDesCArrayFlat(KMaxSupportedExtension);
|
sl@0
|
69 |
iCodecArray = new(ELeave) CDesCArrayFlat(KMaxSupportedCodecs);
|
sl@0
|
70 |
iAudioPlayAgent = CMVSAudioPlayAgent::NewL(*this);
|
sl@0
|
71 |
iAudioRecordAgent = CMVSAudioRecordAgent::NewL(*this);
|
sl@0
|
72 |
iVideoRecordAgent = CMVSVideoRecordAgent::NewL(*this);
|
sl@0
|
73 |
iPluginInfo=CMVSControllerPluginInfo::NewL();
|
sl@0
|
74 |
iAutoplay = EFalse;
|
sl@0
|
75 |
iMode=EIdle;
|
sl@0
|
76 |
User::LeaveIfError(iLogger.Connect());
|
sl@0
|
77 |
iLogger.CreateLog(KLogsDir,KLogsFile,EFileLoggingModeAppend);
|
sl@0
|
78 |
iSettingManager = CSettingsManager::NewL();
|
sl@0
|
79 |
iRepeatDelay = 1000000;//initial value of 1 second in microseconds.
|
sl@0
|
80 |
iPriority = 1;//default settings
|
sl@0
|
81 |
iPriorityPreference = EMdaPriorityPreferenceNone;//default settings
|
sl@0
|
82 |
iRotation = EVideoRotationNone;//default settings
|
sl@0
|
83 |
iNoRepeats = 0;
|
sl@0
|
84 |
iScreenNumber = 0;
|
sl@0
|
85 |
if(!iSettingManager->FileExists())
|
sl@0
|
86 |
{
|
sl@0
|
87 |
iSettingManager->MakeSeedIndexL();
|
sl@0
|
88 |
}
|
sl@0
|
89 |
iSettingManager->ReadGeneralSettingsL(this);
|
sl@0
|
90 |
iSelectedPluginIdx = -1;
|
sl@0
|
91 |
iMediaType = 0; //set audio media initially
|
sl@0
|
92 |
iPluginsCnt = iPluginInfo->GetPluginListL(iPluginArray,iUidArray );
|
sl@0
|
93 |
iControllerUid = TUid::Null();
|
sl@0
|
94 |
iViewTicker = CMVSViewTicker::NewL(this);
|
sl@0
|
95 |
|
sl@0
|
96 |
// Add one video control per screen
|
sl@0
|
97 |
// except for screen 0 which already has a video control
|
sl@0
|
98 |
// via the app view
|
sl@0
|
99 |
const TInt numScreens = CCoeEnv::Static()->WsSession().NumberOfScreens();
|
sl@0
|
100 |
|
sl@0
|
101 |
for(TInt i = 1; i < numScreens; ++i)
|
sl@0
|
102 |
{
|
sl@0
|
103 |
CMVSVideoControl* videoCtl = CMVSVideoControl::NewLC(*iVideoPlayAgent, i, *(CCoeEnv::Static()->RootWin(i)));
|
sl@0
|
104 |
CWsScreenDevice* screenDevice = new (ELeave) CWsScreenDevice(CCoeEnv::Static()->WsSession());
|
sl@0
|
105 |
CleanupStack::PushL(screenDevice);
|
sl@0
|
106 |
User::LeaveIfError(screenDevice->Construct(i));
|
sl@0
|
107 |
videoCtl->SetExtent(TPoint(0, 0), screenDevice->SizeInPixels());
|
sl@0
|
108 |
CleanupStack::PopAndDestroy(screenDevice);
|
sl@0
|
109 |
videoCtl->ActivateL();
|
sl@0
|
110 |
iVideoCtls.AppendL(videoCtl);
|
sl@0
|
111 |
CleanupStack::Pop(videoCtl);
|
sl@0
|
112 |
}
|
sl@0
|
113 |
|
sl@0
|
114 |
iVideoCtl = iAppView->iMainWindowControl;
|
sl@0
|
115 |
iLogger.Write(_L("Application START"));
|
sl@0
|
116 |
iSrcFName.Copy(KDefault);
|
sl@0
|
117 |
iDestFilename = KDefault;
|
sl@0
|
118 |
iRecordLimitSet = EFalse;
|
sl@0
|
119 |
iAlreadyRegistered = EFalse;
|
sl@0
|
120 |
}
|
sl@0
|
121 |
|
sl@0
|
122 |
CMVSAppUi::CMVSAppUi()
|
sl@0
|
123 |
:iVolumeOrGain(10),iNoRepeats(0),iMainWindowText(8), iMaxFileBuffer(0)
|
sl@0
|
124 |
#ifdef SYMBIAN_BUILD_GCE
|
sl@0
|
125 |
,iAutoScaleType(EAutoScaleNone),
|
sl@0
|
126 |
iAutoScaleHorizPos(EHorizontalAlignCenter),
|
sl@0
|
127 |
iAutoScaleVertPos(EVerticalAlignCenter)
|
sl@0
|
128 |
#endif
|
sl@0
|
129 |
{
|
sl@0
|
130 |
}
|
sl@0
|
131 |
|
sl@0
|
132 |
CMVSAppUi::~CMVSAppUi()
|
sl@0
|
133 |
{
|
sl@0
|
134 |
delete iAudioPlayAgent;
|
sl@0
|
135 |
delete iAudioRecordAgent;
|
sl@0
|
136 |
delete iVideoPlayAgent;
|
sl@0
|
137 |
delete iVideoRecordAgent;
|
sl@0
|
138 |
iUidArray.Close();
|
sl@0
|
139 |
iAudioUidArray.Close();
|
sl@0
|
140 |
iVideoUidArray.Close();
|
sl@0
|
141 |
iAudioPlayUidArray.Close();
|
sl@0
|
142 |
iOverlayText.Close();
|
sl@0
|
143 |
delete iPluginInfo;
|
sl@0
|
144 |
delete iPluginArray;
|
sl@0
|
145 |
delete iExtArray;
|
sl@0
|
146 |
delete iCodecArray;
|
sl@0
|
147 |
delete iMetaTitle;
|
sl@0
|
148 |
delete iMetaAuthor;
|
sl@0
|
149 |
delete iMetaCopyright;
|
sl@0
|
150 |
delete iMetaRevision;
|
sl@0
|
151 |
delete iMetaCategory;
|
sl@0
|
152 |
delete iMetaComments;
|
sl@0
|
153 |
iMainWindowText.Reset();
|
sl@0
|
154 |
if(iLogger.Handle())
|
sl@0
|
155 |
{
|
sl@0
|
156 |
iLogger.CloseLog();
|
sl@0
|
157 |
iLogger.Close();
|
sl@0
|
158 |
}
|
sl@0
|
159 |
iLogs.Close();
|
sl@0
|
160 |
delete iViewTicker;
|
sl@0
|
161 |
delete iSettingManager;
|
sl@0
|
162 |
iVideoCtls.ResetAndDestroy();
|
sl@0
|
163 |
delete iAppView;
|
sl@0
|
164 |
}
|
sl@0
|
165 |
|
sl@0
|
166 |
//All the user actvated actions in the UI is captured and handled
|
sl@0
|
167 |
//through here
|
sl@0
|
168 |
void CMVSAppUi::HandleCommandL(TInt aCommand)
|
sl@0
|
169 |
{
|
sl@0
|
170 |
TBool needsUpdating = ETrue;
|
sl@0
|
171 |
switch (aCommand)
|
sl@0
|
172 |
{
|
sl@0
|
173 |
case EMVSCmdNew:
|
sl@0
|
174 |
{
|
sl@0
|
175 |
if( iMode != EIdle )
|
sl@0
|
176 |
{
|
sl@0
|
177 |
return;//dont get into record mode,as the system is still in a previous active state,Playing/Recording.
|
sl@0
|
178 |
}
|
sl@0
|
179 |
FileOpenForRecordL();
|
sl@0
|
180 |
}
|
sl@0
|
181 |
break;
|
sl@0
|
182 |
|
sl@0
|
183 |
|
sl@0
|
184 |
case EMVSCmdOpen:
|
sl@0
|
185 |
{
|
sl@0
|
186 |
if(iState == EAudioPlaying || iState == EVideoPlaying || iState == EAudioRecording || iState == EVideoRecording || iMode == EVideoRecord || iMode == EAudioRecord)
|
sl@0
|
187 |
{
|
sl@0
|
188 |
return;//dont get into record mode,as the system is still in a previous active state,Playing/Recording.
|
sl@0
|
189 |
}
|
sl@0
|
190 |
Reset();
|
sl@0
|
191 |
FileOpenL();
|
sl@0
|
192 |
iLogger.Write(_L("Opened for Play"));
|
sl@0
|
193 |
}
|
sl@0
|
194 |
break;
|
sl@0
|
195 |
|
sl@0
|
196 |
case EMVSCmdMultiScreen:
|
sl@0
|
197 |
{
|
sl@0
|
198 |
iSetScreen->SetupDialogLD(iScreenNumber,this);
|
sl@0
|
199 |
}
|
sl@0
|
200 |
break;
|
sl@0
|
201 |
|
sl@0
|
202 |
case EMVSRegisterForNotification:
|
sl@0
|
203 |
{
|
sl@0
|
204 |
iRegisterForNotification->SetupDialogLD(this);
|
sl@0
|
205 |
}
|
sl@0
|
206 |
break;
|
sl@0
|
207 |
|
sl@0
|
208 |
case EMVSCmdSetVolume:
|
sl@0
|
209 |
{
|
sl@0
|
210 |
if((iMode == EAudioPlay) || (iMode == EVideoPlay))
|
sl@0
|
211 |
{
|
sl@0
|
212 |
iVolumeDialog->SetupDialogLD(iVolumeOrGain,0,0, ETrue, this);
|
sl@0
|
213 |
iLogger.Write(_L("volume set"));
|
sl@0
|
214 |
}
|
sl@0
|
215 |
else if((iMode == EAudioRecord)||(iMode == EVideoRecord))
|
sl@0
|
216 |
{
|
sl@0
|
217 |
iVolumeDialog->SetupDialogLD(iVolumeOrGain,0,0, EFalse, this);
|
sl@0
|
218 |
iLogger.Write(_L("gain set"));
|
sl@0
|
219 |
}
|
sl@0
|
220 |
}
|
sl@0
|
221 |
break;
|
sl@0
|
222 |
|
sl@0
|
223 |
|
sl@0
|
224 |
case EMVSCmdSetPlayBalance:
|
sl@0
|
225 |
{
|
sl@0
|
226 |
iBalanceDialog->SetupDialogLD(iBalance,this, ETrue);
|
sl@0
|
227 |
iLogger.Write(_L("Balance Set"));
|
sl@0
|
228 |
}
|
sl@0
|
229 |
break;
|
sl@0
|
230 |
|
sl@0
|
231 |
|
sl@0
|
232 |
case EMVSCmdSetRecordBalance:
|
sl@0
|
233 |
{
|
sl@0
|
234 |
iBalanceDialog->SetupDialogLD(0,this, EFalse);
|
sl@0
|
235 |
}
|
sl@0
|
236 |
break;
|
sl@0
|
237 |
|
sl@0
|
238 |
|
sl@0
|
239 |
case EMVSCmdSetRepeats:
|
sl@0
|
240 |
{
|
sl@0
|
241 |
iRepeatDialog->SetupDialogLD(iNoRepeats,iRepeatDelay, this);
|
sl@0
|
242 |
iLogger.Write(_L("Repeats Set"));
|
sl@0
|
243 |
}
|
sl@0
|
244 |
break;
|
sl@0
|
245 |
|
sl@0
|
246 |
case EMVSCmdEditMetadata:
|
sl@0
|
247 |
{
|
sl@0
|
248 |
iMetaArray.Reset();
|
sl@0
|
249 |
if(iMetaArray.Count() == 0)
|
sl@0
|
250 |
{
|
sl@0
|
251 |
InitializeMetaArrayL();
|
sl@0
|
252 |
}
|
sl@0
|
253 |
switch(iMode)
|
sl@0
|
254 |
{
|
sl@0
|
255 |
case EAudioRecord:
|
sl@0
|
256 |
case EVideoRecord:
|
sl@0
|
257 |
{
|
sl@0
|
258 |
iEditMetaInfoDialog->SetupDialogLD(iMetaArray,this);
|
sl@0
|
259 |
iLogger.Write(_L("MetaData Edited"));
|
sl@0
|
260 |
iMetaArray.Close();
|
sl@0
|
261 |
}
|
sl@0
|
262 |
break;
|
sl@0
|
263 |
|
sl@0
|
264 |
case EAudioPlay:
|
sl@0
|
265 |
case EVideoPlay:
|
sl@0
|
266 |
{
|
sl@0
|
267 |
iViewMetaInfoDialog->SetupDialogLD(iMetaArray,this);
|
sl@0
|
268 |
iLogger.Write(_L("MetaData View"));
|
sl@0
|
269 |
iMetaArray.Close();
|
sl@0
|
270 |
}
|
sl@0
|
271 |
}
|
sl@0
|
272 |
}
|
sl@0
|
273 |
break;
|
sl@0
|
274 |
|
sl@0
|
275 |
|
sl@0
|
276 |
case EMVSCmdExit:
|
sl@0
|
277 |
{
|
sl@0
|
278 |
if (iDisplayAdded)
|
sl@0
|
279 |
{
|
sl@0
|
280 |
iVideoPlayAgent->RemoveDisplayWindowL(iVideoCtl->ControlWindow());
|
sl@0
|
281 |
iVideoPlayAgent->RemoveDisplayWindowL(iVideoCtl->Pip().ControlWindow());
|
sl@0
|
282 |
iVideoPlayAgent->RemoveDisplay(iVideoCtl->ScreenNumber());
|
sl@0
|
283 |
iVideoCtl->Pip().Clear();
|
sl@0
|
284 |
iDisplayAdded = EFalse;
|
sl@0
|
285 |
}
|
sl@0
|
286 |
|
sl@0
|
287 |
iLogger.Write(_L("Application EXIT"));
|
sl@0
|
288 |
iSettingManager->WriteGeneralSettingsL(this);
|
sl@0
|
289 |
Exit();
|
sl@0
|
290 |
}
|
sl@0
|
291 |
break;
|
sl@0
|
292 |
|
sl@0
|
293 |
|
sl@0
|
294 |
case EMVSCmdPlay:
|
sl@0
|
295 |
{
|
sl@0
|
296 |
if(!iButtons->IsCommandDimmed(EMVSCmdPlay))
|
sl@0
|
297 |
{
|
sl@0
|
298 |
switch(iMode)
|
sl@0
|
299 |
{
|
sl@0
|
300 |
case EAudioPlay:
|
sl@0
|
301 |
{
|
sl@0
|
302 |
iAppView->iStatusWindowTimeControl->ResetText2L();
|
sl@0
|
303 |
SetVolumeL(iVolumeOrGain,0);
|
sl@0
|
304 |
iButtons->DimCommand(EMVSCmdRecord, ETrue);
|
sl@0
|
305 |
iButtons->DrawNow();
|
sl@0
|
306 |
if(iState == ENotReady)
|
sl@0
|
307 |
{
|
sl@0
|
308 |
FileOpenL();
|
sl@0
|
309 |
iAutoplay=ETrue;
|
sl@0
|
310 |
}
|
sl@0
|
311 |
else
|
sl@0
|
312 |
{
|
sl@0
|
313 |
iAudioPlayAgent->Play();
|
sl@0
|
314 |
iLogger.Write(_L("Playing using AudioPlayAgent"));
|
sl@0
|
315 |
}
|
sl@0
|
316 |
}
|
sl@0
|
317 |
break;
|
sl@0
|
318 |
|
sl@0
|
319 |
case EAudioRecord:
|
sl@0
|
320 |
{
|
sl@0
|
321 |
iAppView->iStatusWindowTimeControl->ResetText2L();
|
sl@0
|
322 |
SetVolumeL(iVolumeOrGain,0);
|
sl@0
|
323 |
iAudioRecordAgent->PlayL();
|
sl@0
|
324 |
iLogger.Write(_L("Playing using AudioRecordAgent"));
|
sl@0
|
325 |
}
|
sl@0
|
326 |
break;
|
sl@0
|
327 |
|
sl@0
|
328 |
case EVideoPlay:
|
sl@0
|
329 |
{
|
sl@0
|
330 |
if (iVideoPlayAgent->AudioEnabledL())
|
sl@0
|
331 |
{
|
sl@0
|
332 |
SetVolumeL(iVolumeOrGain, 0);
|
sl@0
|
333 |
}
|
sl@0
|
334 |
iButtons->DimCommand(EMVSCmdSetRepeats, ETrue);
|
sl@0
|
335 |
iButtons->DrawNow();
|
sl@0
|
336 |
|
sl@0
|
337 |
#ifdef SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS
|
sl@0
|
338 |
if (iVideoPlayAgent->SupportVideoPlayerUtility2())
|
sl@0
|
339 |
{
|
sl@0
|
340 |
PrepareVideoControlsL();
|
sl@0
|
341 |
}
|
sl@0
|
342 |
#endif // SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS
|
sl@0
|
343 |
iVideoPlayAgent->Play();
|
sl@0
|
344 |
iLogger.Write(_L("Playing using VideoPlayAgent"));
|
sl@0
|
345 |
}
|
sl@0
|
346 |
break;
|
sl@0
|
347 |
|
sl@0
|
348 |
case EIdle:
|
sl@0
|
349 |
case EVideoRecord:
|
sl@0
|
350 |
break;
|
sl@0
|
351 |
|
sl@0
|
352 |
default:
|
sl@0
|
353 |
ASSERT(EFalse);
|
sl@0
|
354 |
break;
|
sl@0
|
355 |
}
|
sl@0
|
356 |
}
|
sl@0
|
357 |
else
|
sl@0
|
358 |
{
|
sl@0
|
359 |
needsUpdating = EFalse;
|
sl@0
|
360 |
}
|
sl@0
|
361 |
}
|
sl@0
|
362 |
break;
|
sl@0
|
363 |
|
sl@0
|
364 |
|
sl@0
|
365 |
case EMVSCmdRecord:
|
sl@0
|
366 |
{
|
sl@0
|
367 |
if(!iButtons->IsCommandDimmed(EMVSCmdRecord))
|
sl@0
|
368 |
{
|
sl@0
|
369 |
switch(iMode)
|
sl@0
|
370 |
{
|
sl@0
|
371 |
case EAudioRecord:
|
sl@0
|
372 |
{
|
sl@0
|
373 |
iAudioRecordAgent->RecordL();
|
sl@0
|
374 |
iLogger.Write(_L("Recording using AudioRecordAgent"));
|
sl@0
|
375 |
iButtons->DimCommand(EMVSCmdRecord, ETrue);
|
sl@0
|
376 |
iButtons->DimCommand(EMVSCmdPlay, ETrue);
|
sl@0
|
377 |
iButtons->DrawNow();
|
sl@0
|
378 |
}
|
sl@0
|
379 |
break;
|
sl@0
|
380 |
case EVideoRecord:
|
sl@0
|
381 |
{
|
sl@0
|
382 |
//start view finder and record
|
sl@0
|
383 |
CCamera *camera = iVideoRecordAgent->Camera();
|
sl@0
|
384 |
TSize imageSize;
|
sl@0
|
385 |
camera->EnumerateCaptureSizes(imageSize,1,CCamera::EFormatFbsBitmapColor16M);
|
sl@0
|
386 |
TPoint pos = DrawBorders(imageSize);
|
sl@0
|
387 |
TRect clientRect = ClientRect();
|
sl@0
|
388 |
pos.iY += clientRect.iTl.iY;//add y-offset for menu bar
|
sl@0
|
389 |
TRect screenRect(pos,imageSize);
|
sl@0
|
390 |
TRect clipRect = screenRect ;
|
sl@0
|
391 |
if (!camera->ViewFinderActive())
|
sl@0
|
392 |
{
|
sl@0
|
393 |
CCoeEnv *coenv = iAppView->iMainWindowControl->ControlEnv();
|
sl@0
|
394 |
camera->StartViewFinderDirectL( coenv->WsSession(),
|
sl@0
|
395 |
*coenv->ScreenDevice(),
|
sl@0
|
396 |
*iAppView->DrawableWindow(),
|
sl@0
|
397 |
screenRect,
|
sl@0
|
398 |
clipRect);
|
sl@0
|
399 |
}
|
sl@0
|
400 |
if (!iFileReplace)
|
sl@0
|
401 |
{
|
sl@0
|
402 |
SetVideoFrameRateL(iVideoFrameRate);
|
sl@0
|
403 |
SetVideoFrameSizeL(iFrameSize);
|
sl@0
|
404 |
SetAudioEnabledL(iAudioEnabled);
|
sl@0
|
405 |
}
|
sl@0
|
406 |
iVideoRecordAgent->Record();
|
sl@0
|
407 |
iLogger.Write(_L("Recording using VideoRecordAgent"));
|
sl@0
|
408 |
iButtons->DimCommand(EMVSCmdRecord, ETrue);
|
sl@0
|
409 |
iButtons->DimCommand(EMVSCmdPlay, ETrue);
|
sl@0
|
410 |
iButtons->DrawNow();
|
sl@0
|
411 |
}
|
sl@0
|
412 |
break;
|
sl@0
|
413 |
default:
|
sl@0
|
414 |
ASSERT(EFalse);
|
sl@0
|
415 |
break;
|
sl@0
|
416 |
}
|
sl@0
|
417 |
}
|
sl@0
|
418 |
else
|
sl@0
|
419 |
{
|
sl@0
|
420 |
needsUpdating = EFalse;
|
sl@0
|
421 |
}
|
sl@0
|
422 |
}
|
sl@0
|
423 |
break;
|
sl@0
|
424 |
|
sl@0
|
425 |
|
sl@0
|
426 |
case EMVSCmdPause:
|
sl@0
|
427 |
{
|
sl@0
|
428 |
if(!iButtons->IsCommandDimmed(EMVSCmdPause))
|
sl@0
|
429 |
{
|
sl@0
|
430 |
switch(iMode)
|
sl@0
|
431 |
{
|
sl@0
|
432 |
case EAudioPlay:
|
sl@0
|
433 |
{
|
sl@0
|
434 |
iAudioPlayAgent->Pause();
|
sl@0
|
435 |
iLogger.Write(_L("AudioPlayAgent Paused"));
|
sl@0
|
436 |
iButtons->DimCommand(EMVSCmdPlay, EFalse);
|
sl@0
|
437 |
iButtons->DrawNow();
|
sl@0
|
438 |
}
|
sl@0
|
439 |
break;
|
sl@0
|
440 |
|
sl@0
|
441 |
case EAudioRecord:
|
sl@0
|
442 |
{
|
sl@0
|
443 |
User::InfoPrint(KNotsupported);
|
sl@0
|
444 |
}
|
sl@0
|
445 |
break;
|
sl@0
|
446 |
|
sl@0
|
447 |
case EVideoPlay:
|
sl@0
|
448 |
{
|
sl@0
|
449 |
iVideoPlayAgent->PauseL();
|
sl@0
|
450 |
iLogger.Write(_L("AudioPlayAgent Paused"));
|
sl@0
|
451 |
iButtons->DimCommand(EMVSCmdPlay, EFalse);
|
sl@0
|
452 |
iButtons->DrawNow();
|
sl@0
|
453 |
}
|
sl@0
|
454 |
break;
|
sl@0
|
455 |
|
sl@0
|
456 |
case EVideoRecord:
|
sl@0
|
457 |
{
|
sl@0
|
458 |
iVideoRecordAgent->PauseL();
|
sl@0
|
459 |
iLogger.Write(_L("VideoRecordAgent Paused"));
|
sl@0
|
460 |
iButtons->DimCommand(EMVSCmdRecord, EFalse);
|
sl@0
|
461 |
iButtons->DrawNow();
|
sl@0
|
462 |
}
|
sl@0
|
463 |
break;
|
sl@0
|
464 |
|
sl@0
|
465 |
case EIdle:
|
sl@0
|
466 |
break;
|
sl@0
|
467 |
|
sl@0
|
468 |
default:
|
sl@0
|
469 |
ASSERT(EFalse);
|
sl@0
|
470 |
break;
|
sl@0
|
471 |
}
|
sl@0
|
472 |
}
|
sl@0
|
473 |
else
|
sl@0
|
474 |
{
|
sl@0
|
475 |
needsUpdating = EFalse;
|
sl@0
|
476 |
}
|
sl@0
|
477 |
}
|
sl@0
|
478 |
break;
|
sl@0
|
479 |
|
sl@0
|
480 |
|
sl@0
|
481 |
case EMVSCmdStop:
|
sl@0
|
482 |
{
|
sl@0
|
483 |
if(!iButtons->IsCommandDimmed(EMVSCmdStop))
|
sl@0
|
484 |
{
|
sl@0
|
485 |
switch(iMode)
|
sl@0
|
486 |
{
|
sl@0
|
487 |
case EAudioPlay:
|
sl@0
|
488 |
{
|
sl@0
|
489 |
iAudioPlayAgent->Stop();
|
sl@0
|
490 |
iLogger.Write(_L("AudioPlayAgent Stopped"));
|
sl@0
|
491 |
iButtons->DimCommand(EMVSCmdPlay, EFalse);
|
sl@0
|
492 |
iButtons->DrawNow();
|
sl@0
|
493 |
}
|
sl@0
|
494 |
break;
|
sl@0
|
495 |
|
sl@0
|
496 |
case EAudioRecord:
|
sl@0
|
497 |
{
|
sl@0
|
498 |
iAudioRecordAgent->Stop();
|
sl@0
|
499 |
iLogger.Write(_L("AudioRecordAgent Stopped"));
|
sl@0
|
500 |
iButtons->DimCommand(EMVSCmdRecord, EFalse);
|
sl@0
|
501 |
iButtons->DrawNow();
|
sl@0
|
502 |
iButtons->DimCommand(EMVSCmdPlay, EFalse);
|
sl@0
|
503 |
iButtons->DrawNow();
|
sl@0
|
504 |
}
|
sl@0
|
505 |
break;
|
sl@0
|
506 |
|
sl@0
|
507 |
case EVideoPlay:
|
sl@0
|
508 |
{
|
sl@0
|
509 |
iVideoPlayAgent->Stop();
|
sl@0
|
510 |
iLogger.Write(_L("VideoPlayAgent Stopped"));
|
sl@0
|
511 |
iButtons->DimCommand(EMVSCmdPlay, EFalse);
|
sl@0
|
512 |
iButtons->DrawNow();
|
sl@0
|
513 |
iAppView->DrawNow();
|
sl@0
|
514 |
}
|
sl@0
|
515 |
break;
|
sl@0
|
516 |
|
sl@0
|
517 |
case EVideoRecord:
|
sl@0
|
518 |
{
|
sl@0
|
519 |
StopViewFinder();
|
sl@0
|
520 |
iVideoRecordAgent->Stop();
|
sl@0
|
521 |
iLogger.Write(_L("VideoRecordAgent Stopped"));
|
sl@0
|
522 |
iButtons->DimCommand(EMVSCmdRecord, EFalse);
|
sl@0
|
523 |
iButtons->DrawNow();
|
sl@0
|
524 |
}
|
sl@0
|
525 |
break;
|
sl@0
|
526 |
|
sl@0
|
527 |
case EIdle:
|
sl@0
|
528 |
break;
|
sl@0
|
529 |
|
sl@0
|
530 |
default:
|
sl@0
|
531 |
ASSERT(EFalse);
|
sl@0
|
532 |
break;
|
sl@0
|
533 |
}
|
sl@0
|
534 |
}
|
sl@0
|
535 |
else
|
sl@0
|
536 |
{
|
sl@0
|
537 |
needsUpdating = EFalse;
|
sl@0
|
538 |
}
|
sl@0
|
539 |
}
|
sl@0
|
540 |
break;
|
sl@0
|
541 |
|
sl@0
|
542 |
|
sl@0
|
543 |
case EMVSCmdSetPlayWindow:
|
sl@0
|
544 |
{
|
sl@0
|
545 |
iSetPlayWindow->SetupDialogLD(iStart,iEnd,iDuration,this);
|
sl@0
|
546 |
iLogger.Write(_L("AudioPlayAgent SetPlayWindow"));
|
sl@0
|
547 |
}
|
sl@0
|
548 |
break;
|
sl@0
|
549 |
|
sl@0
|
550 |
|
sl@0
|
551 |
case EMVSCmdClearPlayWindow:
|
sl@0
|
552 |
{
|
sl@0
|
553 |
iStart = 0;
|
sl@0
|
554 |
iEnd = iAudioPlayAgent->Duration();
|
sl@0
|
555 |
iAudioPlayAgent->ClearPlayWindow();
|
sl@0
|
556 |
iLogger.Write(_L("AudioPlayAgent ClearPlayWindow"));
|
sl@0
|
557 |
}
|
sl@0
|
558 |
break;
|
sl@0
|
559 |
|
sl@0
|
560 |
|
sl@0
|
561 |
case EMVSCmdSystemInfo:
|
sl@0
|
562 |
{
|
sl@0
|
563 |
iSystemInfo->SetupDialogLD(this);
|
sl@0
|
564 |
iLogger.Write(_L("System Info"));
|
sl@0
|
565 |
}
|
sl@0
|
566 |
break;
|
sl@0
|
567 |
|
sl@0
|
568 |
|
sl@0
|
569 |
case EMVSVideoCmdSettings:
|
sl@0
|
570 |
{
|
sl@0
|
571 |
if (iVideoPlayAgent->SupportVideoPlayerUtility2())
|
sl@0
|
572 |
{
|
sl@0
|
573 |
iVideoSetting->SetupDialogLD(iRotation, this, iVideoExtent, iWindowClipRect, ETrue, iPip, iCrp);
|
sl@0
|
574 |
}
|
sl@0
|
575 |
else
|
sl@0
|
576 |
{
|
sl@0
|
577 |
iVideoSetting->SetupDialogLD(iRotation,this, TRect(0, 0, 0, 0), TRect(0, 0, 0, 0), EFalse, EFalse, iCrp);
|
sl@0
|
578 |
}
|
sl@0
|
579 |
iLogger.Write(_L("Video Settings"));
|
sl@0
|
580 |
}
|
sl@0
|
581 |
break;
|
sl@0
|
582 |
|
sl@0
|
583 |
|
sl@0
|
584 |
case EMVSCmdAudioSetting:
|
sl@0
|
585 |
{
|
sl@0
|
586 |
iAudioSetting->SetupDialogLD(iNoRepeats,iRepeatDelay,iPriority,iPriorityPreference,iMaxFileBuffer, this);
|
sl@0
|
587 |
iLogger.Write(_L("Audio Setting"));
|
sl@0
|
588 |
}
|
sl@0
|
589 |
break;
|
sl@0
|
590 |
|
sl@0
|
591 |
|
sl@0
|
592 |
case EMVSCmdClose:
|
sl@0
|
593 |
{
|
sl@0
|
594 |
FileClose();
|
sl@0
|
595 |
iRecordLimitSet = EFalse;
|
sl@0
|
596 |
}
|
sl@0
|
597 |
break;
|
sl@0
|
598 |
|
sl@0
|
599 |
|
sl@0
|
600 |
case EMVSCmdSetCropWindow:
|
sl@0
|
601 |
{
|
sl@0
|
602 |
iCropPosition=0;
|
sl@0
|
603 |
iCropStart=GetCropStart();
|
sl@0
|
604 |
iClipLength = iAudioRecordAgent->Duration();
|
sl@0
|
605 |
iCropEnd=iClipLength;
|
sl@0
|
606 |
iCropDialog->SetupDialogLD(iCropPosition,iClipLength,0,iCropEnd,this);
|
sl@0
|
607 |
iLogger.Write(_L("CropWindow set"));
|
sl@0
|
608 |
}
|
sl@0
|
609 |
break;
|
sl@0
|
610 |
|
sl@0
|
611 |
case EMVSCmdClearLog:
|
sl@0
|
612 |
{
|
sl@0
|
613 |
|
sl@0
|
614 |
}
|
sl@0
|
615 |
break;
|
sl@0
|
616 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
617 |
case EMVSCmdEnableSubtitles :
|
sl@0
|
618 |
{
|
sl@0
|
619 |
iVideoPlayAgent->EnableSubtitlesL();
|
sl@0
|
620 |
}
|
sl@0
|
621 |
break;
|
sl@0
|
622 |
case EMVSCmdDisableSubtitles :
|
sl@0
|
623 |
{
|
sl@0
|
624 |
iVideoPlayAgent->DisableSubtitlesL();
|
sl@0
|
625 |
}
|
sl@0
|
626 |
break;
|
sl@0
|
627 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
628 |
}
|
sl@0
|
629 |
if(needsUpdating)
|
sl@0
|
630 |
{
|
sl@0
|
631 |
UpdateDisplayL(iState);
|
sl@0
|
632 |
}
|
sl@0
|
633 |
}
|
sl@0
|
634 |
|
sl@0
|
635 |
void CMVSAppUi::PrepareVideoControlsL()
|
sl@0
|
636 |
{
|
sl@0
|
637 |
if (iDisplayAdded)
|
sl@0
|
638 |
{
|
sl@0
|
639 |
iVideoPlayAgent->RemoveDisplayWindowL(iVideoCtl->ControlWindow());
|
sl@0
|
640 |
iVideoPlayAgent->RemoveDisplay(iVideoCtl->ScreenNumber());
|
sl@0
|
641 |
TRAP_IGNORE(iVideoPlayAgent->RemoveDisplayWindowL(iVideoCtl->Pip().ControlWindow()));
|
sl@0
|
642 |
iDisplayAdded = EFalse;
|
sl@0
|
643 |
}
|
sl@0
|
644 |
|
sl@0
|
645 |
iVideoCtl = iAppView->iMainWindowControl;
|
sl@0
|
646 |
|
sl@0
|
647 |
CCoeEnv* env = CCoeEnv::Static();
|
sl@0
|
648 |
|
sl@0
|
649 |
if (iScreenNumber > 0)
|
sl@0
|
650 |
{
|
sl@0
|
651 |
// Video ctls start at 0 in index for display 1
|
sl@0
|
652 |
iVideoCtl = iVideoCtls[iScreenNumber - 1];
|
sl@0
|
653 |
}
|
sl@0
|
654 |
|
sl@0
|
655 |
TRect extent = iVideoExtentSet ? iVideoExtent : iVideoCtl->Rect();
|
sl@0
|
656 |
TRect clip = iWindowClipRectSet ? iWindowClipRect : iVideoCtl->Rect();
|
sl@0
|
657 |
iVideoPlayAgent->AddDisplayWindowL(env->WsSession(), *(env->ScreenDevice(iScreenNumber)), iVideoCtl->ControlWindow(), extent, clip);
|
sl@0
|
658 |
iDisplayAdded = ETrue;
|
sl@0
|
659 |
|
sl@0
|
660 |
if (iPip)
|
sl@0
|
661 |
{
|
sl@0
|
662 |
// Picture-in-picture has been enabled.
|
sl@0
|
663 |
TSize videoFrameSize;
|
sl@0
|
664 |
iVideoPlayAgent->VideoFrameSizeL(videoFrameSize);
|
sl@0
|
665 |
TSize winSize = iVideoCtl->Size();
|
sl@0
|
666 |
|
sl@0
|
667 |
// Picture-in-picture should be an 8th of original
|
sl@0
|
668 |
videoFrameSize.iHeight /= 4;
|
sl@0
|
669 |
videoFrameSize.iWidth /= 4;
|
sl@0
|
670 |
|
sl@0
|
671 |
TPoint pipLoc(winSize.iWidth - (videoFrameSize.iWidth + 4), 4);
|
sl@0
|
672 |
|
sl@0
|
673 |
iVideoCtl->Pip().SetExtent(pipLoc, videoFrameSize);
|
sl@0
|
674 |
|
sl@0
|
675 |
if (iCrp)
|
sl@0
|
676 |
{
|
sl@0
|
677 |
iVideoCtl->EnablePip(CMVSPipControl::EUseCrp);
|
sl@0
|
678 |
iVideoPlayAgent->AddDisplayL(env->WsSession(), iScreenNumber, iVideoCtl->Pip());
|
sl@0
|
679 |
}
|
sl@0
|
680 |
else
|
sl@0
|
681 |
{
|
sl@0
|
682 |
iVideoCtl->EnablePip(CMVSPipControl::EUseMmf);
|
sl@0
|
683 |
iVideoPlayAgent->AddDisplayWindowL(env->WsSession(), *(env->ScreenDevice(iScreenNumber)), iVideoCtl->Pip().ControlWindow());
|
sl@0
|
684 |
iVideoPlayAgent->SetAutoScaleL(iVideoCtl->Pip().ControlWindow(), EAutoScaleBestFit, EHorizontalAlignCenter, EVerticalAlignCenter);
|
sl@0
|
685 |
}
|
sl@0
|
686 |
}
|
sl@0
|
687 |
else
|
sl@0
|
688 |
{
|
sl@0
|
689 |
// Picture-in-picture has been disabled.
|
sl@0
|
690 |
iVideoCtl->DisablePip();
|
sl@0
|
691 |
}
|
sl@0
|
692 |
}
|
sl@0
|
693 |
|
sl@0
|
694 |
void CMVSAppUi::SetPosition(TTimeIntervalMicroSeconds& aPos)
|
sl@0
|
695 |
{
|
sl@0
|
696 |
if(iMode == EAudioPlay)
|
sl@0
|
697 |
{
|
sl@0
|
698 |
iAudioPlayAgent->SetPosition(aPos);
|
sl@0
|
699 |
}
|
sl@0
|
700 |
else if(iMode == EAudioRecord)
|
sl@0
|
701 |
{
|
sl@0
|
702 |
iAudioRecordAgent->SetPosition(aPos);
|
sl@0
|
703 |
}
|
sl@0
|
704 |
}
|
sl@0
|
705 |
|
sl@0
|
706 |
//Opens a file for playing
|
sl@0
|
707 |
void CMVSAppUi::FileOpenL()
|
sl@0
|
708 |
{
|
sl@0
|
709 |
//Open the file dialog
|
sl@0
|
710 |
CEikFileOpenDialog* dialog = new (ELeave) CEikFileOpenDialog(&iSrcFName);
|
sl@0
|
711 |
TInt val = dialog->ExecuteLD(R_EIK_DIALOG_FILE_OPEN);
|
sl@0
|
712 |
if(val != 0)
|
sl@0
|
713 |
{
|
sl@0
|
714 |
TUid mediatype = iPluginInfo->GetMediaTypeL(iSrcFName);
|
sl@0
|
715 |
if(mediatype == KUidMediaTypeVideo)
|
sl@0
|
716 |
{
|
sl@0
|
717 |
TRect rect, clipRect;
|
sl@0
|
718 |
rect = clipRect = TRect(iAppView->iMainWindowControl->PositionRelativeToScreen(), iAppView->iMainWindowControl->Size());
|
sl@0
|
719 |
|
sl@0
|
720 |
rect.Shrink(2,2);
|
sl@0
|
721 |
clipRect.Shrink(2,2);
|
sl@0
|
722 |
|
sl@0
|
723 |
// Clear the area where the video will be displayed
|
sl@0
|
724 |
#ifdef SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS
|
sl@0
|
725 |
iVideoPlayAgent->SetVideoOutputL(iCoeEnv->WsSession(),
|
sl@0
|
726 |
*iCoeEnv->ScreenDevice(iScreenNumber),
|
sl@0
|
727 |
iVideoCtl->ControlWindow(),
|
sl@0
|
728 |
rect,
|
sl@0
|
729 |
clipRect);
|
sl@0
|
730 |
#else
|
sl@0
|
731 |
iVideoPlayAgent->SetVideoOutputL(iCoeEnv->WsSession(),
|
sl@0
|
732 |
*iCoeEnv->ScreenDevice(),
|
sl@0
|
733 |
iVideoCtl->ControlWindow(),
|
sl@0
|
734 |
rect,
|
sl@0
|
735 |
clipRect);
|
sl@0
|
736 |
#endif // SYMBIAN_WSERV_AND_CONE_MULTIPLE_SCREENS
|
sl@0
|
737 |
|
sl@0
|
738 |
TInt res = iVideoPlayAgent->SetScreenNumber(iScreenNumber);
|
sl@0
|
739 |
if(res == KErrNotSupported)
|
sl@0
|
740 |
{
|
sl@0
|
741 |
User::InfoPrint(KMultiScreenNotsupported);
|
sl@0
|
742 |
}
|
sl@0
|
743 |
//Enable AP&R for register notification made before opening the file
|
sl@0
|
744 |
if(iRegistered)
|
sl@0
|
745 |
{
|
sl@0
|
746 |
TInt regerr = iVideoPlayAgent->RegisterForNotification();
|
sl@0
|
747 |
if(regerr == KErrNone)
|
sl@0
|
748 |
{
|
sl@0
|
749 |
User::InfoPrint(KRegisterSuccess);
|
sl@0
|
750 |
}
|
sl@0
|
751 |
else
|
sl@0
|
752 |
{
|
sl@0
|
753 |
User::InfoPrint(KRegisterFailure);
|
sl@0
|
754 |
}
|
sl@0
|
755 |
}
|
sl@0
|
756 |
else if(iAlreadyRegistered)
|
sl@0
|
757 |
{
|
sl@0
|
758 |
TInt cancelerr = iVideoPlayAgent->CancelNotification();
|
sl@0
|
759 |
if(cancelerr == KErrNone)
|
sl@0
|
760 |
{
|
sl@0
|
761 |
iAlreadyRegistered = EFalse;
|
sl@0
|
762 |
User::InfoPrint(KRegisterCancelation);
|
sl@0
|
763 |
}
|
sl@0
|
764 |
else
|
sl@0
|
765 |
{
|
sl@0
|
766 |
User::InfoPrint(KCancelationFailure);
|
sl@0
|
767 |
}
|
sl@0
|
768 |
}
|
sl@0
|
769 |
iVideoPlayAgent->OpenFileL(iSrcFName);
|
sl@0
|
770 |
iMode = EVideoPlay;
|
sl@0
|
771 |
}
|
sl@0
|
772 |
else if(mediatype == KUidMediaTypeAudio)
|
sl@0
|
773 |
{
|
sl@0
|
774 |
iAudioPlayAgent->OpenFileL(iSrcFName);
|
sl@0
|
775 |
iMode = EAudioPlay;
|
sl@0
|
776 |
iButtons->DimCommand(EMVSCmdSetVolume,EFalse);
|
sl@0
|
777 |
iButtons->DrawNow();
|
sl@0
|
778 |
}
|
sl@0
|
779 |
else
|
sl@0
|
780 |
{
|
sl@0
|
781 |
User::InfoPrint(KNotSupported);
|
sl@0
|
782 |
}
|
sl@0
|
783 |
}
|
sl@0
|
784 |
return;
|
sl@0
|
785 |
}
|
sl@0
|
786 |
|
sl@0
|
787 |
//Opens a new or existing file to record.
|
sl@0
|
788 |
void CMVSAppUi::FileOpenForRecordL()
|
sl@0
|
789 |
{
|
sl@0
|
790 |
iExtArray->Reset();
|
sl@0
|
791 |
iPluginArray->Reset();
|
sl@0
|
792 |
iCodecArray->Reset();
|
sl@0
|
793 |
iSelectedPluginIdx = KBeforeSelectingController;
|
sl@0
|
794 |
iSelectPluginsDialog->SetupDialogLD(iPluginArray,iExtArray, iCodecArray, this);
|
sl@0
|
795 |
//Indicates that the controller wasnt selected, leave it to the MMF to select
|
sl@0
|
796 |
//tha appropriate controller.
|
sl@0
|
797 |
if(iSelectedPluginIdx == KControllerNotSelected)
|
sl@0
|
798 |
{
|
sl@0
|
799 |
iControllerUid = TUid::Null();
|
sl@0
|
800 |
}
|
sl@0
|
801 |
else
|
sl@0
|
802 |
{
|
sl@0
|
803 |
if(iMediaType)
|
sl@0
|
804 |
{
|
sl@0
|
805 |
iControllerUid = iVideoUidArray[iSelectedPluginIdx];
|
sl@0
|
806 |
}
|
sl@0
|
807 |
else
|
sl@0
|
808 |
{
|
sl@0
|
809 |
iControllerUid = iAudioUidArray[iSelectedPluginIdx];
|
sl@0
|
810 |
}
|
sl@0
|
811 |
}
|
sl@0
|
812 |
if(!iMediaType)
|
sl@0
|
813 |
{
|
sl@0
|
814 |
iMode = EAudioRecord;
|
sl@0
|
815 |
}
|
sl@0
|
816 |
else if(iMediaType)
|
sl@0
|
817 |
{
|
sl@0
|
818 |
iMode = EVideoRecord;
|
sl@0
|
819 |
}
|
sl@0
|
820 |
SaveAsDialogL();
|
sl@0
|
821 |
}
|
sl@0
|
822 |
|
sl@0
|
823 |
void CMVSAppUi::FileClose()
|
sl@0
|
824 |
{
|
sl@0
|
825 |
iButtons->DimCommand(EMVSCmdSetVolume, ETrue);
|
sl@0
|
826 |
iButtons->DimCommand(EMVSCmdRecord, ETrue);
|
sl@0
|
827 |
switch(iMode)
|
sl@0
|
828 |
{
|
sl@0
|
829 |
case EAudioPlay:
|
sl@0
|
830 |
{
|
sl@0
|
831 |
iAudioPlayAgent->Stop();
|
sl@0
|
832 |
iLogger.Write(_L("AudioPlayAgent Close"));
|
sl@0
|
833 |
}
|
sl@0
|
834 |
break;
|
sl@0
|
835 |
|
sl@0
|
836 |
case EAudioRecord:
|
sl@0
|
837 |
{
|
sl@0
|
838 |
iAudioRecordAgent->Stop();
|
sl@0
|
839 |
iLogger.Write(_L("AudioRecordAgent Close"));
|
sl@0
|
840 |
}
|
sl@0
|
841 |
break;
|
sl@0
|
842 |
|
sl@0
|
843 |
case EVideoPlay:
|
sl@0
|
844 |
{
|
sl@0
|
845 |
iVideoPlayAgent->Close();
|
sl@0
|
846 |
iLogger.Write(_L("VideoPlayAgent Close"));
|
sl@0
|
847 |
iAppView->DrawNow();
|
sl@0
|
848 |
}
|
sl@0
|
849 |
break;
|
sl@0
|
850 |
|
sl@0
|
851 |
case EVideoRecord:
|
sl@0
|
852 |
{
|
sl@0
|
853 |
iVideoRecordAgent->Close();
|
sl@0
|
854 |
iLogger.Write(_L("VideoRecordAgent Close"));
|
sl@0
|
855 |
}
|
sl@0
|
856 |
break;
|
sl@0
|
857 |
|
sl@0
|
858 |
default:
|
sl@0
|
859 |
break;
|
sl@0
|
860 |
}
|
sl@0
|
861 |
Reset();
|
sl@0
|
862 |
}
|
sl@0
|
863 |
|
sl@0
|
864 |
|
sl@0
|
865 |
void CMVSAppUi::SaveAsDialogL()
|
sl@0
|
866 |
{
|
sl@0
|
867 |
iFileReplace = ETrue;
|
sl@0
|
868 |
TInt errVal = iSaveAsDialog->SetupDialogLD(iDestFilename, &iFileReplace);
|
sl@0
|
869 |
if(errVal)
|
sl@0
|
870 |
{
|
sl@0
|
871 |
DetermineFinalFNameL();
|
sl@0
|
872 |
if(iProceed)
|
sl@0
|
873 |
{
|
sl@0
|
874 |
iOpeningForRecord=ETrue;
|
sl@0
|
875 |
RFs fs = CCoeEnv::Static()->FsSession();
|
sl@0
|
876 |
if(iMode==EAudioRecord)
|
sl@0
|
877 |
{
|
sl@0
|
878 |
TInt uidcount = iAudioPlayUidArray.Count();
|
sl@0
|
879 |
TUid playcontrollerUid = TUid::Null();
|
sl@0
|
880 |
if(uidcount)
|
sl@0
|
881 |
{
|
sl@0
|
882 |
playcontrollerUid = iAudioPlayUidArray[0];
|
sl@0
|
883 |
}
|
sl@0
|
884 |
if(iFileReplace)
|
sl@0
|
885 |
{
|
sl@0
|
886 |
fs.Delete(iDestFilename);
|
sl@0
|
887 |
}
|
sl@0
|
888 |
iAudioRecordAgent->CreateNewFileL(iDestFilename,iControllerUid,playcontrollerUid);
|
sl@0
|
889 |
iLogger.Write(_L("Opened file for Audio Record"));
|
sl@0
|
890 |
iRecFName.Copy(iDestFilename);
|
sl@0
|
891 |
iButtons->DimCommand(EMVSCmdRecord, EFalse);
|
sl@0
|
892 |
iButtons->DrawNow();
|
sl@0
|
893 |
}
|
sl@0
|
894 |
|
sl@0
|
895 |
else if(iMode==EVideoRecord)
|
sl@0
|
896 |
{
|
sl@0
|
897 |
if(iFileReplace)
|
sl@0
|
898 |
{
|
sl@0
|
899 |
fs.Delete(iDestFilename);
|
sl@0
|
900 |
}
|
sl@0
|
901 |
TInt err = iVideoRecordAgent->OpenFileL(iDestFilename,iControllerUid);
|
sl@0
|
902 |
if(err != KErrNone)
|
sl@0
|
903 |
{
|
sl@0
|
904 |
iLogger.Write(_L("ECam Object creation failed"));
|
sl@0
|
905 |
User::InfoPrint(KVideoError);
|
sl@0
|
906 |
}
|
sl@0
|
907 |
else
|
sl@0
|
908 |
{
|
sl@0
|
909 |
iLogger.Write(_L("Opened file for Video Record"));
|
sl@0
|
910 |
iRecFName.Copy(iDestFilename);
|
sl@0
|
911 |
iButtons->DimCommand(EMVSCmdRecord, EFalse);
|
sl@0
|
912 |
iButtons->DrawNow();
|
sl@0
|
913 |
}
|
sl@0
|
914 |
}
|
sl@0
|
915 |
}
|
sl@0
|
916 |
}
|
sl@0
|
917 |
else
|
sl@0
|
918 |
{
|
sl@0
|
919 |
iMode = EIdle;
|
sl@0
|
920 |
UpdateStateChange(ENotReady , KErrNone);
|
sl@0
|
921 |
}
|
sl@0
|
922 |
}
|
sl@0
|
923 |
|
sl@0
|
924 |
//The state change calls from the agents
|
sl@0
|
925 |
void CMVSAppUi::UpdateStateChange(TMVSState aState, TInt aError)
|
sl@0
|
926 |
{
|
sl@0
|
927 |
TInt error = aError;
|
sl@0
|
928 |
//if state changes from EVideoRecording and view finder is running, stop it.
|
sl@0
|
929 |
if(iState == EVideoRecording && aState != EVideoRecording)
|
sl@0
|
930 |
{
|
sl@0
|
931 |
StopViewFinder();
|
sl@0
|
932 |
}
|
sl@0
|
933 |
//if playback stops, redraw the app view
|
sl@0
|
934 |
if(iState == EVideoPlaying && aState != EVideoPlaying)
|
sl@0
|
935 |
{
|
sl@0
|
936 |
// the last frame is still on the display, but nothing is in charge
|
sl@0
|
937 |
// of redrawing it. this would otherwise lead to graphical glitches
|
sl@0
|
938 |
// as the frame is partially erased over time.
|
sl@0
|
939 |
iAppView->iMainWindowControl->DrawNow();
|
sl@0
|
940 |
}
|
sl@0
|
941 |
iState=aState;
|
sl@0
|
942 |
if(error == KErrNone)
|
sl@0
|
943 |
{
|
sl@0
|
944 |
if(aState == EAudioOpened)
|
sl@0
|
945 |
{
|
sl@0
|
946 |
iAppView->ResetProgressBar();
|
sl@0
|
947 |
iButtons->DimCommand(EMVSCmdPlay,EFalse);
|
sl@0
|
948 |
iButtons->DrawNow();
|
sl@0
|
949 |
if(iMode == EAudioPlay)
|
sl@0
|
950 |
{
|
sl@0
|
951 |
iButtons->DimCommand(EMVSCmdRecord,ETrue);
|
sl@0
|
952 |
iDuration = iAudioPlayAgent->Duration();
|
sl@0
|
953 |
if((iStart == 0) && (iEnd == 0))
|
sl@0
|
954 |
{
|
sl@0
|
955 |
iStart = 0;
|
sl@0
|
956 |
iEnd = iDuration;
|
sl@0
|
957 |
}
|
sl@0
|
958 |
}
|
sl@0
|
959 |
if(iButtons->IsCommandDimmed(EMVSCmdSetRepeats))
|
sl@0
|
960 |
{
|
sl@0
|
961 |
iButtons->DimCommand(EMVSCmdSetRepeats,EFalse);
|
sl@0
|
962 |
iButtons->DrawNow();
|
sl@0
|
963 |
}
|
sl@0
|
964 |
if(iButtons->IsCommandDimmed(EMVSCmdSetPlayBalance))
|
sl@0
|
965 |
{
|
sl@0
|
966 |
iButtons->DimCommand(EMVSCmdSetPlayBalance,EFalse);
|
sl@0
|
967 |
iButtons->DrawNow();
|
sl@0
|
968 |
}
|
sl@0
|
969 |
//Provided to automatically start playing, when the play button is selected
|
sl@0
|
970 |
//without opening a file through the file menu.
|
sl@0
|
971 |
if(iAutoplay)
|
sl@0
|
972 |
{
|
sl@0
|
973 |
iAudioPlayAgent->Play();
|
sl@0
|
974 |
iAutoplay=EFalse;
|
sl@0
|
975 |
}
|
sl@0
|
976 |
if(iMode == EAudioRecord && !iOpeningForRecord)
|
sl@0
|
977 |
{
|
sl@0
|
978 |
iButtons->DimCommand(EMVSCmdRecord,EFalse);
|
sl@0
|
979 |
iButtons->DimCommand(EMVSCmdPlay,EFalse);
|
sl@0
|
980 |
iButtons->DrawNow();
|
sl@0
|
981 |
}
|
sl@0
|
982 |
//Pop the Audio Record Settings Dialogue
|
sl@0
|
983 |
if(iMode == EAudioRecord && iOpeningForRecord && iSelectedPluginIdx !=-2)
|
sl@0
|
984 |
{
|
sl@0
|
985 |
iButtons->DimCommand(EMVSCmdSetPlayBalance,EFalse);
|
sl@0
|
986 |
if(iButtons->IsCommandDimmed(EMVSCmdRecord))
|
sl@0
|
987 |
{
|
sl@0
|
988 |
iButtons->DimCommand(EMVSCmdRecord,EFalse);
|
sl@0
|
989 |
iButtons->DrawNow();
|
sl@0
|
990 |
}
|
sl@0
|
991 |
//if appending to an existing file no need to re-enter the controller configuration.
|
sl@0
|
992 |
if(iFileReplace)
|
sl@0
|
993 |
{
|
sl@0
|
994 |
if(!iMediaType && iSelectedPluginIdx !=-1)
|
sl@0
|
995 |
{
|
sl@0
|
996 |
TRAP(error, iConfigFormatDialog->SetupDialogLD(this,iAudioUidArray[iSelectedPluginIdx],iSettingManager) );
|
sl@0
|
997 |
iOpeningForRecord = EFalse;
|
sl@0
|
998 |
}
|
sl@0
|
999 |
}
|
sl@0
|
1000 |
}
|
sl@0
|
1001 |
}
|
sl@0
|
1002 |
else if(aState == EAudioPlaying)
|
sl@0
|
1003 |
{
|
sl@0
|
1004 |
iButtons->DimCommand(EMVSCmdPlay, ETrue);
|
sl@0
|
1005 |
iButtons->DimCommand(EMVSCmdRecord,ETrue);
|
sl@0
|
1006 |
iButtons->DimCommand(EMVSCmdPause, EFalse);
|
sl@0
|
1007 |
iButtons->DimCommand(EMVSCmdStop, EFalse);
|
sl@0
|
1008 |
iButtons->DrawNow();
|
sl@0
|
1009 |
}
|
sl@0
|
1010 |
else if(aState == ENotReady)
|
sl@0
|
1011 |
{
|
sl@0
|
1012 |
iButtons->DimCommand(EMVSCmdSetPlayBalance,EFalse);
|
sl@0
|
1013 |
iButtons->DimCommand(EMVSCmdSetVolume, ETrue);
|
sl@0
|
1014 |
iButtons->DimCommand(EMVSCmdRecord, ETrue);
|
sl@0
|
1015 |
iButtons->DimCommand(EMVSCmdPlay, EFalse);
|
sl@0
|
1016 |
iButtons->DrawNow();
|
sl@0
|
1017 |
|
sl@0
|
1018 |
// File has been closed. Remove the display window if it was added.
|
sl@0
|
1019 |
if (iDisplayAdded)
|
sl@0
|
1020 |
{
|
sl@0
|
1021 |
TRAP(error, iVideoPlayAgent->RemoveDisplayWindowL(iVideoCtl->ControlWindow()));
|
sl@0
|
1022 |
TRAP(error, iVideoPlayAgent->RemoveDisplayWindowL(iVideoCtl->Pip().ControlWindow()));
|
sl@0
|
1023 |
iVideoPlayAgent->RemoveDisplay(iVideoCtl->ScreenNumber());
|
sl@0
|
1024 |
iVideoCtl->Pip().Clear();
|
sl@0
|
1025 |
iDisplayAdded = EFalse;
|
sl@0
|
1026 |
}
|
sl@0
|
1027 |
}
|
sl@0
|
1028 |
else if(aState == EAudioOpening)
|
sl@0
|
1029 |
{
|
sl@0
|
1030 |
iButtons->DimCommand(EMVSCmdSetVolume,EFalse);
|
sl@0
|
1031 |
}
|
sl@0
|
1032 |
else if(aState == EAudioPaused)
|
sl@0
|
1033 |
{
|
sl@0
|
1034 |
iButtons->DimCommand(EMVSCmdPause, ETrue);
|
sl@0
|
1035 |
iButtons->DrawNow();
|
sl@0
|
1036 |
}
|
sl@0
|
1037 |
else if(aState == EAudioStopped)
|
sl@0
|
1038 |
{
|
sl@0
|
1039 |
iAppView->ResetProgressBar();
|
sl@0
|
1040 |
iButtons->DimCommand(EMVSCmdStop, ETrue);
|
sl@0
|
1041 |
iButtons->DimCommand(EMVSCmdPause, ETrue);
|
sl@0
|
1042 |
iButtons->DrawNow();
|
sl@0
|
1043 |
}
|
sl@0
|
1044 |
else if(aState == EVideoPaused)
|
sl@0
|
1045 |
{
|
sl@0
|
1046 |
iButtons->DimCommand(EMVSCmdPause,ETrue);
|
sl@0
|
1047 |
iButtons->DrawNow();
|
sl@0
|
1048 |
}
|
sl@0
|
1049 |
else if(aState == EVideoStopped)
|
sl@0
|
1050 |
{
|
sl@0
|
1051 |
iButtons->DimCommand(EMVSCmdStop,ETrue);
|
sl@0
|
1052 |
iButtons->DimCommand(EMVSCmdPause, ETrue);
|
sl@0
|
1053 |
iButtons->DrawNow();
|
sl@0
|
1054 |
}
|
sl@0
|
1055 |
else if(aState == EVideoPlaying)
|
sl@0
|
1056 |
{
|
sl@0
|
1057 |
iButtons->DimCommand(EMVSCmdPlay, ETrue);
|
sl@0
|
1058 |
iButtons->DimCommand(EMVSCmdRecord,ETrue);
|
sl@0
|
1059 |
iButtons->DimCommand(EMVSCmdPause,ETrue);
|
sl@0
|
1060 |
iButtons->DimCommand(EMVSCmdStop,EFalse);
|
sl@0
|
1061 |
iButtons->DrawNow();
|
sl@0
|
1062 |
}
|
sl@0
|
1063 |
else if(aState == EVideoRecording)
|
sl@0
|
1064 |
{
|
sl@0
|
1065 |
iButtons->DimCommand(EMVSCmdPlay, ETrue);
|
sl@0
|
1066 |
iButtons->DimCommand(EMVSCmdRecord, ETrue);
|
sl@0
|
1067 |
iButtons->DimCommand(EMVSCmdPause,EFalse);
|
sl@0
|
1068 |
iButtons->DimCommand(EMVSCmdSetRepeats,ETrue);
|
sl@0
|
1069 |
iButtons->DrawNow();
|
sl@0
|
1070 |
}
|
sl@0
|
1071 |
|
sl@0
|
1072 |
else if(aState == EAudioRecording)
|
sl@0
|
1073 |
{
|
sl@0
|
1074 |
iButtons->DimCommand(EMVSCmdPlay, ETrue);
|
sl@0
|
1075 |
iButtons->DimCommand(EMVSCmdRecord,ETrue);
|
sl@0
|
1076 |
iButtons->DimCommand(EMVSCmdPause,ETrue);
|
sl@0
|
1077 |
iButtons->DrawNow();
|
sl@0
|
1078 |
}
|
sl@0
|
1079 |
else if(aState == EVideoOpened )
|
sl@0
|
1080 |
{
|
sl@0
|
1081 |
//Pop the Video Record Settings Dialogue
|
sl@0
|
1082 |
iButtons->DimCommand(EMVSCmdPlay,EFalse);
|
sl@0
|
1083 |
iButtons->DimCommand(EMVSCmdPause,ETrue);
|
sl@0
|
1084 |
iButtons->DimCommand(EMVSCmdSetRepeats,ETrue);
|
sl@0
|
1085 |
iButtons->DrawNow();
|
sl@0
|
1086 |
if(iButtons->IsCommandDimmed(EMVSCmdSetPlayBalance))
|
sl@0
|
1087 |
{
|
sl@0
|
1088 |
iButtons->DimCommand(EMVSCmdSetPlayBalance,EFalse);
|
sl@0
|
1089 |
iButtons->DrawNow();
|
sl@0
|
1090 |
}
|
sl@0
|
1091 |
if(iMode==EVideoRecord && iOpeningForRecord)
|
sl@0
|
1092 |
{
|
sl@0
|
1093 |
iButtons->DimCommand(EMVSCmdSetPlayBalance,ETrue);
|
sl@0
|
1094 |
if(iFileReplace)
|
sl@0
|
1095 |
{
|
sl@0
|
1096 |
if(iMediaType && iSelectedPluginIdx !=-1)
|
sl@0
|
1097 |
{
|
sl@0
|
1098 |
TRAP(error, iVideoFormatDialog->SetupDialogLD(this,iVideoUidArray[iSelectedPluginIdx],iSettingManager) );
|
sl@0
|
1099 |
iOpeningForRecord=EFalse;
|
sl@0
|
1100 |
}
|
sl@0
|
1101 |
}
|
sl@0
|
1102 |
}
|
sl@0
|
1103 |
}
|
sl@0
|
1104 |
if(error != KErrNone)
|
sl@0
|
1105 |
{
|
sl@0
|
1106 |
LogErrors(error);
|
sl@0
|
1107 |
}
|
sl@0
|
1108 |
}
|
sl@0
|
1109 |
else if ((error == KErrEof) && (aState == EAudioStopped))
|
sl@0
|
1110 |
{
|
sl@0
|
1111 |
iButtons->DimCommand(EMVSCmdPlay, EFalse);
|
sl@0
|
1112 |
iButtons->DimCommand(EMVSCmdRecord,ETrue);
|
sl@0
|
1113 |
iButtons->DimCommand(EMVSCmdPause,EFalse);
|
sl@0
|
1114 |
iButtons->DimCommand(EMVSCmdStop,EFalse);
|
sl@0
|
1115 |
iButtons->DrawNow();
|
sl@0
|
1116 |
}
|
sl@0
|
1117 |
else
|
sl@0
|
1118 |
{
|
sl@0
|
1119 |
LogErrors(error);
|
sl@0
|
1120 |
}
|
sl@0
|
1121 |
|
sl@0
|
1122 |
//As the state changes the display windows(views) contents also needs to be changed
|
sl@0
|
1123 |
TRAPD(err,UpdateDisplayL(iState));
|
sl@0
|
1124 |
if(err)
|
sl@0
|
1125 |
{
|
sl@0
|
1126 |
LogErrors(err);
|
sl@0
|
1127 |
iState = ENotReady;
|
sl@0
|
1128 |
FileClose();
|
sl@0
|
1129 |
}
|
sl@0
|
1130 |
}
|
sl@0
|
1131 |
|
sl@0
|
1132 |
void CMVSAppUi::MvsResourceNotification(const TDesC8& /*aNotificationData*/)
|
sl@0
|
1133 |
{
|
sl@0
|
1134 |
if(iMode == EVideoPlay)
|
sl@0
|
1135 |
{
|
sl@0
|
1136 |
iVideoPlayAgent->Play();
|
sl@0
|
1137 |
}
|
sl@0
|
1138 |
}
|
sl@0
|
1139 |
//Return the current mode of the App
|
sl@0
|
1140 |
void CMVSAppUi::Reset()
|
sl@0
|
1141 |
{
|
sl@0
|
1142 |
iMode =EIdle;
|
sl@0
|
1143 |
iState =ENotReady;
|
sl@0
|
1144 |
iBitRate = 0;
|
sl@0
|
1145 |
iSampleRate = 0;
|
sl@0
|
1146 |
iChannels =0;
|
sl@0
|
1147 |
iAutoplay = EFalse;
|
sl@0
|
1148 |
iStart = 0;
|
sl@0
|
1149 |
iEnd = 0;
|
sl@0
|
1150 |
iDuration = 0;
|
sl@0
|
1151 |
}
|
sl@0
|
1152 |
|
sl@0
|
1153 |
|
sl@0
|
1154 |
//GetCropStart()
|
sl@0
|
1155 |
TTimeIntervalMicroSeconds CMVSAppUi::GetCropStart() const
|
sl@0
|
1156 |
{
|
sl@0
|
1157 |
return iCropStart;
|
sl@0
|
1158 |
}
|
sl@0
|
1159 |
|
sl@0
|
1160 |
|
sl@0
|
1161 |
// Returns the cropping end-point in microseconds
|
sl@0
|
1162 |
TTimeIntervalMicroSeconds CMVSAppUi::GetCropEnd() const
|
sl@0
|
1163 |
{
|
sl@0
|
1164 |
return iCropEnd;
|
sl@0
|
1165 |
}
|
sl@0
|
1166 |
|
sl@0
|
1167 |
//Volume setting
|
sl@0
|
1168 |
void CMVSAppUi::SetVolumeL(TInt aVolume, TTimeIntervalMicroSeconds aRamp)
|
sl@0
|
1169 |
{
|
sl@0
|
1170 |
//Initialise the volume settings based on the parameters
|
sl@0
|
1171 |
iVolumeOrGain = aVolume;
|
sl@0
|
1172 |
iRamp = aRamp;
|
sl@0
|
1173 |
switch(iMode)
|
sl@0
|
1174 |
{
|
sl@0
|
1175 |
case EAudioPlay:
|
sl@0
|
1176 |
{
|
sl@0
|
1177 |
//And set the maximum volume based on the device's audio capabilities
|
sl@0
|
1178 |
iMaxVolume = iAudioPlayAgent->MaxVolume();
|
sl@0
|
1179 |
//Set the volume, and volume ramps.
|
sl@0
|
1180 |
iAudioPlayAgent->SetVolume((iVolumeOrGain*iMaxVolume)/100, iRamp);
|
sl@0
|
1181 |
}
|
sl@0
|
1182 |
break;
|
sl@0
|
1183 |
|
sl@0
|
1184 |
case EAudioRecord:
|
sl@0
|
1185 |
{
|
sl@0
|
1186 |
//And set the maximum volume based on the device's audio capabilities
|
sl@0
|
1187 |
iMaxVolume = iAudioRecordAgent->MaxGain();
|
sl@0
|
1188 |
//Set the volume, and volume ramps.
|
sl@0
|
1189 |
iAudioRecordAgent->SetGain((iVolumeOrGain*iMaxVolume)/100);
|
sl@0
|
1190 |
}
|
sl@0
|
1191 |
break;
|
sl@0
|
1192 |
|
sl@0
|
1193 |
case EVideoPlay:
|
sl@0
|
1194 |
{
|
sl@0
|
1195 |
iMaxVolume = iVideoPlayAgent->MaxVolume();
|
sl@0
|
1196 |
iVideoPlayAgent->SetVolumeL((iVolumeOrGain*iMaxVolume)/100);
|
sl@0
|
1197 |
}
|
sl@0
|
1198 |
break;
|
sl@0
|
1199 |
|
sl@0
|
1200 |
case EVideoRecord:
|
sl@0
|
1201 |
{
|
sl@0
|
1202 |
iMaxVolume = iVideoRecordAgent->MaxGainL();
|
sl@0
|
1203 |
iVideoRecordAgent->SetGainL((iVolumeOrGain*iMaxVolume)/100);
|
sl@0
|
1204 |
}
|
sl@0
|
1205 |
break;
|
sl@0
|
1206 |
|
sl@0
|
1207 |
case EIdle:
|
sl@0
|
1208 |
break;
|
sl@0
|
1209 |
|
sl@0
|
1210 |
default:
|
sl@0
|
1211 |
ASSERT(EFalse);
|
sl@0
|
1212 |
break;
|
sl@0
|
1213 |
}
|
sl@0
|
1214 |
}
|
sl@0
|
1215 |
|
sl@0
|
1216 |
|
sl@0
|
1217 |
//Set repeats
|
sl@0
|
1218 |
void CMVSAppUi::SetRepeats(TInt aNoRepeats, TTimeIntervalMicroSeconds aDelay)
|
sl@0
|
1219 |
{
|
sl@0
|
1220 |
//Initialise the repeat variables based on the parameters
|
sl@0
|
1221 |
iNoRepeats = aNoRepeats;
|
sl@0
|
1222 |
iRepeatDelay = aDelay;
|
sl@0
|
1223 |
switch(iMode)
|
sl@0
|
1224 |
{
|
sl@0
|
1225 |
case EAudioPlay:
|
sl@0
|
1226 |
//Set the repeat settings based on these values
|
sl@0
|
1227 |
iAudioPlayAgent->SetRepeats(iNoRepeats, iRepeatDelay);
|
sl@0
|
1228 |
break;
|
sl@0
|
1229 |
|
sl@0
|
1230 |
case EAudioRecord:
|
sl@0
|
1231 |
//Set the repeat settings based on these values
|
sl@0
|
1232 |
iAudioRecordAgent->SetRepeats(iNoRepeats, iRepeatDelay);
|
sl@0
|
1233 |
break;
|
sl@0
|
1234 |
default:
|
sl@0
|
1235 |
break;
|
sl@0
|
1236 |
}
|
sl@0
|
1237 |
}
|
sl@0
|
1238 |
|
sl@0
|
1239 |
//Balance settings
|
sl@0
|
1240 |
//
|
sl@0
|
1241 |
//
|
sl@0
|
1242 |
//
|
sl@0
|
1243 |
// Sets the balance, based on the argument. This value is translated to both
|
sl@0
|
1244 |
// the playback AND recording balance for the device.
|
sl@0
|
1245 |
//
|
sl@0
|
1246 |
void CMVSAppUi::SetBalanceL(TInt aBalance)
|
sl@0
|
1247 |
{
|
sl@0
|
1248 |
iBalance = aBalance;
|
sl@0
|
1249 |
switch(iMode)
|
sl@0
|
1250 |
{
|
sl@0
|
1251 |
case EAudioPlay:
|
sl@0
|
1252 |
iAudioPlayAgent->SetBalance(iBalance);
|
sl@0
|
1253 |
break;
|
sl@0
|
1254 |
|
sl@0
|
1255 |
case EAudioRecord:
|
sl@0
|
1256 |
iAudioRecordAgent->SetRecordBalance(iBalance);
|
sl@0
|
1257 |
break;
|
sl@0
|
1258 |
|
sl@0
|
1259 |
case EVideoPlay:
|
sl@0
|
1260 |
iVideoPlayAgent->SetBalanceL(iBalance);
|
sl@0
|
1261 |
break;
|
sl@0
|
1262 |
|
sl@0
|
1263 |
case EVideoRecord:
|
sl@0
|
1264 |
User::InfoPrint(KNotsupported);
|
sl@0
|
1265 |
break;
|
sl@0
|
1266 |
|
sl@0
|
1267 |
case EIdle:
|
sl@0
|
1268 |
break;
|
sl@0
|
1269 |
|
sl@0
|
1270 |
default:
|
sl@0
|
1271 |
ASSERT(EFalse);
|
sl@0
|
1272 |
break;
|
sl@0
|
1273 |
|
sl@0
|
1274 |
}
|
sl@0
|
1275 |
}
|
sl@0
|
1276 |
|
sl@0
|
1277 |
|
sl@0
|
1278 |
//
|
sl@0
|
1279 |
//SetPriorityL(...)
|
sl@0
|
1280 |
//
|
sl@0
|
1281 |
// Sets the audio priority, and the priority preference, based on the
|
sl@0
|
1282 |
// arguments.
|
sl@0
|
1283 |
//
|
sl@0
|
1284 |
void CMVSAppUi::SetPriorityL(TInt aPriority,
|
sl@0
|
1285 |
TMdaPriorityPreference aPriorityPreference)
|
sl@0
|
1286 |
{
|
sl@0
|
1287 |
iPriority = aPriority;
|
sl@0
|
1288 |
iPriorityPreference = aPriorityPreference;
|
sl@0
|
1289 |
switch(iMode)
|
sl@0
|
1290 |
{
|
sl@0
|
1291 |
case EAudioPlay:
|
sl@0
|
1292 |
iAudioPlayAgent->SetPriority(iPriority,iPriorityPreference);
|
sl@0
|
1293 |
break;
|
sl@0
|
1294 |
|
sl@0
|
1295 |
case EVideoPlay:
|
sl@0
|
1296 |
iVideoPlayAgent->SetPriorityL(iPriority,iPriorityPreference);
|
sl@0
|
1297 |
break;
|
sl@0
|
1298 |
|
sl@0
|
1299 |
case EAudioRecord:
|
sl@0
|
1300 |
iAudioRecordAgent->SetPriority(iPriority,iPriorityPreference);
|
sl@0
|
1301 |
break;
|
sl@0
|
1302 |
|
sl@0
|
1303 |
case EVideoRecord:
|
sl@0
|
1304 |
iVideoRecordAgent->SetPriorityL(iPriority,iPriorityPreference);
|
sl@0
|
1305 |
break;
|
sl@0
|
1306 |
|
sl@0
|
1307 |
case EIdle:
|
sl@0
|
1308 |
break;
|
sl@0
|
1309 |
|
sl@0
|
1310 |
default:
|
sl@0
|
1311 |
ASSERT(EFalse);
|
sl@0
|
1312 |
break;
|
sl@0
|
1313 |
}
|
sl@0
|
1314 |
}
|
sl@0
|
1315 |
|
sl@0
|
1316 |
|
sl@0
|
1317 |
//
|
sl@0
|
1318 |
//SetPlayWindow(...)
|
sl@0
|
1319 |
//
|
sl@0
|
1320 |
// Sets the play window, based on the
|
sl@0
|
1321 |
// arguments.
|
sl@0
|
1322 |
// return value indicates if the operation is successful or not.
|
sl@0
|
1323 |
TBool CMVSAppUi::SetPlayWindow(TTimeIntervalMicroSeconds aStart,
|
sl@0
|
1324 |
TTimeIntervalMicroSeconds aEnd)
|
sl@0
|
1325 |
{
|
sl@0
|
1326 |
iStart = aStart;
|
sl@0
|
1327 |
iEnd = aEnd;
|
sl@0
|
1328 |
TInt err = iAudioPlayAgent->SetPlayWindow(iStart,iEnd);
|
sl@0
|
1329 |
if(err != KErrNone)
|
sl@0
|
1330 |
{
|
sl@0
|
1331 |
LogErrors(err);
|
sl@0
|
1332 |
iStart = 0;
|
sl@0
|
1333 |
iEnd = iDuration;
|
sl@0
|
1334 |
return EFalse;
|
sl@0
|
1335 |
}
|
sl@0
|
1336 |
else
|
sl@0
|
1337 |
{
|
sl@0
|
1338 |
return ETrue;
|
sl@0
|
1339 |
}
|
sl@0
|
1340 |
}
|
sl@0
|
1341 |
|
sl@0
|
1342 |
|
sl@0
|
1343 |
//
|
sl@0
|
1344 |
//SetMetaDataL(...)
|
sl@0
|
1345 |
//
|
sl@0
|
1346 |
// Sets the MetaData, based on the arguments
|
sl@0
|
1347 |
//
|
sl@0
|
1348 |
void CMVSAppUi::SetMetaDataL(RPointerArray<CMMFMetaDataEntry> aMetaArray)
|
sl@0
|
1349 |
{
|
sl@0
|
1350 |
switch(iMode)
|
sl@0
|
1351 |
{
|
sl@0
|
1352 |
case EAudioRecord:
|
sl@0
|
1353 |
iAudioRecordAgent->SetMetaDataL(aMetaArray);
|
sl@0
|
1354 |
break;
|
sl@0
|
1355 |
|
sl@0
|
1356 |
case EVideoRecord:
|
sl@0
|
1357 |
iVideoRecordAgent->SetMetaDataL(aMetaArray);
|
sl@0
|
1358 |
break;
|
sl@0
|
1359 |
default:
|
sl@0
|
1360 |
ASSERT(EFalse);
|
sl@0
|
1361 |
break;
|
sl@0
|
1362 |
}
|
sl@0
|
1363 |
|
sl@0
|
1364 |
}
|
sl@0
|
1365 |
|
sl@0
|
1366 |
|
sl@0
|
1367 |
//
|
sl@0
|
1368 |
//GetMetaDataL(...)
|
sl@0
|
1369 |
//
|
sl@0
|
1370 |
// Sets the MetaData, based on the arguments
|
sl@0
|
1371 |
//
|
sl@0
|
1372 |
void CMVSAppUi::GetMetaDataL(RPointerArray<CMMFMetaDataEntry>& aMetaArray)
|
sl@0
|
1373 |
{
|
sl@0
|
1374 |
switch(iMode)
|
sl@0
|
1375 |
{
|
sl@0
|
1376 |
case EAudioPlay:
|
sl@0
|
1377 |
iAudioPlayAgent->GetMetaArrayL(aMetaArray);
|
sl@0
|
1378 |
break;
|
sl@0
|
1379 |
|
sl@0
|
1380 |
case EVideoPlay:
|
sl@0
|
1381 |
iVideoPlayAgent->GetMetaDataArrayL(aMetaArray);
|
sl@0
|
1382 |
break;
|
sl@0
|
1383 |
default:
|
sl@0
|
1384 |
ASSERT(EFalse);
|
sl@0
|
1385 |
break;
|
sl@0
|
1386 |
}
|
sl@0
|
1387 |
|
sl@0
|
1388 |
}
|
sl@0
|
1389 |
|
sl@0
|
1390 |
|
sl@0
|
1391 |
|
sl@0
|
1392 |
//
|
sl@0
|
1393 |
//SetCrop(...)
|
sl@0
|
1394 |
//
|
sl@0
|
1395 |
// Sets the crop window, and also whether to crop from begining
|
sl@0
|
1396 |
// or end, based on the arguments passed
|
sl@0
|
1397 |
//
|
sl@0
|
1398 |
void CMVSAppUi::SetCropL(TTimeIntervalMicroSeconds aCropStart,TBool aCropFromBeginning)
|
sl@0
|
1399 |
{
|
sl@0
|
1400 |
iAudioRecordAgent->CropClipL(aCropStart,aCropFromBeginning);
|
sl@0
|
1401 |
iCropStart=aCropStart;
|
sl@0
|
1402 |
iCropFromBeginning=aCropFromBeginning;
|
sl@0
|
1403 |
}
|
sl@0
|
1404 |
|
sl@0
|
1405 |
|
sl@0
|
1406 |
void CMVSAppUi::SetBitRateL(TUint aBitRate)
|
sl@0
|
1407 |
{
|
sl@0
|
1408 |
TRAPD(err,iAudioRecordAgent->SetDestinationBitRateL(aBitRate));
|
sl@0
|
1409 |
if(err != KErrNone)
|
sl@0
|
1410 |
{
|
sl@0
|
1411 |
iLogger.Write(_L("SetDestinationBitRateL returned err"));
|
sl@0
|
1412 |
}
|
sl@0
|
1413 |
else
|
sl@0
|
1414 |
{
|
sl@0
|
1415 |
iBitRate = aBitRate;
|
sl@0
|
1416 |
}
|
sl@0
|
1417 |
}
|
sl@0
|
1418 |
|
sl@0
|
1419 |
|
sl@0
|
1420 |
void CMVSAppUi::SetSampleRateL(TUint aSampleRate)
|
sl@0
|
1421 |
{
|
sl@0
|
1422 |
iAudioRecordAgent->SetDestinationSampleRateL(aSampleRate);
|
sl@0
|
1423 |
iSampleRate = aSampleRate;
|
sl@0
|
1424 |
}
|
sl@0
|
1425 |
|
sl@0
|
1426 |
void CMVSAppUi::SetChannelsL(TUint aNumberOfChannels)
|
sl@0
|
1427 |
{
|
sl@0
|
1428 |
iAudioRecordAgent->SetDestinationNumberOfChannelsL(aNumberOfChannels);
|
sl@0
|
1429 |
iChannels = aNumberOfChannels;
|
sl@0
|
1430 |
}
|
sl@0
|
1431 |
|
sl@0
|
1432 |
void CMVSAppUi::SetCodecsL(TFourCC aDataType)
|
sl@0
|
1433 |
{
|
sl@0
|
1434 |
iAudioRecordAgent->SetDestinationDataTypeL(aDataType);
|
sl@0
|
1435 |
}
|
sl@0
|
1436 |
|
sl@0
|
1437 |
|
sl@0
|
1438 |
|
sl@0
|
1439 |
void CMVSAppUi::InitializeMetaArrayL()
|
sl@0
|
1440 |
{
|
sl@0
|
1441 |
//Reset the meta array
|
sl@0
|
1442 |
iMetaArray.Reset();
|
sl@0
|
1443 |
if(iMetaTitle != NULL)
|
sl@0
|
1444 |
{
|
sl@0
|
1445 |
iMetaArray.AppendL(iMetaTitle);
|
sl@0
|
1446 |
}
|
sl@0
|
1447 |
|
sl@0
|
1448 |
if(iMetaAuthor != NULL)
|
sl@0
|
1449 |
{
|
sl@0
|
1450 |
iMetaArray.AppendL(iMetaAuthor);
|
sl@0
|
1451 |
}
|
sl@0
|
1452 |
|
sl@0
|
1453 |
if(iMetaCopyright != NULL)
|
sl@0
|
1454 |
{
|
sl@0
|
1455 |
iMetaArray.AppendL(iMetaCopyright);
|
sl@0
|
1456 |
}
|
sl@0
|
1457 |
|
sl@0
|
1458 |
if(iMetaRevision != NULL)
|
sl@0
|
1459 |
{
|
sl@0
|
1460 |
iMetaArray.AppendL(iMetaRevision);
|
sl@0
|
1461 |
}
|
sl@0
|
1462 |
|
sl@0
|
1463 |
if(iMetaCategory != NULL)
|
sl@0
|
1464 |
{
|
sl@0
|
1465 |
iMetaArray.AppendL(iMetaCategory);
|
sl@0
|
1466 |
}
|
sl@0
|
1467 |
|
sl@0
|
1468 |
if(iMetaComments != NULL)
|
sl@0
|
1469 |
{
|
sl@0
|
1470 |
iMetaArray.AppendL(iMetaComments);
|
sl@0
|
1471 |
}
|
sl@0
|
1472 |
}
|
sl@0
|
1473 |
|
sl@0
|
1474 |
//
|
sl@0
|
1475 |
//DynInitMenuPaneL(...) *** This method can LEAVE ***
|
sl@0
|
1476 |
//
|
sl@0
|
1477 |
// Initialises the availibility of controls on the menu bar depending on the
|
sl@0
|
1478 |
// current state of the MVSApp. This allows the application to
|
sl@0
|
1479 |
// constrain the availibility of controls which are inappropriate in certain
|
sl@0
|
1480 |
// states.
|
sl@0
|
1481 |
//
|
sl@0
|
1482 |
|
sl@0
|
1483 |
void CMVSAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
|
sl@0
|
1484 |
{
|
sl@0
|
1485 |
switch(iMode)
|
sl@0
|
1486 |
{
|
sl@0
|
1487 |
case (EAudioRecord):
|
sl@0
|
1488 |
//File menu
|
sl@0
|
1489 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1490 |
{
|
sl@0
|
1491 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1492 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,ETrue);
|
sl@0
|
1493 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1494 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1495 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1496 |
}
|
sl@0
|
1497 |
|
sl@0
|
1498 |
//Edit Menu
|
sl@0
|
1499 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1500 |
{
|
sl@0
|
1501 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,EFalse);
|
sl@0
|
1502 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,ETrue);
|
sl@0
|
1503 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,ETrue);
|
sl@0
|
1504 |
}
|
sl@0
|
1505 |
|
sl@0
|
1506 |
//Settings menu >
|
sl@0
|
1507 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1508 |
{
|
sl@0
|
1509 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,EFalse);
|
sl@0
|
1510 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,ETrue);
|
sl@0
|
1511 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,EFalse);
|
sl@0
|
1512 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,ETrue);
|
sl@0
|
1513 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1514 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, ETrue);
|
sl@0
|
1515 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, ETrue);
|
sl@0
|
1516 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1517 |
}
|
sl@0
|
1518 |
|
sl@0
|
1519 |
if(iState == EAudioRecording)
|
sl@0
|
1520 |
{
|
sl@0
|
1521 |
//Controls menu
|
sl@0
|
1522 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1523 |
{
|
sl@0
|
1524 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,ETrue);
|
sl@0
|
1525 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1526 |
aMenuPane->SetItemDimmed(EMVSCmdStop,EFalse);
|
sl@0
|
1527 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1528 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1529 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1530 |
}
|
sl@0
|
1531 |
}
|
sl@0
|
1532 |
else
|
sl@0
|
1533 |
{
|
sl@0
|
1534 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1535 |
{
|
sl@0
|
1536 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,ETrue);
|
sl@0
|
1537 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1538 |
aMenuPane->SetItemDimmed(EMVSCmdStop,ETrue);
|
sl@0
|
1539 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1540 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1541 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,EFalse);
|
sl@0
|
1542 |
}
|
sl@0
|
1543 |
}
|
sl@0
|
1544 |
break;
|
sl@0
|
1545 |
|
sl@0
|
1546 |
|
sl@0
|
1547 |
case (EVideoRecord):
|
sl@0
|
1548 |
//File menu
|
sl@0
|
1549 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1550 |
{
|
sl@0
|
1551 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1552 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,ETrue);
|
sl@0
|
1553 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1554 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1555 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1556 |
}
|
sl@0
|
1557 |
|
sl@0
|
1558 |
//Edit Menu
|
sl@0
|
1559 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1560 |
{
|
sl@0
|
1561 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1562 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,ETrue);
|
sl@0
|
1563 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,ETrue);
|
sl@0
|
1564 |
}
|
sl@0
|
1565 |
|
sl@0
|
1566 |
//Settings menu >
|
sl@0
|
1567 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1568 |
{
|
sl@0
|
1569 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,ETrue);
|
sl@0
|
1570 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,ETrue);
|
sl@0
|
1571 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,EFalse);
|
sl@0
|
1572 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,ETrue);
|
sl@0
|
1573 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1574 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, ETrue);
|
sl@0
|
1575 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, ETrue);
|
sl@0
|
1576 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1577 |
}
|
sl@0
|
1578 |
|
sl@0
|
1579 |
if(iState == EVideoRecording)
|
sl@0
|
1580 |
{
|
sl@0
|
1581 |
//File menu
|
sl@0
|
1582 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1583 |
{
|
sl@0
|
1584 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1585 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,ETrue);
|
sl@0
|
1586 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1587 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1588 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1589 |
}
|
sl@0
|
1590 |
|
sl@0
|
1591 |
//Controls menu
|
sl@0
|
1592 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1593 |
{
|
sl@0
|
1594 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,ETrue);
|
sl@0
|
1595 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1596 |
aMenuPane->SetItemDimmed(EMVSCmdStop,EFalse);
|
sl@0
|
1597 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1598 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1599 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1600 |
}
|
sl@0
|
1601 |
}
|
sl@0
|
1602 |
else
|
sl@0
|
1603 |
{
|
sl@0
|
1604 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1605 |
{
|
sl@0
|
1606 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,ETrue);
|
sl@0
|
1607 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1608 |
aMenuPane->SetItemDimmed(EMVSCmdStop,ETrue);
|
sl@0
|
1609 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1610 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1611 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,EFalse);
|
sl@0
|
1612 |
}
|
sl@0
|
1613 |
}
|
sl@0
|
1614 |
if(iState == EVideoOpened)
|
sl@0
|
1615 |
{
|
sl@0
|
1616 |
//File menu
|
sl@0
|
1617 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1618 |
{
|
sl@0
|
1619 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1620 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,ETrue);
|
sl@0
|
1621 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1622 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1623 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1624 |
}
|
sl@0
|
1625 |
}
|
sl@0
|
1626 |
if(iState == EVideoStopped)
|
sl@0
|
1627 |
{
|
sl@0
|
1628 |
//File menu
|
sl@0
|
1629 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1630 |
{
|
sl@0
|
1631 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1632 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,ETrue);
|
sl@0
|
1633 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1634 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1635 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1636 |
}
|
sl@0
|
1637 |
}
|
sl@0
|
1638 |
break;
|
sl@0
|
1639 |
|
sl@0
|
1640 |
case (EAudioPlay):
|
sl@0
|
1641 |
|
sl@0
|
1642 |
if(iState == EAudioOpened)
|
sl@0
|
1643 |
{
|
sl@0
|
1644 |
//File menu
|
sl@0
|
1645 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1646 |
{
|
sl@0
|
1647 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1648 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,EFalse);
|
sl@0
|
1649 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1650 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1651 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1652 |
}
|
sl@0
|
1653 |
|
sl@0
|
1654 |
//Edit Menu
|
sl@0
|
1655 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1656 |
{
|
sl@0
|
1657 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1658 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,EFalse);
|
sl@0
|
1659 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,EFalse);
|
sl@0
|
1660 |
}
|
sl@0
|
1661 |
|
sl@0
|
1662 |
//Settings menu
|
sl@0
|
1663 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1664 |
{
|
sl@0
|
1665 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,EFalse);
|
sl@0
|
1666 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,ETrue);
|
sl@0
|
1667 |
//aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
1668 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
1669 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1670 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, ETrue);
|
sl@0
|
1671 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, ETrue);
|
sl@0
|
1672 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1673 |
}
|
sl@0
|
1674 |
|
sl@0
|
1675 |
//Controls menu
|
sl@0
|
1676 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1677 |
{
|
sl@0
|
1678 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,EFalse);
|
sl@0
|
1679 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1680 |
aMenuPane->SetItemDimmed(EMVSCmdStop,ETrue);
|
sl@0
|
1681 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1682 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1683 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1684 |
}
|
sl@0
|
1685 |
}
|
sl@0
|
1686 |
|
sl@0
|
1687 |
else if(iState == EAudioPlaying)
|
sl@0
|
1688 |
{
|
sl@0
|
1689 |
//File menu
|
sl@0
|
1690 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1691 |
{
|
sl@0
|
1692 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1693 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,ETrue);
|
sl@0
|
1694 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1695 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1696 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1697 |
}
|
sl@0
|
1698 |
|
sl@0
|
1699 |
//Edit Menu
|
sl@0
|
1700 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1701 |
{
|
sl@0
|
1702 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1703 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,ETrue);
|
sl@0
|
1704 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,ETrue);
|
sl@0
|
1705 |
}
|
sl@0
|
1706 |
|
sl@0
|
1707 |
//Settings menu
|
sl@0
|
1708 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1709 |
{
|
sl@0
|
1710 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,ETrue);
|
sl@0
|
1711 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,ETrue);
|
sl@0
|
1712 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
1713 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
1714 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1715 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, ETrue);
|
sl@0
|
1716 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, ETrue);
|
sl@0
|
1717 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1718 |
}
|
sl@0
|
1719 |
|
sl@0
|
1720 |
//Controls menu
|
sl@0
|
1721 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1722 |
{
|
sl@0
|
1723 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,ETrue);
|
sl@0
|
1724 |
aMenuPane->SetItemDimmed(EMVSCmdPause,EFalse);
|
sl@0
|
1725 |
aMenuPane->SetItemDimmed(EMVSCmdStop,EFalse);
|
sl@0
|
1726 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1727 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1728 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1729 |
}
|
sl@0
|
1730 |
}
|
sl@0
|
1731 |
|
sl@0
|
1732 |
else if(iState == EAudioPaused)
|
sl@0
|
1733 |
{
|
sl@0
|
1734 |
//File menu
|
sl@0
|
1735 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1736 |
{
|
sl@0
|
1737 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1738 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,EFalse);
|
sl@0
|
1739 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1740 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1741 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1742 |
}
|
sl@0
|
1743 |
|
sl@0
|
1744 |
//Edit Menu
|
sl@0
|
1745 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1746 |
{
|
sl@0
|
1747 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1748 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,EFalse);
|
sl@0
|
1749 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,EFalse);
|
sl@0
|
1750 |
}
|
sl@0
|
1751 |
|
sl@0
|
1752 |
//Settings menu
|
sl@0
|
1753 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1754 |
{
|
sl@0
|
1755 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,EFalse);
|
sl@0
|
1756 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,ETrue);
|
sl@0
|
1757 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
1758 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
1759 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1760 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, ETrue);
|
sl@0
|
1761 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, ETrue);
|
sl@0
|
1762 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1763 |
}
|
sl@0
|
1764 |
|
sl@0
|
1765 |
//Controls menu
|
sl@0
|
1766 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1767 |
{
|
sl@0
|
1768 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,EFalse);
|
sl@0
|
1769 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1770 |
aMenuPane->SetItemDimmed(EMVSCmdStop,EFalse);
|
sl@0
|
1771 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1772 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1773 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1774 |
}
|
sl@0
|
1775 |
}
|
sl@0
|
1776 |
else if(iState == EAudioStopped)
|
sl@0
|
1777 |
{
|
sl@0
|
1778 |
//File menu
|
sl@0
|
1779 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1780 |
{
|
sl@0
|
1781 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1782 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,EFalse);
|
sl@0
|
1783 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1784 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1785 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1786 |
}
|
sl@0
|
1787 |
|
sl@0
|
1788 |
//Edit Menu
|
sl@0
|
1789 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1790 |
{
|
sl@0
|
1791 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1792 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,EFalse);
|
sl@0
|
1793 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,EFalse);
|
sl@0
|
1794 |
}
|
sl@0
|
1795 |
|
sl@0
|
1796 |
//Settings menu
|
sl@0
|
1797 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1798 |
{
|
sl@0
|
1799 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,EFalse);
|
sl@0
|
1800 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,ETrue);
|
sl@0
|
1801 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
1802 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
1803 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1804 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, ETrue);
|
sl@0
|
1805 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, ETrue);
|
sl@0
|
1806 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1807 |
}
|
sl@0
|
1808 |
|
sl@0
|
1809 |
//Controls menu
|
sl@0
|
1810 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1811 |
{
|
sl@0
|
1812 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,EFalse);
|
sl@0
|
1813 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1814 |
aMenuPane->SetItemDimmed(EMVSCmdStop,ETrue);
|
sl@0
|
1815 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1816 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1817 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1818 |
}
|
sl@0
|
1819 |
}
|
sl@0
|
1820 |
break;
|
sl@0
|
1821 |
|
sl@0
|
1822 |
case (EVideoPlay):
|
sl@0
|
1823 |
if(iState == EVideoOpened)
|
sl@0
|
1824 |
{
|
sl@0
|
1825 |
//File menu
|
sl@0
|
1826 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1827 |
{
|
sl@0
|
1828 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1829 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,ETrue);
|
sl@0
|
1830 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1831 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1832 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1833 |
}
|
sl@0
|
1834 |
|
sl@0
|
1835 |
//Edit Menu
|
sl@0
|
1836 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1837 |
{
|
sl@0
|
1838 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1839 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,ETrue);
|
sl@0
|
1840 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,ETrue);
|
sl@0
|
1841 |
}
|
sl@0
|
1842 |
|
sl@0
|
1843 |
//Settings menu
|
sl@0
|
1844 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1845 |
{
|
sl@0
|
1846 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,ETrue);
|
sl@0
|
1847 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,EFalse);
|
sl@0
|
1848 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
1849 |
aMenuPane->SetItemDimmed(EMVSCmdMultiScreen,EFalse);
|
sl@0
|
1850 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
1851 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1852 |
TBool subAvail = iVideoPlayAgent->SubtitlesAvailable();
|
sl@0
|
1853 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, !subAvail);
|
sl@0
|
1854 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, !subAvail);
|
sl@0
|
1855 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1856 |
}
|
sl@0
|
1857 |
|
sl@0
|
1858 |
//Controls menu
|
sl@0
|
1859 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1860 |
{
|
sl@0
|
1861 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,EFalse);
|
sl@0
|
1862 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1863 |
aMenuPane->SetItemDimmed(EMVSCmdStop,ETrue);
|
sl@0
|
1864 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1865 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1866 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1867 |
}
|
sl@0
|
1868 |
}
|
sl@0
|
1869 |
|
sl@0
|
1870 |
else if(iState == EVideoPlaying)
|
sl@0
|
1871 |
{
|
sl@0
|
1872 |
//File menu
|
sl@0
|
1873 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1874 |
{
|
sl@0
|
1875 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1876 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,ETrue);
|
sl@0
|
1877 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1878 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,ETrue);
|
sl@0
|
1879 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1880 |
}
|
sl@0
|
1881 |
|
sl@0
|
1882 |
//Edit Menu
|
sl@0
|
1883 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1884 |
{
|
sl@0
|
1885 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1886 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,ETrue);
|
sl@0
|
1887 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,ETrue);
|
sl@0
|
1888 |
}
|
sl@0
|
1889 |
|
sl@0
|
1890 |
//Settings menu
|
sl@0
|
1891 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1892 |
{
|
sl@0
|
1893 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,ETrue);
|
sl@0
|
1894 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,EFalse);
|
sl@0
|
1895 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
1896 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
1897 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1898 |
TBool subAvail = iVideoPlayAgent->SubtitlesAvailable();
|
sl@0
|
1899 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, !subAvail);
|
sl@0
|
1900 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, !subAvail);
|
sl@0
|
1901 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1902 |
}
|
sl@0
|
1903 |
|
sl@0
|
1904 |
//Controls menu
|
sl@0
|
1905 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1906 |
{
|
sl@0
|
1907 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,ETrue);
|
sl@0
|
1908 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1909 |
aMenuPane->SetItemDimmed(EMVSCmdStop,EFalse);
|
sl@0
|
1910 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1911 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1912 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1913 |
}
|
sl@0
|
1914 |
}
|
sl@0
|
1915 |
else if(iState == EVideoPaused)
|
sl@0
|
1916 |
{
|
sl@0
|
1917 |
//File menu
|
sl@0
|
1918 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1919 |
{
|
sl@0
|
1920 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1921 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,EFalse);
|
sl@0
|
1922 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1923 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1924 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1925 |
}
|
sl@0
|
1926 |
|
sl@0
|
1927 |
//Edit Menu
|
sl@0
|
1928 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1929 |
{
|
sl@0
|
1930 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1931 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,ETrue);
|
sl@0
|
1932 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,ETrue);
|
sl@0
|
1933 |
}
|
sl@0
|
1934 |
|
sl@0
|
1935 |
//Settings menu
|
sl@0
|
1936 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1937 |
{
|
sl@0
|
1938 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,ETrue);
|
sl@0
|
1939 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,EFalse);
|
sl@0
|
1940 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
1941 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
1942 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1943 |
TBool subAvail = iVideoPlayAgent->SubtitlesAvailable();
|
sl@0
|
1944 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, !subAvail);
|
sl@0
|
1945 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, !subAvail);
|
sl@0
|
1946 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1947 |
}
|
sl@0
|
1948 |
|
sl@0
|
1949 |
//Controls menu
|
sl@0
|
1950 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1951 |
{
|
sl@0
|
1952 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,EFalse);
|
sl@0
|
1953 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1954 |
aMenuPane->SetItemDimmed(EMVSCmdStop,EFalse);
|
sl@0
|
1955 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
1956 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
1957 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
1958 |
}
|
sl@0
|
1959 |
}
|
sl@0
|
1960 |
else if(iState == EVideoStopped)
|
sl@0
|
1961 |
{
|
sl@0
|
1962 |
//File menu
|
sl@0
|
1963 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
1964 |
{
|
sl@0
|
1965 |
aMenuPane->SetItemDimmed(EMVSCmdNew,ETrue);
|
sl@0
|
1966 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,EFalse);
|
sl@0
|
1967 |
aMenuPane->SetItemDimmed(EMVSCmdClose,EFalse);
|
sl@0
|
1968 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
1969 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
1970 |
}
|
sl@0
|
1971 |
|
sl@0
|
1972 |
//Edit Menu
|
sl@0
|
1973 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
1974 |
{
|
sl@0
|
1975 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
1976 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,ETrue);
|
sl@0
|
1977 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,ETrue);
|
sl@0
|
1978 |
}
|
sl@0
|
1979 |
|
sl@0
|
1980 |
//Settings menu
|
sl@0
|
1981 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
1982 |
{
|
sl@0
|
1983 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,ETrue);
|
sl@0
|
1984 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,EFalse);
|
sl@0
|
1985 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
1986 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
1987 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1988 |
TBool subAvail = iVideoPlayAgent->SubtitlesAvailable();
|
sl@0
|
1989 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, !subAvail);
|
sl@0
|
1990 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, !subAvail);
|
sl@0
|
1991 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
1992 |
}
|
sl@0
|
1993 |
|
sl@0
|
1994 |
//Controls menu
|
sl@0
|
1995 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
1996 |
{
|
sl@0
|
1997 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,EFalse);
|
sl@0
|
1998 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
1999 |
aMenuPane->SetItemDimmed(EMVSCmdStop,ETrue);
|
sl@0
|
2000 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
2001 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
2002 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
2003 |
}
|
sl@0
|
2004 |
}
|
sl@0
|
2005 |
break;
|
sl@0
|
2006 |
|
sl@0
|
2007 |
case (EIdle):
|
sl@0
|
2008 |
//File menu
|
sl@0
|
2009 |
if(aResourceId == R_MVS_FILE_MENU)
|
sl@0
|
2010 |
{
|
sl@0
|
2011 |
aMenuPane->SetItemDimmed(EMVSCmdNew,EFalse);
|
sl@0
|
2012 |
aMenuPane->SetItemDimmed(EMVSCmdOpen,EFalse);
|
sl@0
|
2013 |
aMenuPane->SetItemDimmed(EMVSCmdClose,ETrue);
|
sl@0
|
2014 |
aMenuPane->SetItemDimmed(EMVSCmdSystemInfo,EFalse);
|
sl@0
|
2015 |
aMenuPane->SetItemDimmed(EMVSCmdExit,EFalse);
|
sl@0
|
2016 |
}
|
sl@0
|
2017 |
|
sl@0
|
2018 |
//Edit Menu
|
sl@0
|
2019 |
if(aResourceId == R_MVS_EDIT_MENU)
|
sl@0
|
2020 |
{
|
sl@0
|
2021 |
aMenuPane->SetItemDimmed(EMVSCmdSetCropWindow,ETrue);
|
sl@0
|
2022 |
aMenuPane->SetItemDimmed(EMVSCmdSetPlayWindow,ETrue);
|
sl@0
|
2023 |
aMenuPane->SetItemDimmed(EMVSCmdClearPlayWindow,ETrue);
|
sl@0
|
2024 |
}
|
sl@0
|
2025 |
|
sl@0
|
2026 |
//Settings menu >
|
sl@0
|
2027 |
if(aResourceId == R_MVS_SETTINGS_MENU)
|
sl@0
|
2028 |
{
|
sl@0
|
2029 |
aMenuPane->SetItemDimmed(EMVSCmdAudioSetting,ETrue);
|
sl@0
|
2030 |
aMenuPane->SetItemDimmed(EMVSVideoCmdSettings,ETrue);
|
sl@0
|
2031 |
aMenuPane->SetItemDimmed(EMVSCmdEditMetadata,ETrue);
|
sl@0
|
2032 |
aMenuPane->SetItemDimmed(EMVSCmdMultiScreen,EFalse);
|
sl@0
|
2033 |
aMenuPane->SetItemDimmed(EMVSCmdClearLog,EFalse);
|
sl@0
|
2034 |
#ifdef SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
2035 |
aMenuPane->SetItemDimmed(EMVSCmdEnableSubtitles, ETrue);
|
sl@0
|
2036 |
aMenuPane->SetItemDimmed(EMVSCmdDisableSubtitles, ETrue);
|
sl@0
|
2037 |
#endif //SYMBIAN_MULTIMEDIA_SUBTITLE_SUPPORT
|
sl@0
|
2038 |
}
|
sl@0
|
2039 |
|
sl@0
|
2040 |
//Controls menu
|
sl@0
|
2041 |
if(aResourceId == R_MVS_CONTROLS_MENU)
|
sl@0
|
2042 |
{
|
sl@0
|
2043 |
aMenuPane->SetItemDimmed(EMVSCmdPlay,ETrue);
|
sl@0
|
2044 |
aMenuPane->SetItemDimmed(EMVSCmdPause,ETrue);
|
sl@0
|
2045 |
aMenuPane->SetItemDimmed(EMVSCmdStop,ETrue);
|
sl@0
|
2046 |
aMenuPane->SetItemDimmed(EMVSCmdRewind,ETrue);
|
sl@0
|
2047 |
aMenuPane->SetItemDimmed(EMVSCmdFastForward,ETrue);
|
sl@0
|
2048 |
aMenuPane->SetItemDimmed(EMVSCmdRecord,ETrue);
|
sl@0
|
2049 |
}
|
sl@0
|
2050 |
break;
|
sl@0
|
2051 |
|
sl@0
|
2052 |
default:
|
sl@0
|
2053 |
ASSERT(EFalse);
|
sl@0
|
2054 |
break;
|
sl@0
|
2055 |
}
|
sl@0
|
2056 |
}
|
sl@0
|
2057 |
|
sl@0
|
2058 |
|
sl@0
|
2059 |
void CMVSAppUi::InternalizeL(RReadStream& aStream)
|
sl@0
|
2060 |
{
|
sl@0
|
2061 |
iVolumeOrGain = aStream.ReadInt32L();
|
sl@0
|
2062 |
iBalance = aStream.ReadInt32L();
|
sl@0
|
2063 |
iNoRepeats = aStream.ReadInt32L();
|
sl@0
|
2064 |
iRepeatDelay = aStream.ReadReal64L();
|
sl@0
|
2065 |
}
|
sl@0
|
2066 |
|
sl@0
|
2067 |
void CMVSAppUi::ExternalizeL(RWriteStream& aStream)
|
sl@0
|
2068 |
{
|
sl@0
|
2069 |
aStream.WriteInt32L(iVolumeOrGain);
|
sl@0
|
2070 |
aStream.WriteInt32L(iBalance);
|
sl@0
|
2071 |
aStream.WriteInt32L(iNoRepeats);
|
sl@0
|
2072 |
aStream.WriteReal64L(iRepeatDelay.Int64());
|
sl@0
|
2073 |
}
|
sl@0
|
2074 |
|
sl@0
|
2075 |
//Returns the selected controller plugin from the UI
|
sl@0
|
2076 |
void CMVSAppUi::SelectedPluginIdx(TInt aIdx)
|
sl@0
|
2077 |
{
|
sl@0
|
2078 |
iSelectedPluginIdx = aIdx;
|
sl@0
|
2079 |
}
|
sl@0
|
2080 |
|
sl@0
|
2081 |
//Returns the selected Extension from the UI
|
sl@0
|
2082 |
void CMVSAppUi::SelectedExtension(TDesC16& aDes)
|
sl@0
|
2083 |
{
|
sl@0
|
2084 |
iControllerExt = aDes;
|
sl@0
|
2085 |
}
|
sl@0
|
2086 |
|
sl@0
|
2087 |
|
sl@0
|
2088 |
TInt CMVSAppUi::GetExtensionListL(CDesCArrayFlat* aExtArray,
|
sl@0
|
2089 |
TBool aMediaType)
|
sl@0
|
2090 |
{
|
sl@0
|
2091 |
return iPluginInfo->GetExtensionListL(aMediaType,aExtArray);
|
sl@0
|
2092 |
}
|
sl@0
|
2093 |
|
sl@0
|
2094 |
|
sl@0
|
2095 |
TInt CMVSAppUi::GetPluginListL(TInt8 aExtIdx,CDesCArrayFlat* aExtArray,CDesCArrayFlat* aPluginArray,TBool aMediaType)
|
sl@0
|
2096 |
{
|
sl@0
|
2097 |
iControllerExt.Copy(aExtArray->operator[](aExtIdx));
|
sl@0
|
2098 |
iAudioUidArray.Reset();
|
sl@0
|
2099 |
iAudioPlayUidArray.Reset();
|
sl@0
|
2100 |
iVideoUidArray.Reset();
|
sl@0
|
2101 |
if(!aMediaType)
|
sl@0
|
2102 |
{
|
sl@0
|
2103 |
return iPluginInfo->GetAudioPluginListL(aPluginArray,iAudioUidArray,iAudioPlayUidArray,&iControllerExt);
|
sl@0
|
2104 |
}
|
sl@0
|
2105 |
else
|
sl@0
|
2106 |
{
|
sl@0
|
2107 |
return iPluginInfo->GetVideoPluginListL(aPluginArray,iVideoUidArray,&iControllerExt);
|
sl@0
|
2108 |
}
|
sl@0
|
2109 |
}
|
sl@0
|
2110 |
|
sl@0
|
2111 |
TInt CMVSAppUi::GetSystemInfoL(CDesCArrayFlat* aPluginArray)
|
sl@0
|
2112 |
{
|
sl@0
|
2113 |
return iPluginInfo->GetPluginListL(aPluginArray,iUidArray);
|
sl@0
|
2114 |
}
|
sl@0
|
2115 |
|
sl@0
|
2116 |
//Returnd the selected media type, ie Audio or Video
|
sl@0
|
2117 |
void CMVSAppUi::SelectedMedia(TBool aMediaType)
|
sl@0
|
2118 |
{
|
sl@0
|
2119 |
iMediaType = aMediaType;
|
sl@0
|
2120 |
}
|
sl@0
|
2121 |
|
sl@0
|
2122 |
|
sl@0
|
2123 |
void CMVSAppUi::GetSupportedBitRatesL(RArray <TUint>& aBitRateArray)
|
sl@0
|
2124 |
{
|
sl@0
|
2125 |
iAudioRecordAgent->GetSupportedBitRatesArrayL(aBitRateArray);
|
sl@0
|
2126 |
}
|
sl@0
|
2127 |
|
sl@0
|
2128 |
void CMVSAppUi::GetSupportedSampleRatesArrayL(RArray<TUint>& aSampleRatesArray)
|
sl@0
|
2129 |
{
|
sl@0
|
2130 |
iAudioRecordAgent->GetSupportedSampleRatesArrayL(aSampleRatesArray);
|
sl@0
|
2131 |
}
|
sl@0
|
2132 |
|
sl@0
|
2133 |
void CMVSAppUi::GetSupportedNoChannelsArrayL(RArray<TUint>& aNoChannelsArray)
|
sl@0
|
2134 |
{
|
sl@0
|
2135 |
iAudioRecordAgent->GetSupportedNoChannelsArrayL(aNoChannelsArray);
|
sl@0
|
2136 |
}
|
sl@0
|
2137 |
|
sl@0
|
2138 |
void CMVSAppUi::GetSupportedCodecsArrayL(RArray<TFourCC>& aCodecsArray)
|
sl@0
|
2139 |
{
|
sl@0
|
2140 |
iAudioRecordAgent->GetSupportedCodecsArrayL(aCodecsArray);
|
sl@0
|
2141 |
}
|
sl@0
|
2142 |
|
sl@0
|
2143 |
void CMVSAppUi::GetSupportedFrameRatesL(RArray <TReal32>& aFrameRateArray)
|
sl@0
|
2144 |
{
|
sl@0
|
2145 |
iVideoRecordAgent->GetSupportedFrameRatesArrayL(aFrameRateArray);
|
sl@0
|
2146 |
}
|
sl@0
|
2147 |
|
sl@0
|
2148 |
void CMVSAppUi::GetSupportedFrameSizeArrayL(RArray <TSize>& aFrameSizeArray)
|
sl@0
|
2149 |
{
|
sl@0
|
2150 |
iVideoRecordAgent->GetSupportedFrameSizesArrayL(aFrameSizeArray);
|
sl@0
|
2151 |
}
|
sl@0
|
2152 |
|
sl@0
|
2153 |
void CMVSAppUi::SetVideoFrameRateL(TReal32 aFrameRate)
|
sl@0
|
2154 |
{
|
sl@0
|
2155 |
TRAPD(err,iVideoRecordAgent->SetVideoFrameRateL(aFrameRate));
|
sl@0
|
2156 |
if(err != KErrNone)
|
sl@0
|
2157 |
{
|
sl@0
|
2158 |
iLogger.Write(_L("SetVideoFrameRateL returned err"));
|
sl@0
|
2159 |
}
|
sl@0
|
2160 |
else
|
sl@0
|
2161 |
{
|
sl@0
|
2162 |
iVideoFrameRate = aFrameRate;
|
sl@0
|
2163 |
}
|
sl@0
|
2164 |
}
|
sl@0
|
2165 |
|
sl@0
|
2166 |
void CMVSAppUi::SetVideoFrameSizeL(TSize aFrameSize)
|
sl@0
|
2167 |
{
|
sl@0
|
2168 |
TRAPD(err,iVideoRecordAgent->SetVideoFrameSizeL(aFrameSize));
|
sl@0
|
2169 |
if(err != KErrNone)
|
sl@0
|
2170 |
{
|
sl@0
|
2171 |
iLogger.Write(_L("SetVideoFrameRateL returned err"));
|
sl@0
|
2172 |
}
|
sl@0
|
2173 |
else
|
sl@0
|
2174 |
{
|
sl@0
|
2175 |
iFrameSize = aFrameSize;
|
sl@0
|
2176 |
}
|
sl@0
|
2177 |
}
|
sl@0
|
2178 |
|
sl@0
|
2179 |
void CMVSAppUi::SetAudioEnabledL(TBool aAudioEnabled)
|
sl@0
|
2180 |
{
|
sl@0
|
2181 |
iAudioEnabled = aAudioEnabled;
|
sl@0
|
2182 |
iVideoRecordAgent->SetAudioEnabledL(iAudioEnabled);
|
sl@0
|
2183 |
iLogger.Write(_L("Audio Enabled for Video"));
|
sl@0
|
2184 |
}
|
sl@0
|
2185 |
|
sl@0
|
2186 |
void CMVSAppUi::GetSupportedVideoTypesL(CDesC8ArrayFlat& aMimeArray)
|
sl@0
|
2187 |
{
|
sl@0
|
2188 |
iVideoRecordAgent->GetSupportedVideoTypesL(aMimeArray);
|
sl@0
|
2189 |
}
|
sl@0
|
2190 |
|
sl@0
|
2191 |
void CMVSAppUi::SetVideoTypeL(const TDesC8 &aType)
|
sl@0
|
2192 |
{
|
sl@0
|
2193 |
iVideoRecordAgent->SetVideoTypeL(aType);
|
sl@0
|
2194 |
}
|
sl@0
|
2195 |
|
sl@0
|
2196 |
void CMVSAppUi::WriteAudioDataL(CMVSConfigAudioFormatDialog* aAudioFormatDlg,
|
sl@0
|
2197 |
const TUid& aUid)
|
sl@0
|
2198 |
{
|
sl@0
|
2199 |
iSettingManager->WriteAudioDataL(aAudioFormatDlg,aUid);
|
sl@0
|
2200 |
}
|
sl@0
|
2201 |
|
sl@0
|
2202 |
void CMVSAppUi::WriteVideoDataL(CMVSConfigVideoFormatDialog* aVideoFormatDlg,
|
sl@0
|
2203 |
const TUid& aUid)
|
sl@0
|
2204 |
{
|
sl@0
|
2205 |
iSettingManager->WriteVideoDataL(aVideoFormatDlg,aUid);
|
sl@0
|
2206 |
}
|
sl@0
|
2207 |
|
sl@0
|
2208 |
TReal32 CMVSAppUi::GetVideoFrameRateL()
|
sl@0
|
2209 |
{
|
sl@0
|
2210 |
if(iMode == EVideoRecord)
|
sl@0
|
2211 |
{
|
sl@0
|
2212 |
iVideoFrameRate=iVideoRecordAgent->VideoFrameRateL();
|
sl@0
|
2213 |
}
|
sl@0
|
2214 |
else if(iMode == EVideoPlay)
|
sl@0
|
2215 |
{
|
sl@0
|
2216 |
iVideoFrameRate=iVideoPlayAgent->VideoFrameRateL();
|
sl@0
|
2217 |
}
|
sl@0
|
2218 |
return iVideoFrameRate;
|
sl@0
|
2219 |
}
|
sl@0
|
2220 |
|
sl@0
|
2221 |
TVideoRotation CMVSAppUi::GetRotationL()
|
sl@0
|
2222 |
{
|
sl@0
|
2223 |
iVideoRotation = iVideoPlayAgent->RotationL();
|
sl@0
|
2224 |
return iVideoRotation;
|
sl@0
|
2225 |
}
|
sl@0
|
2226 |
|
sl@0
|
2227 |
void CMVSAppUi::SetRotationL(TVideoRotation aRotation)
|
sl@0
|
2228 |
{
|
sl@0
|
2229 |
TRAPD(err, iVideoPlayAgent->SetRotationL(aRotation));
|
sl@0
|
2230 |
if (err == KErrNotSupported)
|
sl@0
|
2231 |
{
|
sl@0
|
2232 |
User::InfoPrint(KNotsupported);
|
sl@0
|
2233 |
iLogger.Write(_L("Error,This feature not supported by the controller"));
|
sl@0
|
2234 |
}
|
sl@0
|
2235 |
else if (err == KErrNotReady)
|
sl@0
|
2236 |
{
|
sl@0
|
2237 |
iLogger.Write(_L("Error, Videoplayer not yet created in the agent"));
|
sl@0
|
2238 |
}
|
sl@0
|
2239 |
else
|
sl@0
|
2240 |
{
|
sl@0
|
2241 |
iRotation = aRotation;
|
sl@0
|
2242 |
}
|
sl@0
|
2243 |
}
|
sl@0
|
2244 |
|
sl@0
|
2245 |
void CMVSAppUi::GetScaleFactorL(TReal32& aScaleWidth, TReal32& aScaleHeight, TBool& aAntiAliasFiltering)
|
sl@0
|
2246 |
{
|
sl@0
|
2247 |
TRAPD(err, iVideoPlayAgent->GetScaleFactorL(aScaleWidth, aScaleHeight, aAntiAliasFiltering));
|
sl@0
|
2248 |
if (err == KErrNotSupported)
|
sl@0
|
2249 |
{
|
sl@0
|
2250 |
User::InfoPrint(KNotsupported);
|
sl@0
|
2251 |
}
|
sl@0
|
2252 |
else if (err == KErrNotReady)
|
sl@0
|
2253 |
{
|
sl@0
|
2254 |
iLogger.Write(_L("Error, Videoplayer not yet created in the agent"));
|
sl@0
|
2255 |
}
|
sl@0
|
2256 |
}
|
sl@0
|
2257 |
|
sl@0
|
2258 |
void CMVSAppUi::SetScaleFactorL(TReal32 aScaleWidth,TReal32 aScaleHeight,TBool aAntiAliasFiltering)
|
sl@0
|
2259 |
{
|
sl@0
|
2260 |
TRAPD(err, iVideoPlayAgent->SetScaleFactorL(aScaleWidth,aScaleHeight,aAntiAliasFiltering));
|
sl@0
|
2261 |
if (err == KErrNotSupported)
|
sl@0
|
2262 |
{
|
sl@0
|
2263 |
User::InfoPrint(KNotsupported);
|
sl@0
|
2264 |
}
|
sl@0
|
2265 |
else if (err == KErrNotReady)
|
sl@0
|
2266 |
{
|
sl@0
|
2267 |
iLogger.Write(_L("Error, Videoplayer not yet created in the agent"));
|
sl@0
|
2268 |
}
|
sl@0
|
2269 |
}
|
sl@0
|
2270 |
|
sl@0
|
2271 |
void CMVSAppUi::SetCropRegionL(const TRect& aCropRegion)
|
sl@0
|
2272 |
{
|
sl@0
|
2273 |
TRAPD(err, iVideoPlayAgent->SetCropRegionL(aCropRegion));
|
sl@0
|
2274 |
if (err == KErrNotSupported)
|
sl@0
|
2275 |
{
|
sl@0
|
2276 |
User::InfoPrint(KNotsupported);
|
sl@0
|
2277 |
}
|
sl@0
|
2278 |
else if (err == KErrNotReady)
|
sl@0
|
2279 |
{
|
sl@0
|
2280 |
iLogger.Write(_L("Error, Videoplayer not yet created in the agent"));
|
sl@0
|
2281 |
}
|
sl@0
|
2282 |
}
|
sl@0
|
2283 |
|
sl@0
|
2284 |
void CMVSAppUi::GetCropRegionL(TRect& aCropRegion)
|
sl@0
|
2285 |
{
|
sl@0
|
2286 |
TRAPD(err, iVideoPlayAgent->GetCropRegionL(aCropRegion));
|
sl@0
|
2287 |
if (err == KErrNotSupported)
|
sl@0
|
2288 |
{
|
sl@0
|
2289 |
User::InfoPrint(KNotsupported);
|
sl@0
|
2290 |
}
|
sl@0
|
2291 |
else if (err == KErrNotReady)
|
sl@0
|
2292 |
{
|
sl@0
|
2293 |
iLogger.Write(_L("Error, Videoplayer not yet created in the agent"));
|
sl@0
|
2294 |
}
|
sl@0
|
2295 |
}
|
sl@0
|
2296 |
|
sl@0
|
2297 |
void CMVSAppUi::SetVideoExtent(const TRect& aVideoExtent)
|
sl@0
|
2298 |
{
|
sl@0
|
2299 |
TRAPD(err, iVideoPlayAgent->SetVideoExtentL(aVideoExtent));
|
sl@0
|
2300 |
if (err != KErrNone)
|
sl@0
|
2301 |
{
|
sl@0
|
2302 |
TBuf<50> text;
|
sl@0
|
2303 |
text.AppendFormat(_L("SetVideoExtentL - %d"), err);
|
sl@0
|
2304 |
User::InfoPrint(text);
|
sl@0
|
2305 |
return;
|
sl@0
|
2306 |
}
|
sl@0
|
2307 |
iVideoExtentSet = ETrue;
|
sl@0
|
2308 |
iVideoExtent = aVideoExtent;
|
sl@0
|
2309 |
}
|
sl@0
|
2310 |
|
sl@0
|
2311 |
void CMVSAppUi::SetWindowClippingRect(const TRect& aWindowClipRect)
|
sl@0
|
2312 |
{
|
sl@0
|
2313 |
TRAPD(err, iVideoPlayAgent->SetWindowClipRectL(aWindowClipRect));
|
sl@0
|
2314 |
if (err != KErrNone)
|
sl@0
|
2315 |
{
|
sl@0
|
2316 |
TBuf<50> text;
|
sl@0
|
2317 |
text.AppendFormat(_L("SetWindowClippingRectL - %d"), err);
|
sl@0
|
2318 |
User::InfoPrint(text);
|
sl@0
|
2319 |
return;
|
sl@0
|
2320 |
}
|
sl@0
|
2321 |
|
sl@0
|
2322 |
iWindowClipRectSet = ETrue;
|
sl@0
|
2323 |
iWindowClipRect = aWindowClipRect;
|
sl@0
|
2324 |
}
|
sl@0
|
2325 |
|
sl@0
|
2326 |
void CMVSAppUi::SetOverlayTextL(const TDesC& aOverlayText)
|
sl@0
|
2327 |
{
|
sl@0
|
2328 |
iOverlayText.Close();
|
sl@0
|
2329 |
iOverlayText.CreateL(aOverlayText);
|
sl@0
|
2330 |
|
sl@0
|
2331 |
iAppView->iMainWindowControl->SetOverlayTextL(aOverlayText);
|
sl@0
|
2332 |
}
|
sl@0
|
2333 |
|
sl@0
|
2334 |
const TDesC& CMVSAppUi::OverlayText() const
|
sl@0
|
2335 |
{
|
sl@0
|
2336 |
return iOverlayText;
|
sl@0
|
2337 |
}
|
sl@0
|
2338 |
|
sl@0
|
2339 |
void CMVSAppUi::SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos)
|
sl@0
|
2340 |
{
|
sl@0
|
2341 |
iVideoPlayAgent->SetAutoScaleL(aScaleType, aHorizPos, aVertPos);
|
sl@0
|
2342 |
iAutoScaleType = aScaleType;
|
sl@0
|
2343 |
iAutoScaleHorizPos = aHorizPos;
|
sl@0
|
2344 |
iAutoScaleVertPos = aVertPos;
|
sl@0
|
2345 |
}
|
sl@0
|
2346 |
|
sl@0
|
2347 |
void CMVSAppUi::GetAutoScale(TAutoScaleType& aScaleType, TInt& aHorizPos, TInt& aVertPos)
|
sl@0
|
2348 |
{
|
sl@0
|
2349 |
aScaleType = iAutoScaleType;
|
sl@0
|
2350 |
aHorizPos = iAutoScaleHorizPos;
|
sl@0
|
2351 |
aVertPos = iAutoScaleVertPos;
|
sl@0
|
2352 |
}
|
sl@0
|
2353 |
|
sl@0
|
2354 |
void CMVSAppUi::SetOutputScreen(TInt aScreenNumber)
|
sl@0
|
2355 |
{
|
sl@0
|
2356 |
iScreenNumber = aScreenNumber;
|
sl@0
|
2357 |
}
|
sl@0
|
2358 |
|
sl@0
|
2359 |
void CMVSAppUi::RegisterForNotification(TBool aRegistered)
|
sl@0
|
2360 |
{
|
sl@0
|
2361 |
if(iRegistered)
|
sl@0
|
2362 |
{
|
sl@0
|
2363 |
iAlreadyRegistered = ETrue;
|
sl@0
|
2364 |
}
|
sl@0
|
2365 |
iRegistered = aRegistered;
|
sl@0
|
2366 |
if(iMode == EVideoPlay)
|
sl@0
|
2367 |
{
|
sl@0
|
2368 |
if(iRegistered && iAlreadyRegistered == EFalse)
|
sl@0
|
2369 |
{
|
sl@0
|
2370 |
TInt regerr = iVideoPlayAgent->RegisterForNotification();
|
sl@0
|
2371 |
if(regerr == KErrNone)
|
sl@0
|
2372 |
{
|
sl@0
|
2373 |
User::InfoPrint(KRegisterSuccess);
|
sl@0
|
2374 |
}
|
sl@0
|
2375 |
else
|
sl@0
|
2376 |
{
|
sl@0
|
2377 |
User::InfoPrint(KRegisterFailure);
|
sl@0
|
2378 |
}
|
sl@0
|
2379 |
}
|
sl@0
|
2380 |
else if(iAlreadyRegistered && iRegistered == EFalse)
|
sl@0
|
2381 |
{
|
sl@0
|
2382 |
TInt cancelerr = iVideoPlayAgent->CancelNotification();
|
sl@0
|
2383 |
if(cancelerr == KErrNone)
|
sl@0
|
2384 |
{
|
sl@0
|
2385 |
iAlreadyRegistered = EFalse;
|
sl@0
|
2386 |
User::InfoPrint(KRegisterCancelation);
|
sl@0
|
2387 |
}
|
sl@0
|
2388 |
else
|
sl@0
|
2389 |
{
|
sl@0
|
2390 |
User::InfoPrint(KCancelationFailure);
|
sl@0
|
2391 |
}
|
sl@0
|
2392 |
}
|
sl@0
|
2393 |
}
|
sl@0
|
2394 |
else if(iMode == EAudioPlay && iRegistered)
|
sl@0
|
2395 |
{
|
sl@0
|
2396 |
}
|
sl@0
|
2397 |
}
|
sl@0
|
2398 |
|
sl@0
|
2399 |
void CMVSAppUi::SetPip(TBool aPip)
|
sl@0
|
2400 |
{
|
sl@0
|
2401 |
iPip = aPip;
|
sl@0
|
2402 |
}
|
sl@0
|
2403 |
|
sl@0
|
2404 |
void CMVSAppUi::SetCrp(TBool aCrp)
|
sl@0
|
2405 |
{
|
sl@0
|
2406 |
iCrp = aCrp;
|
sl@0
|
2407 |
}
|
sl@0
|
2408 |
/*
|
sl@0
|
2409 |
UpdteDisplay(....)
|
sl@0
|
2410 |
Used to populate all the view windows,based
|
sl@0
|
2411 |
on the arguments passed this includes updating the time bar,the file name
|
sl@0
|
2412 |
and the state of the app.
|
sl@0
|
2413 |
*/
|
sl@0
|
2414 |
void CMVSAppUi::UpdateDisplayL(TMVSState aState)
|
sl@0
|
2415 |
{
|
sl@0
|
2416 |
TBuf<KTimeValueLength> disTime;
|
sl@0
|
2417 |
TFileName disFName;
|
sl@0
|
2418 |
TBuf<32> disState;
|
sl@0
|
2419 |
disTime.Append(iDisplayTime);
|
sl@0
|
2420 |
disFName.Append(iDisplayFName);
|
sl@0
|
2421 |
disState.Append(iDisplayState);
|
sl@0
|
2422 |
|
sl@0
|
2423 |
iDisplayFName.Zero();
|
sl@0
|
2424 |
iDisplayState.Zero();
|
sl@0
|
2425 |
iDisplayTime.Zero();
|
sl@0
|
2426 |
|
sl@0
|
2427 |
switch(aState)
|
sl@0
|
2428 |
{
|
sl@0
|
2429 |
case(ENotReady):
|
sl@0
|
2430 |
iCoeEnv->ReadResourceL(iDisplayFName, R_NOFILE);
|
sl@0
|
2431 |
iCoeEnv->ReadResourceL(iDisplayState, R_IDLE);
|
sl@0
|
2432 |
iCoeEnv->ReadResourceL(iDisplayTime, R_ZEROTIME);
|
sl@0
|
2433 |
break;
|
sl@0
|
2434 |
case(EAudioOpened):
|
sl@0
|
2435 |
case(EVideoOpened):
|
sl@0
|
2436 |
if(iMode == EAudioPlay || iMode == EVideoPlay)
|
sl@0
|
2437 |
{
|
sl@0
|
2438 |
iDisplayFName.Append(iSrcFName);
|
sl@0
|
2439 |
}
|
sl@0
|
2440 |
if(iMode == EAudioRecord || iMode == EVideoRecord)
|
sl@0
|
2441 |
{
|
sl@0
|
2442 |
iDisplayFName.Append(iRecFName);
|
sl@0
|
2443 |
}
|
sl@0
|
2444 |
iCoeEnv->ReadResourceL(iDisplayState, R_OPEN);
|
sl@0
|
2445 |
break;
|
sl@0
|
2446 |
|
sl@0
|
2447 |
case(EAudioStopped):
|
sl@0
|
2448 |
case(EVideoStopped):
|
sl@0
|
2449 |
if(iMode == EAudioPlay || iMode == EVideoPlay)
|
sl@0
|
2450 |
{
|
sl@0
|
2451 |
iDisplayFName.Append(iSrcFName);
|
sl@0
|
2452 |
}
|
sl@0
|
2453 |
if(iMode == EAudioRecord || iMode == EVideoRecord)
|
sl@0
|
2454 |
{
|
sl@0
|
2455 |
iDisplayFName.Append(iRecFName);
|
sl@0
|
2456 |
}
|
sl@0
|
2457 |
iCoeEnv->ReadResourceL(iDisplayState, R_READY);
|
sl@0
|
2458 |
break;
|
sl@0
|
2459 |
|
sl@0
|
2460 |
case(EAudioPlaying):
|
sl@0
|
2461 |
case(EVideoPlaying):
|
sl@0
|
2462 |
if(iMode == EAudioPlay || iMode == EVideoPlay)
|
sl@0
|
2463 |
{
|
sl@0
|
2464 |
iDisplayFName.Append(iSrcFName);
|
sl@0
|
2465 |
}
|
sl@0
|
2466 |
if(iMode == EAudioRecord || iMode == EVideoRecord)
|
sl@0
|
2467 |
{
|
sl@0
|
2468 |
iDisplayFName.Append(iRecFName);
|
sl@0
|
2469 |
}
|
sl@0
|
2470 |
iCoeEnv->ReadResourceL(iDisplayState, R_PLAYING);
|
sl@0
|
2471 |
break;
|
sl@0
|
2472 |
|
sl@0
|
2473 |
case(EAudioRecording):
|
sl@0
|
2474 |
iDisplayFName.Append(iRecFName);
|
sl@0
|
2475 |
iCoeEnv->ReadResourceL(iDisplayState, R_RECORDING);
|
sl@0
|
2476 |
ConvertTimeToDes(iAudioRecordAgent->Position(), iDisplayTime);
|
sl@0
|
2477 |
break;
|
sl@0
|
2478 |
|
sl@0
|
2479 |
case(EVideoRecording):
|
sl@0
|
2480 |
iDisplayFName.Append(iRecFName);
|
sl@0
|
2481 |
iCoeEnv->ReadResourceL(iDisplayState, R_RECORDING);
|
sl@0
|
2482 |
ConvertTimeToDes(iVideoRecordAgent->DurationL(), iDisplayTime);
|
sl@0
|
2483 |
break;
|
sl@0
|
2484 |
|
sl@0
|
2485 |
case(EAudioPaused):
|
sl@0
|
2486 |
case(EVideoPaused):
|
sl@0
|
2487 |
if(iMode == EAudioPlay || iMode == EVideoPlay)
|
sl@0
|
2488 |
{
|
sl@0
|
2489 |
iDisplayFName.Append(iSrcFName);
|
sl@0
|
2490 |
}
|
sl@0
|
2491 |
if(iMode == EAudioRecord || iMode == EVideoRecord)
|
sl@0
|
2492 |
{
|
sl@0
|
2493 |
iDisplayFName.Append(iRecFName);
|
sl@0
|
2494 |
}
|
sl@0
|
2495 |
iCoeEnv->ReadResourceL(iDisplayState, R_PAUSED);
|
sl@0
|
2496 |
break;
|
sl@0
|
2497 |
|
sl@0
|
2498 |
default:
|
sl@0
|
2499 |
iCoeEnv->ReadResourceL(iDisplayFName, R_NOFILE);
|
sl@0
|
2500 |
iCoeEnv->ReadResourceL(iDisplayState, R_IDLE);
|
sl@0
|
2501 |
iCoeEnv->ReadResourceL(iDisplayTime, R_ZEROTIME);
|
sl@0
|
2502 |
break;
|
sl@0
|
2503 |
}
|
sl@0
|
2504 |
|
sl@0
|
2505 |
if (iMode == EVideoPlay)
|
sl@0
|
2506 |
{
|
sl@0
|
2507 |
if (aState != EVideoPlaying && iVideoPlayAgent->SupportVideoPlayerUtility2() && iDisplayAdded)
|
sl@0
|
2508 |
{
|
sl@0
|
2509 |
iVideoCtl->Pip().Clear();
|
sl@0
|
2510 |
PrepareVideoControlsL();
|
sl@0
|
2511 |
}
|
sl@0
|
2512 |
}
|
sl@0
|
2513 |
|
sl@0
|
2514 |
PopulateInfoWindowDataL(aState);
|
sl@0
|
2515 |
|
sl@0
|
2516 |
if(disFName.CompareF(iDisplayFName) != 0)
|
sl@0
|
2517 |
{
|
sl@0
|
2518 |
iAppView->iStatusWindowFNameControl->SetTextL(iDisplayFName);
|
sl@0
|
2519 |
iAppView->iStatusWindowFNameControl->DrawNow();
|
sl@0
|
2520 |
}
|
sl@0
|
2521 |
if(disTime.CompareF(iDisplayTime) != 0)
|
sl@0
|
2522 |
{
|
sl@0
|
2523 |
iAppView->iStatusWindowTimeControl->SetTextL(iDisplayTime);
|
sl@0
|
2524 |
iAppView->iStatusWindowTimeControl->DrawNow();
|
sl@0
|
2525 |
}
|
sl@0
|
2526 |
if(disState.CompareF(iDisplayState) != 0)
|
sl@0
|
2527 |
{
|
sl@0
|
2528 |
iAppView->iStatusWindowStateControl->SetTextL(iDisplayState);
|
sl@0
|
2529 |
iAppView->iStatusWindowStateControl->DrawNow();
|
sl@0
|
2530 |
}
|
sl@0
|
2531 |
|
sl@0
|
2532 |
TBuf<256> dollarDes;
|
sl@0
|
2533 |
BuildDollarDesFromArrayL(dollarDes);
|
sl@0
|
2534 |
if(iDollarDes.CompareF(dollarDes) != 0)
|
sl@0
|
2535 |
{
|
sl@0
|
2536 |
iDollarDes.Zero();
|
sl@0
|
2537 |
iDollarDes.Append(dollarDes);
|
sl@0
|
2538 |
iAppView->iInfoWindowControl->SetTextL(dollarDes);
|
sl@0
|
2539 |
iAppView->iInfoWindowControl->DrawNow();
|
sl@0
|
2540 |
}
|
sl@0
|
2541 |
}
|
sl@0
|
2542 |
|
sl@0
|
2543 |
|
sl@0
|
2544 |
|
sl@0
|
2545 |
//
|
sl@0
|
2546 |
//PopulateMainWindowData(...) ***TRAPPED ERRORS***
|
sl@0
|
2547 |
//
|
sl@0
|
2548 |
// Adds data to the array used to hold playback or recording data
|
sl@0
|
2549 |
// such as the volume, cropping window and balance. This is then used to
|
sl@0
|
2550 |
// build a $$-separated descriptor which is sent to the view to be
|
sl@0
|
2551 |
// displayed as lines of text within the main window.
|
sl@0
|
2552 |
//
|
sl@0
|
2553 |
void CMVSAppUi::PopulateInfoWindowDataL(TMVSState aState)
|
sl@0
|
2554 |
{
|
sl@0
|
2555 |
TInt balance;
|
sl@0
|
2556 |
TBuf<256> infoBuf;
|
sl@0
|
2557 |
TBuf<75> welcome;
|
sl@0
|
2558 |
iCoeEnv->ReadResourceL(welcome, R_WELCOME);
|
sl@0
|
2559 |
|
sl@0
|
2560 |
TBuf<32> format;
|
sl@0
|
2561 |
iCoeEnv->ReadResourceL(format, R_FORMAT);
|
sl@0
|
2562 |
|
sl@0
|
2563 |
TBuf<10> left;
|
sl@0
|
2564 |
iCoeEnv->ReadResourceL(left, R_LEFT);
|
sl@0
|
2565 |
|
sl@0
|
2566 |
TBuf<10> right;
|
sl@0
|
2567 |
iCoeEnv->ReadResourceL(right, R_RIGHT);
|
sl@0
|
2568 |
|
sl@0
|
2569 |
TBuf<1> close;
|
sl@0
|
2570 |
iCoeEnv->ReadResourceL(close, R_CLOSE);
|
sl@0
|
2571 |
|
sl@0
|
2572 |
TBuf<56> noCrop;
|
sl@0
|
2573 |
iCoeEnv->ReadResourceL(noCrop, R_NOCROP);
|
sl@0
|
2574 |
|
sl@0
|
2575 |
TBuf<KLabelCaptionMaxLength> center;
|
sl@0
|
2576 |
iCoeEnv->ReadResourceL(center, R_CENTER);
|
sl@0
|
2577 |
|
sl@0
|
2578 |
TBuf<KLabelCaptionMaxLength> volume;
|
sl@0
|
2579 |
iCoeEnv->ReadResourceL(volume, R_VOLUME);
|
sl@0
|
2580 |
|
sl@0
|
2581 |
TBuf<KLabelCaptionMaxLength> ramp;
|
sl@0
|
2582 |
iCoeEnv->ReadResourceL(ramp, R_RAMP);
|
sl@0
|
2583 |
|
sl@0
|
2584 |
TBuf<KLabelCaptionMaxLength> balanceDes;
|
sl@0
|
2585 |
iCoeEnv->ReadResourceL(balanceDes, R_BALANCE);
|
sl@0
|
2586 |
|
sl@0
|
2587 |
TBuf<KLabelCaptionMaxLength> cropStart;
|
sl@0
|
2588 |
iCoeEnv->ReadResourceL(cropStart, R_CROPSTART);
|
sl@0
|
2589 |
|
sl@0
|
2590 |
TBuf<KLabelCaptionMaxLength> cropEnd;
|
sl@0
|
2591 |
iCoeEnv->ReadResourceL(cropEnd, R_CROPEND);
|
sl@0
|
2592 |
|
sl@0
|
2593 |
TBuf<KLabelCaptionMaxLength> noRepeats;
|
sl@0
|
2594 |
iCoeEnv->ReadResourceL(noRepeats, R_NOREPEATS);
|
sl@0
|
2595 |
|
sl@0
|
2596 |
TBuf<32> audioPriority;
|
sl@0
|
2597 |
iCoeEnv->ReadResourceL(audioPriority, R_AUDIOPRIORITY);
|
sl@0
|
2598 |
|
sl@0
|
2599 |
TBuf<KLabelCaptionMaxLength> gain;
|
sl@0
|
2600 |
iCoeEnv->ReadResourceL(gain, R_GAIN);
|
sl@0
|
2601 |
|
sl@0
|
2602 |
TBuf<KLabelCaptionMaxLength> clipLength;
|
sl@0
|
2603 |
iCoeEnv->ReadResourceL(clipLength, R_CLIPLENGTH);
|
sl@0
|
2604 |
|
sl@0
|
2605 |
TBuf<KLabelCaptionMaxLength> bitRate;
|
sl@0
|
2606 |
iCoeEnv->ReadResourceL(bitRate, R_BITRATE);
|
sl@0
|
2607 |
|
sl@0
|
2608 |
TBuf<KLabelCaptionMaxLength> sampleRate;
|
sl@0
|
2609 |
iCoeEnv->ReadResourceL(sampleRate, R_SAMPLERATE);
|
sl@0
|
2610 |
|
sl@0
|
2611 |
TBuf<KLabelCaptionMaxLength> channels;
|
sl@0
|
2612 |
iCoeEnv->ReadResourceL(channels,R_CHANNELS);
|
sl@0
|
2613 |
|
sl@0
|
2614 |
TBuf<KLabelCaptionMaxLength> AudioEnabled;
|
sl@0
|
2615 |
iCoeEnv->ReadResourceL(AudioEnabled, R_AUDIOENABLED);
|
sl@0
|
2616 |
|
sl@0
|
2617 |
TBuf<KLabelCaptionMaxLength> AudioNotEnabled;
|
sl@0
|
2618 |
iCoeEnv->ReadResourceL(AudioNotEnabled, R_AUDIONOTENABLED);
|
sl@0
|
2619 |
|
sl@0
|
2620 |
_LIT(KPercent, "%");
|
sl@0
|
2621 |
|
sl@0
|
2622 |
TBuf<KTimeValueLength> clipLengthDes;
|
sl@0
|
2623 |
|
sl@0
|
2624 |
//If the window text has anything in it, clear it out
|
sl@0
|
2625 |
if(iMainWindowText.Count() > 0)
|
sl@0
|
2626 |
{
|
sl@0
|
2627 |
iMainWindowText.Reset();
|
sl@0
|
2628 |
}
|
sl@0
|
2629 |
TTimeIntervalMicroSeconds duration;
|
sl@0
|
2630 |
TInt64 clipLengthVal =0;
|
sl@0
|
2631 |
TUint bitrateValue = 0;
|
sl@0
|
2632 |
TInt frameHeight = 0;
|
sl@0
|
2633 |
TInt frameWidth = 0;
|
sl@0
|
2634 |
TInt frameRate = 0;
|
sl@0
|
2635 |
//Populate the array based on the current state
|
sl@0
|
2636 |
switch(aState)
|
sl@0
|
2637 |
{
|
sl@0
|
2638 |
//Idle, the main window is all but empty
|
sl@0
|
2639 |
case(ENotReady):
|
sl@0
|
2640 |
iMainWindowText.AppendL(welcome);
|
sl@0
|
2641 |
if(iButtons->IsCommandDimmed(EMVSCmdPause))
|
sl@0
|
2642 |
{
|
sl@0
|
2643 |
iButtons->DimCommand(EMVSCmdPause,EFalse);
|
sl@0
|
2644 |
iButtons->DrawNow();
|
sl@0
|
2645 |
}
|
sl@0
|
2646 |
if(iButtons->IsCommandDimmed(EMVSCmdPlay))
|
sl@0
|
2647 |
{
|
sl@0
|
2648 |
iButtons->DimCommand(EMVSCmdPlay,EFalse);
|
sl@0
|
2649 |
iButtons->DrawNow();
|
sl@0
|
2650 |
}
|
sl@0
|
2651 |
if(iButtons->IsCommandDimmed(EMVSCmdStop))
|
sl@0
|
2652 |
{
|
sl@0
|
2653 |
iButtons->DimCommand(EMVSCmdStop,EFalse);
|
sl@0
|
2654 |
iButtons->DrawNow();
|
sl@0
|
2655 |
}
|
sl@0
|
2656 |
break;
|
sl@0
|
2657 |
|
sl@0
|
2658 |
//Recording: show the gain, balance and crop window.
|
sl@0
|
2659 |
case(EAudioRecording):
|
sl@0
|
2660 |
if(iButtons->IsCommandDimmed(EMVSCmdStop))
|
sl@0
|
2661 |
{
|
sl@0
|
2662 |
iButtons->DimCommand(EMVSCmdStop,EFalse);
|
sl@0
|
2663 |
iButtons->DrawNow();
|
sl@0
|
2664 |
}
|
sl@0
|
2665 |
infoBuf.Append(KAudioRecording);
|
sl@0
|
2666 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2667 |
infoBuf.Zero();
|
sl@0
|
2668 |
infoBuf.Append(gain);
|
sl@0
|
2669 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
2670 |
infoBuf.Append(KPercent);
|
sl@0
|
2671 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2672 |
infoBuf.Zero();
|
sl@0
|
2673 |
infoBuf.Append(balanceDes);
|
sl@0
|
2674 |
//Convert the balance to a number between 0 and 100
|
sl@0
|
2675 |
iAudioRecordAgent->GetRecordBalance(iBalance);
|
sl@0
|
2676 |
balance = (iBalance/2) + 50;
|
sl@0
|
2677 |
//Translate this figure into 'Left', 'Right' or 'Center'
|
sl@0
|
2678 |
if(balance < 50)
|
sl@0
|
2679 |
{
|
sl@0
|
2680 |
infoBuf.Append(left);
|
sl@0
|
2681 |
infoBuf.AppendNum(balance);
|
sl@0
|
2682 |
infoBuf.Append(close);
|
sl@0
|
2683 |
}
|
sl@0
|
2684 |
else if(balance == 50)
|
sl@0
|
2685 |
{
|
sl@0
|
2686 |
infoBuf.Append(center);
|
sl@0
|
2687 |
}
|
sl@0
|
2688 |
else
|
sl@0
|
2689 |
{
|
sl@0
|
2690 |
infoBuf.Append(right);
|
sl@0
|
2691 |
infoBuf.AppendNum(balance);
|
sl@0
|
2692 |
infoBuf.Append(close);
|
sl@0
|
2693 |
}
|
sl@0
|
2694 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2695 |
infoBuf.Zero();
|
sl@0
|
2696 |
infoBuf.Append(bitRate);
|
sl@0
|
2697 |
if(iBitRate == 0)
|
sl@0
|
2698 |
{
|
sl@0
|
2699 |
infoBuf.Append(KNotSupported);
|
sl@0
|
2700 |
}
|
sl@0
|
2701 |
else
|
sl@0
|
2702 |
{
|
sl@0
|
2703 |
infoBuf.AppendNum(iBitRate);
|
sl@0
|
2704 |
}
|
sl@0
|
2705 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2706 |
infoBuf.Zero();
|
sl@0
|
2707 |
infoBuf.Append(sampleRate);
|
sl@0
|
2708 |
infoBuf.AppendNum(iSampleRate);
|
sl@0
|
2709 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2710 |
infoBuf.Zero();
|
sl@0
|
2711 |
if(iChannels == 1)
|
sl@0
|
2712 |
{
|
sl@0
|
2713 |
infoBuf.Append(channels);
|
sl@0
|
2714 |
infoBuf.Append(KMono);
|
sl@0
|
2715 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2716 |
infoBuf.Zero();
|
sl@0
|
2717 |
}
|
sl@0
|
2718 |
else if(iChannels == 2)
|
sl@0
|
2719 |
{
|
sl@0
|
2720 |
infoBuf.Append(channels);
|
sl@0
|
2721 |
infoBuf.Append(KStereo);
|
sl@0
|
2722 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2723 |
infoBuf.Zero();
|
sl@0
|
2724 |
}
|
sl@0
|
2725 |
break;
|
sl@0
|
2726 |
|
sl@0
|
2727 |
case(EVideoRecording):
|
sl@0
|
2728 |
if(iButtons->IsCommandDimmed(EMVSCmdStop))
|
sl@0
|
2729 |
{
|
sl@0
|
2730 |
iButtons->DimCommand(EMVSCmdStop,EFalse);
|
sl@0
|
2731 |
iButtons->DrawNow();
|
sl@0
|
2732 |
}
|
sl@0
|
2733 |
infoBuf.Append(KVideoRecording);
|
sl@0
|
2734 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2735 |
infoBuf.Zero();
|
sl@0
|
2736 |
if(iVideoRecordAgent->AudioEnabledL())
|
sl@0
|
2737 |
{
|
sl@0
|
2738 |
infoBuf.Zero();
|
sl@0
|
2739 |
infoBuf.Append(AudioEnabled);
|
sl@0
|
2740 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2741 |
infoBuf.Zero();
|
sl@0
|
2742 |
infoBuf.Append(gain);
|
sl@0
|
2743 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
2744 |
infoBuf.Append(KPercent);
|
sl@0
|
2745 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2746 |
infoBuf.Zero();
|
sl@0
|
2747 |
}
|
sl@0
|
2748 |
else
|
sl@0
|
2749 |
{
|
sl@0
|
2750 |
infoBuf.Zero();
|
sl@0
|
2751 |
infoBuf.Append(AudioNotEnabled);
|
sl@0
|
2752 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2753 |
infoBuf.Zero();
|
sl@0
|
2754 |
}
|
sl@0
|
2755 |
infoBuf.Append(KFrameSize);
|
sl@0
|
2756 |
frameHeight = iFrameSize.iHeight;
|
sl@0
|
2757 |
frameWidth = iFrameSize.iWidth;
|
sl@0
|
2758 |
infoBuf.AppendNum(frameWidth);
|
sl@0
|
2759 |
infoBuf.Append(KComma);
|
sl@0
|
2760 |
infoBuf.AppendNum(frameHeight);
|
sl@0
|
2761 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2762 |
infoBuf.Zero();
|
sl@0
|
2763 |
infoBuf.Append(KFrameRate);
|
sl@0
|
2764 |
frameRate = TInt(iVideoFrameRate);
|
sl@0
|
2765 |
infoBuf.AppendNum(frameRate);
|
sl@0
|
2766 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2767 |
infoBuf.Zero();
|
sl@0
|
2768 |
break;
|
sl@0
|
2769 |
|
sl@0
|
2770 |
//The default state displays all playback information such as
|
sl@0
|
2771 |
//Volume, balance, cropping points, audio priority & the number of
|
sl@0
|
2772 |
//repeats.
|
sl@0
|
2773 |
case(EAudioOpened):
|
sl@0
|
2774 |
if(iMode == EAudioPlay)
|
sl@0
|
2775 |
{
|
sl@0
|
2776 |
infoBuf.Append(volume);
|
sl@0
|
2777 |
}
|
sl@0
|
2778 |
if(iMode == EAudioRecord)
|
sl@0
|
2779 |
{
|
sl@0
|
2780 |
infoBuf.Append(KGain);
|
sl@0
|
2781 |
}
|
sl@0
|
2782 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
2783 |
infoBuf.Append(KPercent);
|
sl@0
|
2784 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2785 |
infoBuf.Zero();
|
sl@0
|
2786 |
infoBuf.Append(balanceDes);
|
sl@0
|
2787 |
balance = (iBalance/2) + 50;
|
sl@0
|
2788 |
if(balance < 50)
|
sl@0
|
2789 |
{
|
sl@0
|
2790 |
infoBuf.Append(left);
|
sl@0
|
2791 |
infoBuf.AppendNum(balance);
|
sl@0
|
2792 |
infoBuf.Append(close);
|
sl@0
|
2793 |
}
|
sl@0
|
2794 |
else if(balance == 50)
|
sl@0
|
2795 |
{
|
sl@0
|
2796 |
infoBuf.Append(center);
|
sl@0
|
2797 |
}
|
sl@0
|
2798 |
else
|
sl@0
|
2799 |
{
|
sl@0
|
2800 |
infoBuf.Append(right);
|
sl@0
|
2801 |
infoBuf.AppendNum(balance);
|
sl@0
|
2802 |
infoBuf.Append(close);
|
sl@0
|
2803 |
}
|
sl@0
|
2804 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2805 |
infoBuf.Zero();
|
sl@0
|
2806 |
infoBuf.Append(noRepeats);
|
sl@0
|
2807 |
infoBuf.AppendNum(iNoRepeats);
|
sl@0
|
2808 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2809 |
infoBuf.Zero();
|
sl@0
|
2810 |
//Audio Priority
|
sl@0
|
2811 |
infoBuf.Append(audioPriority);
|
sl@0
|
2812 |
infoBuf.AppendNum(iPriority);
|
sl@0
|
2813 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2814 |
infoBuf.Zero();
|
sl@0
|
2815 |
infoBuf.Append(KDuration);
|
sl@0
|
2816 |
if(iMode == EAudioPlay)
|
sl@0
|
2817 |
{
|
sl@0
|
2818 |
duration = iAudioPlayAgent->Duration();
|
sl@0
|
2819 |
}
|
sl@0
|
2820 |
else if(iMode == EAudioRecord)
|
sl@0
|
2821 |
{
|
sl@0
|
2822 |
duration = iAudioRecordAgent->Duration();
|
sl@0
|
2823 |
if(duration > 0)
|
sl@0
|
2824 |
{
|
sl@0
|
2825 |
iButtons->DimCommand(EMVSCmdPlay,EFalse);
|
sl@0
|
2826 |
}
|
sl@0
|
2827 |
else
|
sl@0
|
2828 |
{
|
sl@0
|
2829 |
iButtons->DimCommand(EMVSCmdPlay,ETrue);
|
sl@0
|
2830 |
}
|
sl@0
|
2831 |
iButtons->DimCommand(EMVSCmdPause,ETrue);
|
sl@0
|
2832 |
iButtons->DimCommand(EMVSCmdStop,ETrue);
|
sl@0
|
2833 |
iButtons->DrawNow();
|
sl@0
|
2834 |
}
|
sl@0
|
2835 |
clipLengthVal = duration.Int64();
|
sl@0
|
2836 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
2837 |
infoBuf.Append(KMs);
|
sl@0
|
2838 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2839 |
infoBuf.Zero();
|
sl@0
|
2840 |
infoBuf.Append(KBitRate);
|
sl@0
|
2841 |
if(iMode == EAudioPlay)
|
sl@0
|
2842 |
{
|
sl@0
|
2843 |
iAudioPlayAgent->GetBitRate(bitrateValue);
|
sl@0
|
2844 |
infoBuf.AppendNum(bitrateValue);
|
sl@0
|
2845 |
}
|
sl@0
|
2846 |
else if(iMode == EAudioRecord)
|
sl@0
|
2847 |
{
|
sl@0
|
2848 |
if(iBitRate == 0)
|
sl@0
|
2849 |
{
|
sl@0
|
2850 |
infoBuf.Append(KNotSupported);
|
sl@0
|
2851 |
}
|
sl@0
|
2852 |
else
|
sl@0
|
2853 |
{
|
sl@0
|
2854 |
infoBuf.AppendNum(iBitRate);
|
sl@0
|
2855 |
}
|
sl@0
|
2856 |
}
|
sl@0
|
2857 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2858 |
infoBuf.Zero();
|
sl@0
|
2859 |
break;
|
sl@0
|
2860 |
|
sl@0
|
2861 |
case(EAudioStopped):
|
sl@0
|
2862 |
infoBuf.Append(KStopped);
|
sl@0
|
2863 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2864 |
infoBuf.Zero();
|
sl@0
|
2865 |
infoBuf.Append(volume);
|
sl@0
|
2866 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
2867 |
infoBuf.Append(KPercent);
|
sl@0
|
2868 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2869 |
infoBuf.Zero();
|
sl@0
|
2870 |
infoBuf.Append(balanceDes);
|
sl@0
|
2871 |
balance = (iBalance/2) + 50;
|
sl@0
|
2872 |
if(balance < 50)
|
sl@0
|
2873 |
{
|
sl@0
|
2874 |
infoBuf.Append(left);
|
sl@0
|
2875 |
infoBuf.AppendNum(balance);
|
sl@0
|
2876 |
infoBuf.Append(close);
|
sl@0
|
2877 |
}
|
sl@0
|
2878 |
else if(balance == 50)
|
sl@0
|
2879 |
{
|
sl@0
|
2880 |
infoBuf.Append(center);
|
sl@0
|
2881 |
}
|
sl@0
|
2882 |
else
|
sl@0
|
2883 |
{
|
sl@0
|
2884 |
infoBuf.Append(right);
|
sl@0
|
2885 |
infoBuf.AppendNum(balance);
|
sl@0
|
2886 |
infoBuf.Append(close);
|
sl@0
|
2887 |
}
|
sl@0
|
2888 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2889 |
infoBuf.Zero();
|
sl@0
|
2890 |
infoBuf.Append(noRepeats);
|
sl@0
|
2891 |
infoBuf.AppendNum(iNoRepeats);
|
sl@0
|
2892 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2893 |
infoBuf.Zero();
|
sl@0
|
2894 |
//Audio Priority
|
sl@0
|
2895 |
infoBuf.Append(audioPriority);
|
sl@0
|
2896 |
infoBuf.AppendNum(iPriority);
|
sl@0
|
2897 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2898 |
infoBuf.Zero();
|
sl@0
|
2899 |
infoBuf.Append(KDuration);
|
sl@0
|
2900 |
if(iMode == EAudioPlay)
|
sl@0
|
2901 |
{
|
sl@0
|
2902 |
duration = iAudioPlayAgent->Duration();
|
sl@0
|
2903 |
}
|
sl@0
|
2904 |
else if(iMode == EAudioRecord)
|
sl@0
|
2905 |
{
|
sl@0
|
2906 |
duration = iAudioRecordAgent->Duration();
|
sl@0
|
2907 |
}
|
sl@0
|
2908 |
clipLengthVal = duration.Int64();
|
sl@0
|
2909 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
2910 |
infoBuf.Append(KMs);
|
sl@0
|
2911 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2912 |
infoBuf.Zero();
|
sl@0
|
2913 |
infoBuf.Append(KBitRate);
|
sl@0
|
2914 |
if(iMode == EAudioPlay)
|
sl@0
|
2915 |
{
|
sl@0
|
2916 |
iAudioPlayAgent->GetBitRate(bitrateValue);
|
sl@0
|
2917 |
infoBuf.AppendNum(bitrateValue);
|
sl@0
|
2918 |
}
|
sl@0
|
2919 |
else if(iMode == EAudioRecord)
|
sl@0
|
2920 |
{
|
sl@0
|
2921 |
if(iBitRate == 0)
|
sl@0
|
2922 |
{
|
sl@0
|
2923 |
infoBuf.Append(KNotSupported);
|
sl@0
|
2924 |
}
|
sl@0
|
2925 |
else
|
sl@0
|
2926 |
{
|
sl@0
|
2927 |
infoBuf.AppendNum(iBitRate);
|
sl@0
|
2928 |
}
|
sl@0
|
2929 |
}
|
sl@0
|
2930 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2931 |
infoBuf.Zero();
|
sl@0
|
2932 |
break;
|
sl@0
|
2933 |
|
sl@0
|
2934 |
case(EAudioPlaying):
|
sl@0
|
2935 |
infoBuf.Append(KAudioPlaying);
|
sl@0
|
2936 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2937 |
infoBuf.Zero();
|
sl@0
|
2938 |
infoBuf.Append(volume);
|
sl@0
|
2939 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
2940 |
infoBuf.Append(KPercent);
|
sl@0
|
2941 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2942 |
infoBuf.Zero();
|
sl@0
|
2943 |
infoBuf.Append(balanceDes);
|
sl@0
|
2944 |
balance = (iBalance/2) + 50;
|
sl@0
|
2945 |
if(balance < 50)
|
sl@0
|
2946 |
{
|
sl@0
|
2947 |
infoBuf.Append(left);
|
sl@0
|
2948 |
infoBuf.AppendNum(balance);
|
sl@0
|
2949 |
infoBuf.Append(close);
|
sl@0
|
2950 |
}
|
sl@0
|
2951 |
else if(balance == 50)
|
sl@0
|
2952 |
{
|
sl@0
|
2953 |
infoBuf.Append(center);
|
sl@0
|
2954 |
}
|
sl@0
|
2955 |
else
|
sl@0
|
2956 |
{
|
sl@0
|
2957 |
infoBuf.Append(right);
|
sl@0
|
2958 |
infoBuf.AppendNum(balance);
|
sl@0
|
2959 |
infoBuf.Append(close);
|
sl@0
|
2960 |
}
|
sl@0
|
2961 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2962 |
infoBuf.Zero();
|
sl@0
|
2963 |
infoBuf.Append(noRepeats);
|
sl@0
|
2964 |
infoBuf.AppendNum(iNoRepeats);
|
sl@0
|
2965 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2966 |
infoBuf.Zero();
|
sl@0
|
2967 |
//Audio Priority
|
sl@0
|
2968 |
infoBuf.Append(audioPriority);
|
sl@0
|
2969 |
infoBuf.AppendNum(iPriority);
|
sl@0
|
2970 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2971 |
infoBuf.Zero();
|
sl@0
|
2972 |
infoBuf.Append(KDuration);
|
sl@0
|
2973 |
if(iMode == EAudioPlay)
|
sl@0
|
2974 |
{
|
sl@0
|
2975 |
duration = iAudioPlayAgent->Duration();
|
sl@0
|
2976 |
}
|
sl@0
|
2977 |
else if(iMode == EAudioRecord)
|
sl@0
|
2978 |
{
|
sl@0
|
2979 |
duration = iAudioRecordAgent->Duration();
|
sl@0
|
2980 |
}
|
sl@0
|
2981 |
clipLengthVal = duration.Int64();
|
sl@0
|
2982 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
2983 |
infoBuf.Append(KMs);
|
sl@0
|
2984 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
2985 |
infoBuf.Zero();
|
sl@0
|
2986 |
infoBuf.Append(KBitRate);
|
sl@0
|
2987 |
if(iMode == EAudioPlay)
|
sl@0
|
2988 |
{
|
sl@0
|
2989 |
iAudioPlayAgent->GetBitRate(bitrateValue);
|
sl@0
|
2990 |
infoBuf.AppendNum(bitrateValue);
|
sl@0
|
2991 |
}
|
sl@0
|
2992 |
else if(iMode == EAudioRecord)
|
sl@0
|
2993 |
{
|
sl@0
|
2994 |
if(iBitRate == 0)
|
sl@0
|
2995 |
{
|
sl@0
|
2996 |
infoBuf.Append(KNotSupported);
|
sl@0
|
2997 |
}
|
sl@0
|
2998 |
else
|
sl@0
|
2999 |
{
|
sl@0
|
3000 |
infoBuf.AppendNum(iBitRate);
|
sl@0
|
3001 |
}
|
sl@0
|
3002 |
}
|
sl@0
|
3003 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3004 |
infoBuf.Zero();
|
sl@0
|
3005 |
break;
|
sl@0
|
3006 |
|
sl@0
|
3007 |
case(EAudioPaused):
|
sl@0
|
3008 |
infoBuf.Append(KPaused);
|
sl@0
|
3009 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3010 |
infoBuf.Zero();
|
sl@0
|
3011 |
infoBuf.Append(volume);
|
sl@0
|
3012 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
3013 |
infoBuf.Append(KPercent);
|
sl@0
|
3014 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3015 |
infoBuf.Zero();
|
sl@0
|
3016 |
infoBuf.Append(balanceDes);
|
sl@0
|
3017 |
balance = (iBalance/2) + 50;
|
sl@0
|
3018 |
if(balance < 50)
|
sl@0
|
3019 |
{
|
sl@0
|
3020 |
infoBuf.Append(left);
|
sl@0
|
3021 |
infoBuf.AppendNum(balance);
|
sl@0
|
3022 |
infoBuf.Append(close);
|
sl@0
|
3023 |
}
|
sl@0
|
3024 |
else if(balance == 50)
|
sl@0
|
3025 |
{
|
sl@0
|
3026 |
infoBuf.Append(center);
|
sl@0
|
3027 |
}
|
sl@0
|
3028 |
else
|
sl@0
|
3029 |
{
|
sl@0
|
3030 |
infoBuf.Append(right);
|
sl@0
|
3031 |
infoBuf.AppendNum(balance);
|
sl@0
|
3032 |
infoBuf.Append(close);
|
sl@0
|
3033 |
}
|
sl@0
|
3034 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3035 |
infoBuf.Zero();
|
sl@0
|
3036 |
infoBuf.Append(noRepeats);
|
sl@0
|
3037 |
infoBuf.AppendNum(iNoRepeats);
|
sl@0
|
3038 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3039 |
infoBuf.Zero();
|
sl@0
|
3040 |
//Audio Priority
|
sl@0
|
3041 |
infoBuf.Append(audioPriority);
|
sl@0
|
3042 |
infoBuf.AppendNum(iPriority);
|
sl@0
|
3043 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3044 |
infoBuf.Zero();
|
sl@0
|
3045 |
infoBuf.Append(KDuration);
|
sl@0
|
3046 |
if(iMode == EAudioPlay)
|
sl@0
|
3047 |
{
|
sl@0
|
3048 |
duration = iAudioPlayAgent->Duration();
|
sl@0
|
3049 |
}
|
sl@0
|
3050 |
else if(iMode == EAudioRecord)
|
sl@0
|
3051 |
{
|
sl@0
|
3052 |
duration = iAudioRecordAgent->Duration();
|
sl@0
|
3053 |
}
|
sl@0
|
3054 |
clipLengthVal = duration.Int64();
|
sl@0
|
3055 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
3056 |
infoBuf.Append(KMs);
|
sl@0
|
3057 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3058 |
infoBuf.Zero();
|
sl@0
|
3059 |
infoBuf.Append(KBitRate);
|
sl@0
|
3060 |
if(iMode == EAudioPlay)
|
sl@0
|
3061 |
{
|
sl@0
|
3062 |
iAudioPlayAgent->GetBitRate(bitrateValue);
|
sl@0
|
3063 |
infoBuf.AppendNum(bitrateValue);
|
sl@0
|
3064 |
}
|
sl@0
|
3065 |
else if(iMode == EAudioRecord)
|
sl@0
|
3066 |
{
|
sl@0
|
3067 |
if(iBitRate == 0)
|
sl@0
|
3068 |
{
|
sl@0
|
3069 |
infoBuf.Append(KNotSupported);
|
sl@0
|
3070 |
}
|
sl@0
|
3071 |
else
|
sl@0
|
3072 |
{
|
sl@0
|
3073 |
infoBuf.AppendNum(iBitRate);
|
sl@0
|
3074 |
}
|
sl@0
|
3075 |
}
|
sl@0
|
3076 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3077 |
infoBuf.Zero();
|
sl@0
|
3078 |
break;
|
sl@0
|
3079 |
|
sl@0
|
3080 |
case(EVideoOpened):
|
sl@0
|
3081 |
if(iMode == EVideoPlay)
|
sl@0
|
3082 |
{
|
sl@0
|
3083 |
infoBuf.Append(KVideoOpened);
|
sl@0
|
3084 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3085 |
infoBuf.Zero();
|
sl@0
|
3086 |
if(iVideoPlayAgent->AudioEnabledL())
|
sl@0
|
3087 |
{
|
sl@0
|
3088 |
infoBuf.Zero();
|
sl@0
|
3089 |
infoBuf.Append(AudioEnabled);
|
sl@0
|
3090 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3091 |
infoBuf.Zero();
|
sl@0
|
3092 |
infoBuf.Append(volume);
|
sl@0
|
3093 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
3094 |
infoBuf.Append(KPercent);
|
sl@0
|
3095 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3096 |
infoBuf.Zero();
|
sl@0
|
3097 |
if(iButtons->IsCommandDimmed(EMVSCmdSetVolume))
|
sl@0
|
3098 |
{
|
sl@0
|
3099 |
iButtons->DimCommand(EMVSCmdSetVolume,EFalse);
|
sl@0
|
3100 |
iButtons->DrawNow();
|
sl@0
|
3101 |
}
|
sl@0
|
3102 |
}
|
sl@0
|
3103 |
else
|
sl@0
|
3104 |
{
|
sl@0
|
3105 |
infoBuf.Zero();
|
sl@0
|
3106 |
infoBuf.Append(AudioNotEnabled);
|
sl@0
|
3107 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3108 |
infoBuf.Zero();
|
sl@0
|
3109 |
}
|
sl@0
|
3110 |
infoBuf.Append(KDuration);
|
sl@0
|
3111 |
duration = iVideoPlayAgent->DurationL();
|
sl@0
|
3112 |
clipLengthVal = duration.Int64();
|
sl@0
|
3113 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
3114 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3115 |
infoBuf.Zero();
|
sl@0
|
3116 |
iVideoPlayAgent->VideoFrameSizeL(iFrameSize);
|
sl@0
|
3117 |
frameHeight = iFrameSize.iHeight;
|
sl@0
|
3118 |
frameWidth = iFrameSize.iWidth;
|
sl@0
|
3119 |
infoBuf.Append(KFrameSize);
|
sl@0
|
3120 |
infoBuf.AppendNum(frameWidth);
|
sl@0
|
3121 |
infoBuf.Append(KComma);
|
sl@0
|
3122 |
infoBuf.AppendNum(frameHeight);
|
sl@0
|
3123 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3124 |
infoBuf.Zero();
|
sl@0
|
3125 |
iVideoFrameRate = GetVideoFrameRateL();
|
sl@0
|
3126 |
}
|
sl@0
|
3127 |
else if(iMode == EVideoRecord)
|
sl@0
|
3128 |
{
|
sl@0
|
3129 |
iButtons->DimCommand(EMVSCmdPlay,ETrue);
|
sl@0
|
3130 |
iButtons->DimCommand(EMVSCmdPause,ETrue);
|
sl@0
|
3131 |
iButtons->DimCommand(EMVSCmdStop,ETrue);
|
sl@0
|
3132 |
iButtons->DrawNow();
|
sl@0
|
3133 |
infoBuf.Append(KVideoOpenedForRecord);
|
sl@0
|
3134 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3135 |
if(iVideoRecordAgent->AudioEnabledL())
|
sl@0
|
3136 |
{
|
sl@0
|
3137 |
iButtons->DimCommand(EMVSCmdSetVolume, EFalse);
|
sl@0
|
3138 |
iButtons->DrawNow();
|
sl@0
|
3139 |
infoBuf.Zero();
|
sl@0
|
3140 |
infoBuf.Append(AudioEnabled);
|
sl@0
|
3141 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3142 |
infoBuf.Zero();
|
sl@0
|
3143 |
infoBuf.Append(gain);
|
sl@0
|
3144 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
3145 |
infoBuf.Append(KPercent);
|
sl@0
|
3146 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3147 |
infoBuf.Zero();
|
sl@0
|
3148 |
}
|
sl@0
|
3149 |
else
|
sl@0
|
3150 |
{
|
sl@0
|
3151 |
infoBuf.Zero();
|
sl@0
|
3152 |
infoBuf.Append(AudioNotEnabled);
|
sl@0
|
3153 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3154 |
infoBuf.Zero();
|
sl@0
|
3155 |
}
|
sl@0
|
3156 |
infoBuf.Append(KFrameSize);
|
sl@0
|
3157 |
frameHeight =iFrameSize.iHeight;
|
sl@0
|
3158 |
frameWidth =iFrameSize.iWidth;
|
sl@0
|
3159 |
infoBuf.AppendNum(frameWidth);
|
sl@0
|
3160 |
infoBuf.Append(KComma);
|
sl@0
|
3161 |
infoBuf.AppendNum(frameHeight);
|
sl@0
|
3162 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3163 |
infoBuf.Zero();
|
sl@0
|
3164 |
}
|
sl@0
|
3165 |
infoBuf.Zero();
|
sl@0
|
3166 |
infoBuf.Append(KFrameRate);
|
sl@0
|
3167 |
frameRate = TInt(iVideoFrameRate);
|
sl@0
|
3168 |
infoBuf.AppendNum(frameRate);
|
sl@0
|
3169 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3170 |
infoBuf.Zero();
|
sl@0
|
3171 |
break;
|
sl@0
|
3172 |
|
sl@0
|
3173 |
case(EVideoPlaying):
|
sl@0
|
3174 |
infoBuf.Append(KVideoPlaying);
|
sl@0
|
3175 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3176 |
infoBuf.Zero();
|
sl@0
|
3177 |
if( iVideoPlayAgent->AudioEnabledL())
|
sl@0
|
3178 |
{
|
sl@0
|
3179 |
infoBuf.Zero();
|
sl@0
|
3180 |
infoBuf.Append(AudioEnabled);
|
sl@0
|
3181 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3182 |
infoBuf.Zero();
|
sl@0
|
3183 |
infoBuf.Append(volume);
|
sl@0
|
3184 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
3185 |
infoBuf.Append(KPercent);
|
sl@0
|
3186 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3187 |
infoBuf.Zero();
|
sl@0
|
3188 |
}
|
sl@0
|
3189 |
else
|
sl@0
|
3190 |
{
|
sl@0
|
3191 |
infoBuf.Zero();
|
sl@0
|
3192 |
infoBuf.Append(AudioNotEnabled);
|
sl@0
|
3193 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3194 |
infoBuf.Zero();
|
sl@0
|
3195 |
}
|
sl@0
|
3196 |
infoBuf.Append(KDuration);
|
sl@0
|
3197 |
duration = iVideoPlayAgent->DurationL();
|
sl@0
|
3198 |
clipLengthVal = duration.Int64();
|
sl@0
|
3199 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
3200 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3201 |
infoBuf.Zero();
|
sl@0
|
3202 |
iVideoPlayAgent->VideoFrameSizeL(iFrameSize);
|
sl@0
|
3203 |
frameHeight = iFrameSize.iHeight;
|
sl@0
|
3204 |
frameWidth = iFrameSize.iWidth;
|
sl@0
|
3205 |
infoBuf.Append(KFrameSize);
|
sl@0
|
3206 |
infoBuf.AppendNum(frameWidth);
|
sl@0
|
3207 |
infoBuf.Append(KComma);
|
sl@0
|
3208 |
infoBuf.AppendNum(frameHeight);
|
sl@0
|
3209 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3210 |
infoBuf.Zero();
|
sl@0
|
3211 |
infoBuf.Append(KFrameRate);
|
sl@0
|
3212 |
iVideoFrameRate = GetVideoFrameRateL();
|
sl@0
|
3213 |
frameRate = TInt(iVideoFrameRate);
|
sl@0
|
3214 |
infoBuf.AppendNum(frameRate);
|
sl@0
|
3215 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3216 |
infoBuf.Zero();
|
sl@0
|
3217 |
break;
|
sl@0
|
3218 |
|
sl@0
|
3219 |
case(EVideoPaused):
|
sl@0
|
3220 |
infoBuf.Append(KPaused);
|
sl@0
|
3221 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3222 |
if(iMode == EVideoRecord)
|
sl@0
|
3223 |
{
|
sl@0
|
3224 |
if(iVideoRecordAgent->AudioEnabledL())
|
sl@0
|
3225 |
{
|
sl@0
|
3226 |
infoBuf.Zero();
|
sl@0
|
3227 |
infoBuf.Append(AudioEnabled);
|
sl@0
|
3228 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3229 |
infoBuf.Zero();
|
sl@0
|
3230 |
}
|
sl@0
|
3231 |
else
|
sl@0
|
3232 |
{
|
sl@0
|
3233 |
infoBuf.Zero();
|
sl@0
|
3234 |
infoBuf.Append(AudioNotEnabled);
|
sl@0
|
3235 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3236 |
infoBuf.Zero();
|
sl@0
|
3237 |
}
|
sl@0
|
3238 |
infoBuf.Append(KDuration);
|
sl@0
|
3239 |
duration = iVideoRecordAgent->DurationL();
|
sl@0
|
3240 |
clipLengthVal = duration.Int64();
|
sl@0
|
3241 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
3242 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3243 |
infoBuf.Zero();
|
sl@0
|
3244 |
|
sl@0
|
3245 |
}
|
sl@0
|
3246 |
if(iMode == EVideoPlay)
|
sl@0
|
3247 |
{
|
sl@0
|
3248 |
if(iVideoPlayAgent->AudioEnabledL())
|
sl@0
|
3249 |
{
|
sl@0
|
3250 |
infoBuf.Zero();
|
sl@0
|
3251 |
infoBuf.Append(AudioEnabled);
|
sl@0
|
3252 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3253 |
infoBuf.Zero();
|
sl@0
|
3254 |
infoBuf.Append(volume);
|
sl@0
|
3255 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
3256 |
infoBuf.Append(KPercent);
|
sl@0
|
3257 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3258 |
infoBuf.Zero();
|
sl@0
|
3259 |
}
|
sl@0
|
3260 |
else
|
sl@0
|
3261 |
{
|
sl@0
|
3262 |
infoBuf.Zero();
|
sl@0
|
3263 |
infoBuf.Append(AudioNotEnabled);
|
sl@0
|
3264 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3265 |
infoBuf.Zero();
|
sl@0
|
3266 |
}
|
sl@0
|
3267 |
infoBuf.Append(KDuration);
|
sl@0
|
3268 |
duration = iVideoPlayAgent->DurationL();
|
sl@0
|
3269 |
clipLengthVal = duration.Int64();
|
sl@0
|
3270 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
3271 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3272 |
infoBuf.Zero();
|
sl@0
|
3273 |
iVideoPlayAgent->VideoFrameSizeL(iFrameSize);
|
sl@0
|
3274 |
frameHeight = iFrameSize.iHeight;
|
sl@0
|
3275 |
frameWidth = iFrameSize.iWidth;
|
sl@0
|
3276 |
infoBuf.Append(KFrameSize);
|
sl@0
|
3277 |
infoBuf.AppendNum(frameWidth);
|
sl@0
|
3278 |
infoBuf.Append(KComma);
|
sl@0
|
3279 |
infoBuf.AppendNum(frameHeight);
|
sl@0
|
3280 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3281 |
infoBuf.Zero();
|
sl@0
|
3282 |
infoBuf.Append(KFrameRate);
|
sl@0
|
3283 |
iVideoFrameRate = GetVideoFrameRateL();
|
sl@0
|
3284 |
frameRate = TInt(iVideoFrameRate);
|
sl@0
|
3285 |
infoBuf.AppendNum(frameRate);
|
sl@0
|
3286 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3287 |
infoBuf.Zero();
|
sl@0
|
3288 |
}
|
sl@0
|
3289 |
break;
|
sl@0
|
3290 |
|
sl@0
|
3291 |
case(EVideoStopped):
|
sl@0
|
3292 |
infoBuf.Append(KStopped);
|
sl@0
|
3293 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3294 |
if(iMode == EVideoPlay)
|
sl@0
|
3295 |
{
|
sl@0
|
3296 |
if(iVideoPlayAgent->AudioEnabledL())
|
sl@0
|
3297 |
{
|
sl@0
|
3298 |
infoBuf.Zero();
|
sl@0
|
3299 |
infoBuf.Append(AudioEnabled);
|
sl@0
|
3300 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3301 |
infoBuf.Zero();
|
sl@0
|
3302 |
infoBuf.Append(volume);
|
sl@0
|
3303 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
3304 |
infoBuf.Append(KPercent);
|
sl@0
|
3305 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3306 |
infoBuf.Zero();
|
sl@0
|
3307 |
}
|
sl@0
|
3308 |
else
|
sl@0
|
3309 |
{
|
sl@0
|
3310 |
infoBuf.Zero();
|
sl@0
|
3311 |
infoBuf.Append(AudioNotEnabled);
|
sl@0
|
3312 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3313 |
infoBuf.Zero();
|
sl@0
|
3314 |
}
|
sl@0
|
3315 |
infoBuf.Append(KDuration);
|
sl@0
|
3316 |
duration = iVideoPlayAgent->DurationL();
|
sl@0
|
3317 |
clipLengthVal = duration.Int64();
|
sl@0
|
3318 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
3319 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3320 |
infoBuf.Zero();
|
sl@0
|
3321 |
iVideoPlayAgent->VideoFrameSizeL(iFrameSize);
|
sl@0
|
3322 |
frameHeight = iFrameSize.iHeight;
|
sl@0
|
3323 |
frameWidth = iFrameSize.iWidth;
|
sl@0
|
3324 |
infoBuf.Append(KFrameSize);
|
sl@0
|
3325 |
infoBuf.AppendNum(frameWidth);
|
sl@0
|
3326 |
infoBuf.Append(KComma);
|
sl@0
|
3327 |
infoBuf.AppendNum(frameHeight);
|
sl@0
|
3328 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3329 |
infoBuf.Zero();
|
sl@0
|
3330 |
iVideoFrameRate = GetVideoFrameRateL();
|
sl@0
|
3331 |
}
|
sl@0
|
3332 |
else if(iMode == EVideoRecord)
|
sl@0
|
3333 |
{
|
sl@0
|
3334 |
if(iVideoRecordAgent->AudioEnabledL())
|
sl@0
|
3335 |
{
|
sl@0
|
3336 |
infoBuf.Zero();
|
sl@0
|
3337 |
infoBuf.Append(AudioEnabled);
|
sl@0
|
3338 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3339 |
infoBuf.Zero();
|
sl@0
|
3340 |
infoBuf.Append(gain);
|
sl@0
|
3341 |
infoBuf.AppendNum(iVolumeOrGain);
|
sl@0
|
3342 |
infoBuf.Append(KPercent);
|
sl@0
|
3343 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3344 |
}
|
sl@0
|
3345 |
else
|
sl@0
|
3346 |
{
|
sl@0
|
3347 |
infoBuf.Zero();
|
sl@0
|
3348 |
infoBuf.Append(AudioNotEnabled);
|
sl@0
|
3349 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3350 |
infoBuf.Zero();
|
sl@0
|
3351 |
}
|
sl@0
|
3352 |
infoBuf.Zero();
|
sl@0
|
3353 |
infoBuf.Append(KDuration);
|
sl@0
|
3354 |
duration = iVideoRecordAgent->DurationL();
|
sl@0
|
3355 |
clipLengthVal = duration.Int64();
|
sl@0
|
3356 |
infoBuf.AppendNum(clipLengthVal);
|
sl@0
|
3357 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3358 |
infoBuf.Zero();
|
sl@0
|
3359 |
infoBuf.Append(KFrameSize);
|
sl@0
|
3360 |
frameHeight =iFrameSize.iHeight;
|
sl@0
|
3361 |
frameWidth =iFrameSize.iWidth;
|
sl@0
|
3362 |
infoBuf.AppendNum(frameWidth);
|
sl@0
|
3363 |
infoBuf.Append(KComma);
|
sl@0
|
3364 |
infoBuf.AppendNum(frameHeight);
|
sl@0
|
3365 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3366 |
infoBuf.Zero();
|
sl@0
|
3367 |
}
|
sl@0
|
3368 |
infoBuf.Zero();
|
sl@0
|
3369 |
infoBuf.Append(KFrameRate);
|
sl@0
|
3370 |
frameRate = TInt(iVideoFrameRate);
|
sl@0
|
3371 |
infoBuf.AppendNum(frameRate);
|
sl@0
|
3372 |
iMainWindowText.AppendL(infoBuf);
|
sl@0
|
3373 |
infoBuf.Zero();
|
sl@0
|
3374 |
break;
|
sl@0
|
3375 |
}
|
sl@0
|
3376 |
TInt clipLen = I64INT(clipLengthVal);
|
sl@0
|
3377 |
iAppView->SetClipLength(clipLen);
|
sl@0
|
3378 |
}
|
sl@0
|
3379 |
|
sl@0
|
3380 |
void CMVSAppUi::BuildDollarDesFromArrayL(TDes& aDollarDes)
|
sl@0
|
3381 |
{
|
sl@0
|
3382 |
//take the CDesCArrayFlat and build a dollar separated descriptor
|
sl@0
|
3383 |
TInt counter;
|
sl@0
|
3384 |
TBuf<2> dollar;
|
sl@0
|
3385 |
for(counter = 0; counter < iMainWindowText.Count(); ++counter)
|
sl@0
|
3386 |
{
|
sl@0
|
3387 |
aDollarDes.Append(iMainWindowText[counter]);
|
sl@0
|
3388 |
iCoeEnv->ReadResourceL(dollar, R_DOLLARDOLLAR);
|
sl@0
|
3389 |
aDollarDes.Append(dollar);
|
sl@0
|
3390 |
}
|
sl@0
|
3391 |
return;
|
sl@0
|
3392 |
}
|
sl@0
|
3393 |
|
sl@0
|
3394 |
//
|
sl@0
|
3395 |
//ConvertTimeToDes(...)
|
sl@0
|
3396 |
//
|
sl@0
|
3397 |
// Converts the time to a descriptor for display purposes. The display is
|
sl@0
|
3398 |
// in the format HH:MM:SS:SS.
|
sl@0
|
3399 |
//
|
sl@0
|
3400 |
void CMVSAppUi::ConvertTimeToDes(TTimeIntervalMicroSeconds aPosition,
|
sl@0
|
3401 |
TDes& aDes)
|
sl@0
|
3402 |
{
|
sl@0
|
3403 |
_LIT(KColon, ":");
|
sl@0
|
3404 |
_LIT(KZeroDes, "0");
|
sl@0
|
3405 |
RArray<TInt> addZero; //array to record whether we need to append a '0'
|
sl@0
|
3406 |
//to each value in the times array.
|
sl@0
|
3407 |
RArray<TInt> times; //The array of times, stored hour, minute, second...
|
sl@0
|
3408 |
|
sl@0
|
3409 |
TInt64 milliseconds = I64INT(aPosition.Int64())/1000;
|
sl@0
|
3410 |
TInt seconds = milliseconds/1000;
|
sl@0
|
3411 |
milliseconds = milliseconds - (seconds * 1000);
|
sl@0
|
3412 |
|
sl@0
|
3413 |
TInt hundreds = milliseconds/10; //hundreds of seconds
|
sl@0
|
3414 |
|
sl@0
|
3415 |
TInt minutes = seconds/60;
|
sl@0
|
3416 |
seconds = seconds - minutes*60; //seconds
|
sl@0
|
3417 |
|
sl@0
|
3418 |
TInt hours = minutes/60; //hours
|
sl@0
|
3419 |
minutes = minutes - hours*60; //minutes
|
sl@0
|
3420 |
|
sl@0
|
3421 |
times.Append(hours);
|
sl@0
|
3422 |
times.Append(minutes);
|
sl@0
|
3423 |
times.Append(seconds);
|
sl@0
|
3424 |
times.Append(hundreds); //fill the array
|
sl@0
|
3425 |
|
sl@0
|
3426 |
TBuf<256> timeDes; //descriptor holding each element of the times array
|
sl@0
|
3427 |
//in turn.
|
sl@0
|
3428 |
|
sl@0
|
3429 |
TInt counter = 0; //counter
|
sl@0
|
3430 |
for(counter = 0; counter < 4; ++counter)
|
sl@0
|
3431 |
{
|
sl@0
|
3432 |
timeDes.Zero();
|
sl@0
|
3433 |
timeDes.AppendNum(times[counter]);
|
sl@0
|
3434 |
|
sl@0
|
3435 |
if(timeDes.Length() == 1)
|
sl@0
|
3436 |
{
|
sl@0
|
3437 |
//If the time value is a single digit, we need to add a '0'
|
sl@0
|
3438 |
addZero.Append(1);
|
sl@0
|
3439 |
}
|
sl@0
|
3440 |
else
|
sl@0
|
3441 |
{
|
sl@0
|
3442 |
//Otherwise, we do not.
|
sl@0
|
3443 |
addZero.Append(0);
|
sl@0
|
3444 |
}
|
sl@0
|
3445 |
}
|
sl@0
|
3446 |
|
sl@0
|
3447 |
//Add zeros where required.
|
sl@0
|
3448 |
if(addZero[0])
|
sl@0
|
3449 |
aDes.Append(KZeroDes);
|
sl@0
|
3450 |
aDes.AppendNum(hours);
|
sl@0
|
3451 |
aDes.Append(KColon);
|
sl@0
|
3452 |
if(addZero[1])
|
sl@0
|
3453 |
aDes.Append(KZeroDes);
|
sl@0
|
3454 |
aDes.AppendNum(minutes);
|
sl@0
|
3455 |
aDes.Append(KColon);
|
sl@0
|
3456 |
if(addZero[2])
|
sl@0
|
3457 |
aDes.Append(KZeroDes);
|
sl@0
|
3458 |
aDes.AppendNum(seconds);
|
sl@0
|
3459 |
aDes.Append(KColon);
|
sl@0
|
3460 |
if(addZero[3])
|
sl@0
|
3461 |
aDes.Append(KZeroDes);
|
sl@0
|
3462 |
aDes.AppendNum(hundreds);
|
sl@0
|
3463 |
|
sl@0
|
3464 |
//Close the RArrays and return
|
sl@0
|
3465 |
addZero.Close();
|
sl@0
|
3466 |
times.Close();
|
sl@0
|
3467 |
return;
|
sl@0
|
3468 |
}
|
sl@0
|
3469 |
|
sl@0
|
3470 |
//
|
sl@0
|
3471 |
//UpdatePositionViewL()
|
sl@0
|
3472 |
//
|
sl@0
|
3473 |
// Updates the view if the state is recording or playing. Otherwise, this is
|
sl@0
|
3474 |
// unnecessary.
|
sl@0
|
3475 |
//
|
sl@0
|
3476 |
void CMVSAppUi::UpdatePositionViewL()
|
sl@0
|
3477 |
{
|
sl@0
|
3478 |
TBuf<64> dispStr1;
|
sl@0
|
3479 |
TBuf<256> temp;
|
sl@0
|
3480 |
TInt64 currentposition = 0;
|
sl@0
|
3481 |
if(iState == EAudioRecording || iState == EAudioPlaying || iState == EVideoRecording
|
sl@0
|
3482 |
|| iState == EVideoPlaying || iState == EAudioPaused || iState == EVideoPaused
|
sl@0
|
3483 |
|| iState == EVideoStopped || iState == EAudioStopped)
|
sl@0
|
3484 |
{
|
sl@0
|
3485 |
iDisplayTime.Zero();
|
sl@0
|
3486 |
if(iMode==EAudioRecord)
|
sl@0
|
3487 |
{
|
sl@0
|
3488 |
TBuf<64> dispStr2;
|
sl@0
|
3489 |
TBuf<32> recTimeLeft;
|
sl@0
|
3490 |
TTimeIntervalMicroSeconds timeLeft = iAudioRecordAgent->RecordTimeAvailable();
|
sl@0
|
3491 |
if(iRecordLimitSet && iState == EAudioRecording)
|
sl@0
|
3492 |
{
|
sl@0
|
3493 |
ConvertTimeToDes(timeLeft, recTimeLeft);
|
sl@0
|
3494 |
dispStr2.Copy(_L("Time Left:"));
|
sl@0
|
3495 |
dispStr2.Append(recTimeLeft);
|
sl@0
|
3496 |
iAppView->iStatusWindowTimeControl->SetText2L(dispStr2);
|
sl@0
|
3497 |
dispStr1.Copy(_L("Rec. Time:"));
|
sl@0
|
3498 |
}
|
sl@0
|
3499 |
}
|
sl@0
|
3500 |
if(iMode==EAudioRecord && iState==EAudioRecording)
|
sl@0
|
3501 |
{
|
sl@0
|
3502 |
iClipLength = iAudioRecordAgent->Duration();
|
sl@0
|
3503 |
iTimeElapsed = iAudioRecordAgent->Position();
|
sl@0
|
3504 |
TInt64 duration = iClipLength.Int64();
|
sl@0
|
3505 |
TInt64 position = iTimeElapsed.Int64();
|
sl@0
|
3506 |
currentposition = duration + position;
|
sl@0
|
3507 |
iTimeElapsed = TTimeIntervalMicroSeconds(currentposition);
|
sl@0
|
3508 |
}
|
sl@0
|
3509 |
else if(iMode==EAudioRecord && iState==EAudioPlaying)
|
sl@0
|
3510 |
{
|
sl@0
|
3511 |
iTimeElapsed=iAudioRecordAgent->Position();
|
sl@0
|
3512 |
iAppView->UpdatePlayProgress(iTimeElapsed);
|
sl@0
|
3513 |
}
|
sl@0
|
3514 |
else if(iMode==EAudioPlay)
|
sl@0
|
3515 |
{
|
sl@0
|
3516 |
iAudioPlayAgent->GetPosition(iTimeElapsed);
|
sl@0
|
3517 |
iAppView->UpdatePlayProgress(iTimeElapsed);
|
sl@0
|
3518 |
}
|
sl@0
|
3519 |
else if(iMode==EVideoPlay)
|
sl@0
|
3520 |
{
|
sl@0
|
3521 |
iTimeElapsed = iVideoPlayAgent->PositionL();
|
sl@0
|
3522 |
}
|
sl@0
|
3523 |
else if(iMode==EVideoRecord)
|
sl@0
|
3524 |
{
|
sl@0
|
3525 |
iTimeElapsed = iVideoRecordAgent->DurationL();
|
sl@0
|
3526 |
}
|
sl@0
|
3527 |
temp.AppendNum(currentposition);
|
sl@0
|
3528 |
|
sl@0
|
3529 |
ConvertTimeToDes(iTimeElapsed, iDisplayTime);
|
sl@0
|
3530 |
dispStr1.Append(iDisplayTime);
|
sl@0
|
3531 |
iAppView->iStatusWindowTimeControl->SetTextL(dispStr1);
|
sl@0
|
3532 |
iAppView->iStatusWindowTimeControl->DrawNow();
|
sl@0
|
3533 |
}
|
sl@0
|
3534 |
}
|
sl@0
|
3535 |
|
sl@0
|
3536 |
|
sl@0
|
3537 |
void CMVSAppUi::SetMaxFileSize(TInt& aVal)
|
sl@0
|
3538 |
{
|
sl@0
|
3539 |
if(aVal>0)
|
sl@0
|
3540 |
{
|
sl@0
|
3541 |
iRecordLimitSet = ETrue;
|
sl@0
|
3542 |
iAudioRecordAgent->SetMaxWriteLength(aVal);
|
sl@0
|
3543 |
}
|
sl@0
|
3544 |
else
|
sl@0
|
3545 |
{
|
sl@0
|
3546 |
iRecordLimitSet = EFalse;
|
sl@0
|
3547 |
iAudioRecordAgent->SetMaxWriteLength(aVal);
|
sl@0
|
3548 |
TRAP_IGNORE(iAppView->iStatusWindowTimeControl->ResetText2L());
|
sl@0
|
3549 |
}
|
sl@0
|
3550 |
}
|
sl@0
|
3551 |
|
sl@0
|
3552 |
//Handling the errors and logging it to the
|
sl@0
|
3553 |
//log file
|
sl@0
|
3554 |
void CMVSAppUi::LogErrors(TInt aError)
|
sl@0
|
3555 |
{
|
sl@0
|
3556 |
TBuf<KErrorTextLength> erorrDes;
|
sl@0
|
3557 |
CEikonEnv::Static()->GetErrorText(erorrDes,aError);
|
sl@0
|
3558 |
CEikonEnv::Static()->AlertWin(erorrDes);
|
sl@0
|
3559 |
iLogger.Write(erorrDes);
|
sl@0
|
3560 |
}
|
sl@0
|
3561 |
|
sl@0
|
3562 |
|
sl@0
|
3563 |
void CMVSAppUi::DetermineFinalFNameL()
|
sl@0
|
3564 |
{
|
sl@0
|
3565 |
//check whether the extension and the controller
|
sl@0
|
3566 |
//has been selected or not.If not selected proceed
|
sl@0
|
3567 |
//to the next dialog, nothing to be appended here to
|
sl@0
|
3568 |
//the filename.Else append the selected extension to
|
sl@0
|
3569 |
//the filename.
|
sl@0
|
3570 |
if(iSelectedPluginIdx == KControllerNotSelected)
|
sl@0
|
3571 |
{
|
sl@0
|
3572 |
iProceed = ETrue;
|
sl@0
|
3573 |
}
|
sl@0
|
3574 |
TFileName givenExt;
|
sl@0
|
3575 |
TParsePtr parser(iDestFilename);
|
sl@0
|
3576 |
TPtrC extensionval = parser.Ext();
|
sl@0
|
3577 |
if(extensionval.Length() == 0)
|
sl@0
|
3578 |
{
|
sl@0
|
3579 |
iDestFilename.Append(iControllerExt);
|
sl@0
|
3580 |
iProceed = ETrue;
|
sl@0
|
3581 |
return;
|
sl@0
|
3582 |
}
|
sl@0
|
3583 |
else
|
sl@0
|
3584 |
{
|
sl@0
|
3585 |
//If the extension is too long, report an error.
|
sl@0
|
3586 |
if(extensionval.Length() > 4)
|
sl@0
|
3587 |
{
|
sl@0
|
3588 |
_LIT(KExtTooLong, "Extension TOO long");
|
sl@0
|
3589 |
User::InfoPrint(KExtTooLong);
|
sl@0
|
3590 |
iProceed = EFalse;
|
sl@0
|
3591 |
}
|
sl@0
|
3592 |
|
sl@0
|
3593 |
//Otherwise record the extension given in the filename
|
sl@0
|
3594 |
if(extensionval.CompareF(iControllerExt)==0)
|
sl@0
|
3595 |
{
|
sl@0
|
3596 |
iProceed = ETrue;
|
sl@0
|
3597 |
return;
|
sl@0
|
3598 |
}
|
sl@0
|
3599 |
|
sl@0
|
3600 |
//Otherwise, append the right extension to the filename and return.
|
sl@0
|
3601 |
else
|
sl@0
|
3602 |
{
|
sl@0
|
3603 |
_LIT(KWrongExt, "Wrong Extension");
|
sl@0
|
3604 |
_LIT(KWrongExtBody, "Extension mismatch,Please re-enter");
|
sl@0
|
3605 |
CEikonEnv::Static()->InfoWinL(KWrongExt, KWrongExtBody);
|
sl@0
|
3606 |
SaveAsDialogL();
|
sl@0
|
3607 |
iProceed = EFalse;
|
sl@0
|
3608 |
}
|
sl@0
|
3609 |
}
|
sl@0
|
3610 |
}
|
sl@0
|
3611 |
|
sl@0
|
3612 |
TPoint CMVSAppUi::DrawBorders(const TSize& aSize) const
|
sl@0
|
3613 |
{
|
sl@0
|
3614 |
CWindowGc& gc = iAppView->iMainWindowControl->SystemGc();
|
sl@0
|
3615 |
gc.Activate(iAppView->iMainWindowControl->ControlWindow());
|
sl@0
|
3616 |
TRect rect(iAppView->iMainWindowControl->Size());
|
sl@0
|
3617 |
TPoint pos( rect.iTl.iX + rect.Width()/2 - aSize.iWidth/2,
|
sl@0
|
3618 |
rect.iTl.iY + rect.Height()/2 - aSize.iHeight/2);
|
sl@0
|
3619 |
TRect drawRect(pos,aSize);
|
sl@0
|
3620 |
gc.SetPenColor(KRgbBlack);
|
sl@0
|
3621 |
drawRect.Grow(1,1);
|
sl@0
|
3622 |
gc.DrawRect(drawRect);
|
sl@0
|
3623 |
gc.Deactivate();
|
sl@0
|
3624 |
iAppView->iMainWindowControl->ControlEnv()->WsSession().Flush();
|
sl@0
|
3625 |
return pos;
|
sl@0
|
3626 |
}
|
sl@0
|
3627 |
|
sl@0
|
3628 |
void CMVSAppUi::StopViewFinder()
|
sl@0
|
3629 |
{
|
sl@0
|
3630 |
if(!iVideoRecordAgent)
|
sl@0
|
3631 |
{
|
sl@0
|
3632 |
return;
|
sl@0
|
3633 |
}
|
sl@0
|
3634 |
CCamera *camera = iVideoRecordAgent->Camera();
|
sl@0
|
3635 |
if (camera->ViewFinderActive())
|
sl@0
|
3636 |
{
|
sl@0
|
3637 |
camera->StopViewFinder();
|
sl@0
|
3638 |
iAppView->iMainWindowControl->DrawNow();
|
sl@0
|
3639 |
}
|
sl@0
|
3640 |
}
|