📄 recorderadapter.h
字号:
/*
* ============================================================================
* Name : CRecorderAdapter from Recorderadapter.h
* Part of : RecorderExample
* Created : 20.03.2005 by Forum Nokia
* Description:
* Declares class to handle pure recording from source to a audio file
* Version : 1.0.0
* Copyright: Nokia Corporation
* ============================================================================
*/
#ifndef __CRECORDERADAPTER__
#define __CRECORDERADAPTER__
//INCLUDES
#include <e32std.h>
#include <MdaAudioSampleEditor.h>
// for MMdaObjectStateChangeObserver
#include <mda\\client\\utility.h>
// struct for recorder status
#include "recorder.hrh"
//CLASS DECLARATION
class CRecorderContainer;
/*!
@class CRecorderAdapter
@discussion An instance of class CRecorderAdapter is an adapter object for the CMdaAudioRecorderUtility class.
*/
class CRecorderAdapter : public CBase, /*public MAudioAdapter,*/ public MMdaObjectStateChangeObserver
{
public:
/*!
@function NewL
@discussion Create a CRecorderAdapter object using two phase construction,
and return a pointer to the created object
@param aAppUi the User Interface
@result pointer to new object
*/
static CRecorderAdapter* NewL(CRecorderContainer* Container);
/*!
@function NewLC
@discussion Create a CRecorderAdapter object using two phase construction,
and return a pointer to the created object
@param aAppUi the User Interface
@result pointer to new object
*/
static CRecorderAdapter* NewLC(CRecorderContainer* Container);
/*!
@function ~CRecorderAdapter
@discussion Destroy the object
*/
~CRecorderAdapter();
public:
/*!
@function PlayL
@discussion Set playback position of the file to the beginning
*/
void PlayL();
/*!
@function PlayCurrentPostionL
@discussion Begin playback of the audio sample.
*/
void PlayCurrentPositionL();
/*!
@function GetDuration
@return Current position of file in seconds
*/
TInt GetDuration();
/*!
@function GetDuration
@return Maximun duration of recording in seconds when iStatus is EReocding
or Lenght of audio file if playing
*/
TInt GetMaxDuration();
/*!
@function GetRecorderStatus
@return recorder status
*/
TRecorderAdapterStatus GetRecorderStatus();
/*!
@function StopL
@discussion Stop playback or recording of the audio sample.
Note that this implementation of the virtual function does not leave.
*/
void StopL(TRecorderAdapterStatus aStatus);
/*!
@function RecordL
@discussion Record using the audio utility.
*/
void RecordL();
/*!
@function UpdateMenuL
@discussion Update the menu aMenuPane to reflect the
current state of the audio recorder utility.
Note that this implementation of the virtual function does not leave.
@param aMenuPane the menu pane to update
*/
void UpdateMenuL(CEikMenuPane* aMenuPane);
/*!
@function Identify
@discussion Return an identifying string
@result An identification string
*/
const TDesC& Identify();
public: // from MMdaObjectStateChangeObserver
/*!
@function MoscoStateChangeEvent
@discussion Handle the change of state of an audio recorder utility.
@param aObject The audio sample object that has changed state
@param aPreviousState The state before the change
@param aCurrentState The current state
@param aErrorCode If not KErrNone, then the error that caused the state change
@aCurrentState The state after the change
@aErrorCode if not KErrNone, that error that caused the state change
*/
void MoscoStateChangeEvent(CBase* aObject, TInt aPreviousState, TInt aCurrentState, TInt aErrorCode);
private:
/*!
@function OpenFileL
@discussion iMdaAudioRecorderUtility opens next audio file if recording
otherwice open last recent file
*/
void OpenFileL(TBool newFile);
/*!
@function CRecorderAdapter
@discussion Perform the first phase of two phase construction
@param aAppUi the Ui to use
*/
CRecorderAdapter();
/*!
@function ConstructL
@discussion Perform the second phase construction of a CRecorderAdapter object
*/
void ConstructL(CRecorderContainer* Container);
private: //data
/*! The audio recorder utility object. */
CMdaAudioRecorderUtility* iMdaAudioRecorderUtility;
//iContainer
CRecorderContainer* iContainer;
//RecorderUtility's status
TRecorderAdapterStatus iStatus;
//Current position of playback
TTimeIntervalMicroSeconds iPosition;
};
#endif // __CRECORDERADAPTER__
//End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -