os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteagents/inc/agentsutility.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Part of the MVS Agents for TechView
    15 //
    16 
    17 #ifndef AGENTSUTILITY_H
    18 #define AGENTSUTILITY_H
    19 
    20 #include <badesca.h>
    21 #include <mmf/common/mmfcontroller.h>
    22 #include <flogger.h>
    23 
    24 
    25 /**
    26 States of the Client
    27 */
    28 enum TMVSState
    29 {
    30 	ENotReady	= 0,
    31 	EAudioOpening,
    32 	EAudioOpened,
    33 	EAudioPlaying,
    34 	EAudioRecording,
    35 	EAudioStopped,
    36 	EVideoOpening,
    37 	EVideoOpened,
    38 	EVideoPlaying,
    39 	EVideoRecording,
    40 	EVideoStopped,
    41 	EVideoPaused,
    42 	EAudioPaused
    43 };
    44 
    45 /**
    46 Modes of the Client
    47 */
    48 enum TMVSMode
    49 {
    50 	EAudioRecord,
    51 	EAudioPlay,
    52 	EVideoRecord,
    53 	EVideoPlay,
    54 	EIdle
    55 };	
    56  
    57 
    58 /**
    59 @publishedPartner
    60 @prototype
    61 @test
    62 
    63 An interface to Client callback function
    64 This serves as the method of communication between the Client and the UI
    65 
    66 */
    67 class MMVSClientObserver
    68 {
    69 public:
    70 	
    71 	/**
    72 	
    73 	Called when a multimedia controller plugin changes state e.g. when audio starts to play, 
    74 	the state changes from EAudioOpened to EAudioPlaying
    75 	
    76 	@param  aState
    77 	        Current State of the Client
    78 	@param  aError
    79 	        Error code. The status of the current operation
    80 	*/
    81 	virtual void UpdateStateChange(TMVSState aState, TInt aError) = 0;
    82 	
    83 	/**
    84 	Called when the audio resource becomes available but only if the resource was previously unavailable (e.g. if 
    85 	the audio resource is available when the client registers, then this callback is not received).
    86 
    87 	@param  aNotificationData
    88 			The data that corresponds to the notification event
    89 	*/
    90 	virtual void MvsResourceNotification(const TDesC8& aNotificationData) = 0;
    91 
    92 };
    93 
    94 
    95 /**
    96 @publishedPartner
    97 @prototype
    98 @test
    99 
   100 Utility class that does fetching the existing controller plugins,the extensions
   101 supported by them and finding the type of the media file for the UI.
   102 */
   103 class CMVSControllerPluginInfo: public CBase
   104 {
   105 public:
   106 	IMPORT_C static CMVSControllerPluginInfo* NewL();
   107 	IMPORT_C ~CMVSControllerPluginInfo();
   108 
   109 	IMPORT_C  TInt GetPluginListL(CDesCArrayFlat* aDisplayNames, RArray<TUid>& aUidArray);
   110 	IMPORT_C  TInt GetAudioPluginListL(CDesCArrayFlat* aDisplayNames, RArray<TUid>& aUidArray,RArray<TUid>& aUidPlayArray, TDesC* aExt);
   111 	IMPORT_C  TInt GetVideoPluginListL(CDesCArrayFlat* aDisplayNames, RArray<TUid>& aUidArray, TDesC* aExt);	
   112 	IMPORT_C TInt GetExtensionListL(TBool aControllerUid, CDesCArrayFlat* aExtArray);
   113 	IMPORT_C TUid GetMediaTypeL(TDesC& aFileName);
   114 	IMPORT_C CMMFControllerImplementationInformation& GetControllerInfo(TUid aControllerUid);
   115 private:
   116 	void CollectAudioControllersL(TDesC* aExt);
   117 	void CollectAudioPlayControllersL(TDesC* aExt);
   118 	void CollectVideoControllersL(TDesC* aExt);
   119 	void ConstructL(); //populate iControllers
   120 	CMVSControllerPluginInfo();
   121 	void GetHeaderL(TDesC& aFileName, TDes8& aHeaderData);
   122 private:
   123 	//list of controller info objects
   124 	RMMFControllerImplInfoArray iControllers;
   125 	RMMFControllerImplInfoArray iSupportedControllers;
   126 	RArray<TUid> iUidArray;
   127 	RMMFControllerImplInfoArray iAudioControllers;
   128 	RMMFControllerImplInfoArray iVideoControllers;
   129 	RMMFControllerImplInfoArray iAudioPlayControllers;
   130 	RArray<TUid> iAudioUidArray;
   131 	RArray<TUid> iAudioPlayUidArray;
   132 	RArray<TUid> iVideoUidArray;
   133 	RFileLogger iFileLogger;
   134 };
   135 
   136 
   137 #endif AGENTSUTILITY_H