1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/inc/MVSAppUI.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,292 @@
1.4 +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Part of the MVS Application for TechView
1.18 +//
1.19 +
1.20 +
1.21 +#ifndef MVSAPPUI_H
1.22 +#define MVSAPPUI_H
1.23 +
1.24 +
1.25 +#include <mda/common/controller.h>
1.26 +#include <flogger.h>
1.27 +#include <techview/eikdialg.h>
1.28 +
1.29 +#include "MVSApp.h"
1.30 +#include "MVSAppView.h"
1.31 +#include "audioplayagent.h"
1.32 +#include "audiorecordagent.h"
1.33 +#include "videoplayagent.h"
1.34 +#include "videorecordagent.h"
1.35 +#include "SettingsManager.h"
1.36 +
1.37 +const TInt KMaxExtensionSize = 16;
1.38 +const TInt KMaxDisplayLabelSize = 32;
1.39 +const TInt KMaxDollarPaddingBufferSize = 256;
1.40 +const TInt KErrorTextLength = 80;
1.41 +
1.42 +//forward declariotions.
1.43 +//The volume dialog class, used to increase/decrease volume.
1.44 +class CMVSVolumeDialog;
1.45 +//The balance dialog class, used to set the balance to right/left/centre.
1.46 +class CMVSBalanceDialog;
1.47 +//The repeats dialog class, used to set the number of times a clip has to be played back, along with the delay between the playback.
1.48 +class CMVSRepeatDialog;
1.49 +//The Controller selction dialog class, used to select the format and the controller,before recording.
1.50 +class CMVSSelectPluginsDialog;
1.51 +//The SaveAs dialog class, used to input the file name in which the recorded data would be stored.
1.52 +class CMVSSaveAsDialog;
1.53 +//The MetaInfo Editing dialog class, used to edit the Metadata info for a clip.
1.54 +class CMVSEditMetaInfoDialog;
1.55 +//The audio controller settings dialog class, used to set controller specific features like bitrates,samplerates,channels etc.
1.56 +class CMVSConfigAudioFormatDialog;
1.57 +//The system info dialog class,used to display a list of all the supported controllers and codecs by the system.
1.58 +class CMVSSystemInfoDialog;
1.59 +//The video Setting dialog class, used to set the video playing/recording properties such as Rotation and Cropping.
1.60 +class CMVSVideoSettingDialog;
1.61 +//The audio Setting dialog class, used to set the audio playing properties such as priority preferences,repeats etc.
1.62 +class CMVSAudioSettingDialog;
1.63 +//The Play Window dialog class, used to set the play window for a audio clip, specifying the start and end position.
1.64 +class CMVSSetPlayWindowDialog;
1.65 +//The crop window setting class, used to set the cropping position for a recorded clip.
1.66 +class CMVSCropDialog;
1.67 +//The video controller settings dialog class, used to set controller specific features like framerates,framsize,codecs etc.
1.68 +class CMVSConfigVideoFormatDialog;
1.69 +//The timer class, used to refresh the timer in the app periodically,while playing/recording a clip.
1.70 +class CMVSViewTicker;
1.71 +//The MetaInfo viewing dialog class, used to view the Metadata info of a clip.
1.72 +class CMVSViewMetaInfoDialog;
1.73 +//The class provides the interface to set the video output screen.
1.74 +class CMVSMultipleScreenDialog;
1.75 +//This class used to register the application for AP&R
1.76 +class CMVSResourceNotifyDialog;
1.77 +
1.78 +class CMVSVideoControl;
1.79 +
1.80 +//The main class that links to all the dialog windows in the application. This class implements the HandleCommandL()
1.81 +//function that handles any input generated by the user on the UI,and calls the respective dialouge.It acts as an interface
1.82 +//between all the dialouges and the user.Also this class is responsible for processing the commands and linking with
1.83 +//the agents to the UI.
1.84 +class CMVSAppUi : public CEikAppUi, MMVSClientObserver
1.85 + {
1.86 +public:
1.87 + void ConstructL();
1.88 + ~CMVSAppUi();
1.89 + CMVSAppUi();
1.90 + void SetRepeats(TInt aNoRepeats, TTimeIntervalMicroSeconds aDelay);
1.91 + void SetBalanceL(TInt aBalance);
1.92 + void SetVolumeL(TInt aVolume, TTimeIntervalMicroSeconds aRamp);
1.93 + //for audio aMediaType = 0; for video aMediaType = 1;
1.94 + TInt GetExtensionListL(CDesCArrayFlat* aExtArray,TBool aMediaType);
1.95 + //for audio aMediaType = 0; for video aMediaType = 1;
1.96 + TInt GetPluginListL(TInt8 aExtIdx,CDesCArrayFlat* aExtArray,CDesCArrayFlat* aPluginArray,TBool aMediaType);
1.97 + void SetMetaDataL(RPointerArray<CMMFMetaDataEntry> aMetaArray);
1.98 + void GetMetaDataL(RPointerArray<CMMFMetaDataEntry>& aMetaArray);
1.99 + void SelectedPluginIdx(TInt aIdx);
1.100 + void SelectedExtension(TDesC16& aDes);
1.101 + void GetSupportedBitRatesL(RArray <TUint>& aBitRateArray);
1.102 + void GetSupportedSampleRatesArrayL(RArray<TUint>& aSampleRatesArray);
1.103 + void GetSupportedNoChannelsArrayL(RArray<TUint>& aNoChannelsArray);
1.104 + void GetSupportedCodecsArrayL(RArray<TFourCC>& aCodecsArray);
1.105 + void SelectedMedia(TBool aMediaType);
1.106 + void SetSampleRateL(TUint aSampleRate);
1.107 + void SetChannelsL(TUint aNumberOfChannels);
1.108 + void SetBitRateL(TUint aBitRate);
1.109 + void SetCodecsL(TFourCC aDataType);
1.110 + void GetSupportedFrameRatesL(RArray <TReal32>& aFrameRateArray);
1.111 + void GetSupportedFrameSizeArrayL(RArray <TSize>& aFrameRateArray);
1.112 + TInt GetSystemInfoL(CDesCArrayFlat* aPluginArray);
1.113 + void SetVideoFrameRateL(TReal32 aFrameRate);
1.114 + void SetVideoFrameSizeL(TSize aFrameSize);
1.115 + void SetAudioEnabledL(TBool aAudioEnabled);
1.116 + void SetRotationL(TVideoRotation aRotation);
1.117 +
1.118 + void SetScaleFactorL(TReal32 aScaleWidth,TReal32 aScaleHeight,TBool aAntiAliasFiltering);
1.119 + void GetScaleFactorL(TReal32& aScaleWidth, TReal32& aScaleHeight, TBool& aAntiAliasFiltering);
1.120 +
1.121 + void SetCropRegionL(const TRect& aCropRegion);
1.122 + void GetCropRegionL(TRect& aCropRegion);
1.123 +
1.124 + void SetVideoExtent(const TRect& aVideoExtent);
1.125 + void SetWindowClippingRect(const TRect& aWindowClipRect);
1.126 + void SetOverlayTextL(const TDesC& aOverlayText);
1.127 + const TDesC& OverlayText() const;
1.128 +
1.129 + void SetAutoScaleL(TAutoScaleType aAutoScaleType, TInt aHorizPos, TInt aVertPos);
1.130 + void GetAutoScale(TAutoScaleType& aScaleType, TInt& aHorizPos, TInt& aVertPos);
1.131 +
1.132 + void GetSupportedVideoTypesL(CDesC8ArrayFlat& aMimeArray);
1.133 + void SetVideoTypeL(const TDesC8 &aType);
1.134 + void SetPriorityL(TInt aPriority, TMdaPriorityPreference aPriorityPreference);
1.135 + void SetCropL(TTimeIntervalMicroSeconds aCropStart,TBool aCropFromBeginning);
1.136 + TBool SetPlayWindow(TTimeIntervalMicroSeconds aStart,TTimeIntervalMicroSeconds aEnd);
1.137 + void WriteAudioDataL(CMVSConfigAudioFormatDialog* apAudioFormat,
1.138 + const TUid& aUid);
1.139 + void WriteVideoDataL(CMVSConfigVideoFormatDialog* apVideoFormatDlg,
1.140 + const TUid& aUid);
1.141 + void UpdatePositionViewL();
1.142 + void InternalizeL(RReadStream& aStream);
1.143 + void ExternalizeL(RWriteStream& aStream);
1.144 + void SetPosition(TTimeIntervalMicroSeconds& aPos);
1.145 + void SetMaxFileSize(TInt& aVal);
1.146 + void SetOutputScreen(TInt aScreenNumber);
1.147 + void RegisterForNotification(TBool aRegisterd);
1.148 + void SetPip(TBool aPip);
1.149 + void SetCrp(TBool aCrp);
1.150 +private:
1.151 + inline void FileOpenL();
1.152 + inline void FileOpenForRecordL();
1.153 + void FileClose();
1.154 + TTimeIntervalMicroSeconds GetCropStart() const;
1.155 + TTimeIntervalMicroSeconds GetCropEnd() const;
1.156 + void InitializeMetaArrayL();
1.157 + TReal32 GetVideoFrameRateL();
1.158 + void SaveAsDialogL();
1.159 + void DetermineFinalFNameL();
1.160 + TVideoRotation GetRotationL();
1.161 + void LogErrors(TInt aError);
1.162 + void Reset();
1.163 + void HandleCommandL(TInt aCommand); //Handles command invocations
1.164 + void BuildDollarDesFromArrayL(TDes& aDollarDes);
1.165 + void PopulateInfoWindowDataL(TMVSState aState);
1.166 + //from MMVSClientObserver
1.167 + void UpdateStateChange(TMVSState aState, TInt aError);
1.168 + void MvsResourceNotification(const TDesC8& aNotificationData);
1.169 + //Dynamically alter the availability of controls in the menu by
1.170 + // 'dimming' and 'undimming' them.
1.171 + void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); //Menu set-up
1.172 + void UpdateDisplayL(TMVSState aState);
1.173 + void ConvertTimeToDes(TTimeIntervalMicroSeconds aPosition,
1.174 + TDes& aDes);
1.175 + TPoint DrawBorders(const TSize& aSize) const;
1.176 + void StopViewFinder();
1.177 +
1.178 + void PrepareVideoControlsL();
1.179 +
1.180 +private:
1.181 + //The view
1.182 + CMVSAppView* iAppView; //The application view
1.183 + CMVSVolumeDialog* iVolumeDialog;
1.184 + CMVSBalanceDialog* iBalanceDialog;
1.185 + CMVSRepeatDialog* iRepeatDialog;
1.186 + CMVSSelectPluginsDialog* iSelectPluginsDialog;
1.187 + CDesCArrayFlat* iPluginArray; //Array of supported plugins
1.188 + CDesCArrayFlat* iExtArray; //Array of supported Extensions
1.189 + CDesCArrayFlat* iCodecArray;//Array of supported Codecs
1.190 + CMVSSaveAsDialog* iSaveAsDialog;
1.191 + // CMVSSetPriorityDialog* iSetAudioPriorityDialog;
1.192 + CMVSEditMetaInfoDialog* iEditMetaInfoDialog;
1.193 + CMVSViewMetaInfoDialog* iViewMetaInfoDialog;
1.194 + CMVSConfigAudioFormatDialog* iConfigFormatDialog;
1.195 + CMVSConfigVideoFormatDialog* iVideoFormatDialog;
1.196 + CMVSSystemInfoDialog* iSystemInfo;
1.197 + CMVSVideoSettingDialog* iVideoSetting;
1.198 + CMVSAudioSettingDialog* iAudioSetting;
1.199 + CMVSSetPlayWindowDialog* iSetPlayWindow;
1.200 + TFileName iSrcFName;
1.201 + TFileName iRecFName;
1.202 + RPointerArray<CMMFMetaDataEntry> iMetaArray;
1.203 + CMMFMetaDataEntry* iMetaTitle;
1.204 + CMMFMetaDataEntry* iMetaAuthor;
1.205 + CMMFMetaDataEntry* iMetaCopyright;
1.206 + CMMFMetaDataEntry* iMetaRevision;
1.207 + CMMFMetaDataEntry* iMetaCategory;
1.208 + CMMFMetaDataEntry* iMetaComments;
1.209 + //MVSClient
1.210 + CDesCArrayFlat* iPluginNames;
1.211 + CMVSAudioPlayAgent* iAudioPlayAgent;
1.212 + CMVSAudioRecordAgent* iAudioRecordAgent;
1.213 + CMVSVideoPlayAgent* iVideoPlayAgent;
1.214 + CMVSVideoRecordAgent* iVideoRecordAgent;
1.215 + CMVSControllerPluginInfo* iPluginInfo;
1.216 + CMVSCropDialog* iCropDialog;
1.217 + CMVSViewTicker* iViewTicker;
1.218 + CMVSMultipleScreenDialog* iSetScreen;
1.219 + CMVSResourceNotifyDialog* iRegisterForNotification;
1.220 + CSettingsManager* iSettingManager;
1.221 + RArray<TUid> iUidArray;
1.222 + RArray<TUid> iAudioUidArray;
1.223 + RArray<TUid> iAudioPlayUidArray;
1.224 + RArray<TUid> iVideoUidArray;
1.225 + TInt iSelectedPluginIdx;
1.226 + TInt iPluginsCnt;
1.227 + TBool iMediaType;
1.228 + TUid iControllerUid;
1.229 + TBuf<KMaxExtensionSize> iControllerExt;
1.230 + TInt iRec;
1.231 + TInt iVolumeOrGain;
1.232 + TTimeIntervalMicroSeconds iRamp;
1.233 + TInt iMaxVolume;
1.234 + TInt iBalance;
1.235 + TMVSMode iMode;
1.236 + TInt iPriority;
1.237 + TMdaPriorityPreference iPriorityPreference;
1.238 + TInt iNoRepeats;
1.239 + TTimeIntervalMicroSeconds iStart;
1.240 + TTimeIntervalMicroSeconds iEnd;
1.241 + TTimeIntervalMicroSeconds iCropStart;
1.242 + TTimeIntervalMicroSeconds iCropEnd;
1.243 + TTimeIntervalMicroSeconds iCropPosition;
1.244 + TTimeIntervalMicroSeconds iClipLength;
1.245 + TBool iCropFromBeginning;
1.246 + TFileName iDestFilename;
1.247 + TTimeIntervalMicroSeconds iRepeatDelay;
1.248 + TBuf<KMaxDisplayLabelSize> iDisplayState;
1.249 + TFileName iDisplayFName;
1.250 + TBuf<KMaxDisplayLabelSize> iDisplayTime;
1.251 + CDesCArrayFlat iMainWindowText;
1.252 + TBuf<KMaxDollarPaddingBufferSize> iDollarDes;
1.253 + TTimeIntervalMicroSeconds iTimeElapsed;
1.254 + TReal32 iVideoFrameRate;
1.255 + TVideoRotation iVideoRotation;
1.256 + TUint iBitRate;
1.257 + TUint iSampleRate;
1.258 + TUint iChannels;
1.259 + TVideoRotation iRotation;
1.260 + TSize iFrameSize;
1.261 + TBool iFileReplace;
1.262 + TTimeIntervalMicroSeconds iDuration;
1.263 + TBool iAutoplay;
1.264 + TBool iOpeningForRecord;
1.265 + TMVSState iState;
1.266 + RFileLogger iLogger;
1.267 + RFs iLogs;
1.268 + CEikButtonGroupContainer* iButtons;
1.269 + TBool iProceed;
1.270 + TBool iRecordLimitSet;
1.271 + TInt iMaxFileBuffer;
1.272 + TInt iScreenNumber;
1.273 + TBool iRegistered;
1.274 + TBool iAlreadyRegistered;
1.275 + TBool iAudioEnabled;
1.276 + TRect iVideoExtent;
1.277 + TRect iWindowClipRect;
1.278 + RBuf iOverlayText;
1.279 + TAutoScaleType iAutoScaleType;
1.280 + TInt iAutoScaleHorizPos;
1.281 + TInt iAutoScaleVertPos;
1.282 +
1.283 + TBool iPip;
1.284 + TBool iCrp;
1.285 + TBool iVideoExtentSet;
1.286 + TBool iWindowClipRectSet;
1.287 +
1.288 + CMVSVideoControl* iVideoCtl;
1.289 + // Controls displaying video, window owning
1.290 + RPointerArray<CMVSVideoControl> iVideoCtls;
1.291 +
1.292 + TBool iDisplayAdded;
1.293 + };
1.294 +
1.295 +#endif MVSAPPUI_H