os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteagents/inc/audiorecordagent.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
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 Agents for TechView
sl@0
    15
//
sl@0
    16
sl@0
    17
#include <mdaaudiosampleeditor.h>
sl@0
    18
#include <mdaaudiosampleplayer.h>
sl@0
    19
#include <mda/client/utility.h>
sl@0
    20
#include <f32file.h>
sl@0
    21
#include <badesca.h>
sl@0
    22
#include <flogger.h>
sl@0
    23
#include <mvs/agentsutility.h>
sl@0
    24
sl@0
    25
#ifndef MVSAUDIORECORDAGENT_H
sl@0
    26
#define MVSAUDIORECORDAGENT_H
sl@0
    27
sl@0
    28
sl@0
    29
/**
sl@0
    30
@publishedPartner
sl@0
    31
@prototype
sl@0
    32
@test
sl@0
    33
sl@0
    34
Provides Audio recording functionality for the UI/Client.
sl@0
    35
sl@0
    36
*/
sl@0
    37
class CMVSAudioRecordAgent : public CBase, MMdaObjectStateChangeObserver
sl@0
    38
sl@0
    39
{
sl@0
    40
public:
sl@0
    41
	IMPORT_C static CMVSAudioRecordAgent* NewL(MMVSClientObserver& aObserver);
sl@0
    42
	IMPORT_C ~CMVSAudioRecordAgent();
sl@0
    43
	
sl@0
    44
	//creates new file for recording
sl@0
    45
	IMPORT_C void CreateNewFileL(TDesC& aFile,TUid aRecordControllerUid,TUid aPlayControllerUid);
sl@0
    46
	
sl@0
    47
	// supply controller uid
sl@0
    48
	IMPORT_C void OpenFileL(const TDesC& aFile, TUid aRecordControllerUid,TUid aPlayControllerUid); 
sl@0
    49
	// allow MMF to choose controller
sl@0
    50
	IMPORT_C void OpenFileL(const TDesC& aFile); 
sl@0
    51
	
sl@0
    52
	IMPORT_C  void OpenDesL(const TDesC8 &aDescriptor); //for future support
sl@0
    53
	
sl@0
    54
	IMPORT_C void RecordL();
sl@0
    55
	IMPORT_C void Stop();
sl@0
    56
	IMPORT_C void PlayL();
sl@0
    57
    
sl@0
    58
    //Setter methods - General
sl@0
    59
    IMPORT_C void SetGain(TInt aGain);
sl@0
    60
    IMPORT_C void CropClipL(TTimeIntervalMicroSeconds& aCropStart, 
sl@0
    61
                   TBool aflag);
sl@0
    62
    
sl@0
    63
    IMPORT_C void SetMetaDataL(RPointerArray<CMMFMetaDataEntry> aMetaEntry);
sl@0
    64
    IMPORT_C TInt SetPlayBalance(TInt aBalance);
sl@0
    65
    IMPORT_C TInt SetRecordBalance(TInt aBalance);
sl@0
    66
    IMPORT_C void SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
sl@0
    67
    IMPORT_C void SetRepeats(TInt aNoRepeats, TTimeIntervalMicroSeconds aDelay);
sl@0
    68
    IMPORT_C void SetPosition(TTimeIntervalMicroSeconds& aPosition);
sl@0
    69
    IMPORT_C void SetVolume(TInt aVolume, TTimeIntervalMicroSeconds aRamp);
sl@0
    70
    IMPORT_C TInt SetBalance(TInt aBalance);
sl@0
    71
    IMPORT_C void SetMaxWriteLength(TInt aMaxWriteLength);    
sl@0
    72
    //closes the current audio clip
sl@0
    73
    IMPORT_C void Reset();
sl@0
    74
	
sl@0
    75
	//Setter methods - Format configuration
sl@0
    76
	IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
sl@0
    77
	IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
sl@0
    78
	IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
sl@0
    79
	IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
sl@0
    80
		
sl@0
    81
	//Getter methods - General
sl@0
    82
	IMPORT_C TTimeIntervalMicroSeconds& Position() const;
sl@0
    83
	IMPORT_C TInt Gain(TInt& aGain);
sl@0
    84
	IMPORT_C TInt MaxGain() const;
sl@0
    85
	IMPORT_C void GetMetaDataArrayL(RPointerArray<CMMFMetaDataEntry>& aMetaData);
sl@0
    86
	IMPORT_C TInt GetVolume(TInt& aVolume);
sl@0
    87
	IMPORT_C TInt GetPlayBalance(TInt& aBalance);
sl@0
    88
	IMPORT_C TInt GetRecordBalance(TInt& aBalance);
sl@0
    89
	IMPORT_C TTimeIntervalMicroSeconds Duration();
sl@0
    90
	IMPORT_C TUint SourceBitRateL();
sl@0
    91
	IMPORT_C TInt MaxVolume();
sl@0
    92
	IMPORT_C const TTimeIntervalMicroSeconds RecordTimeAvailable();
sl@0
    93
	
sl@0
    94
	//Getter methods - Format configuration
sl@0
    95
	IMPORT_C void GetSupportedNoChannelsArrayL(RArray<TUint>& aNoChannelsArray);
sl@0
    96
    IMPORT_C void GetSupportedBitRatesArrayL(RArray<TUint>& aBitRatesArray);
sl@0
    97
    IMPORT_C void GetSupportedSampleRatesArrayL(RArray<TUint>& aSampleRatesArray);
sl@0
    98
    IMPORT_C void GetSupportedCodecsArrayL(RArray<TFourCC>& aCodecsArray);
sl@0
    99
    
sl@0
   100
    /**
sl@0
   101
	Returns the current state of Client. Provided for the UI to enable/disable the 
sl@0
   102
	menu items depending on the current state of the Client
sl@0
   103
	*/
sl@0
   104
    IMPORT_C TMVSState State();
sl@0
   105
    	
sl@0
   106
private:
sl@0
   107
	void ConstructL();// create recorder utility here
sl@0
   108
    CMVSAudioRecordAgent(MMVSClientObserver& aObserver);
sl@0
   109
	
sl@0
   110
	//from MMdaObjectStateChangeObserver
sl@0
   111
	void MoscoStateChangeEvent(CBase* /*aObject*/,
sl@0
   112
                                TInt /*aPreviousState*/, 
sl@0
   113
                                TInt /*aCurrentState*/, 
sl@0
   114
                                TInt /*aErrorCode*/);
sl@0
   115
    TBool EstablishFsSessionL();
sl@0
   116
    void CloseFsSession();
sl@0
   117
    void CloseFileSession();
sl@0
   118
    TBool EstablishFileSessionL(TDesC& aPath);
sl@0
   119
    
sl@0
   120
sl@0
   121
private:
sl@0
   122
	CMdaAudioRecorderUtility* iRecorder;
sl@0
   123
	MMVSClientObserver& iObserver;
sl@0
   124
	
sl@0
   125
	TMVSState iState;
sl@0
   126
	    
sl@0
   127
    //used to create the file to be recorded
sl@0
   128
    RFs iFs;
sl@0
   129
    RFile iFile;
sl@0
   130
    TBool iFsSessionEstablished;
sl@0
   131
    TBool iFileSessionEstablished;
sl@0
   132
    RFileLogger iFileLogger;        
sl@0
   133
}; 
sl@0
   134
#endif __MVSAUDIORECORDAGENT_H__