⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 recorderadapter.h

📁 symbian 可以实现控制声音大小的源码 非常实用!
💻 H
字号:
/* Copyright (c) 2004, Nokia. All rights reserved */


#ifndef __CRECORDERADAPTER_H__
#define __CRECORDERADAPTER_H__


// INCLUDES
#include <e32std.h>
#include <MdaAudioSampleEditor.h>
#include <mda\\client\\utility.h> // for MMdaObjectStateChangeObserver
#include "audioadapter.h"


// CONSTANTS
// The sound file produced in record mode
_LIT( KRecorderFile, "record.wav" );

// FORWARD DECLARATIONS
class CSoundAppUi;



// CLASS DECLARATION

/** 
* CRecorderAdapter
* An instance of class CRecorderAdapter is an adapter 
* object for the CMdaAudioRecorderUtility class.
*/

class CRecorderAdapter : public CBase, 
                         public MAudioAdapter, 
                         public MMdaObjectStateChangeObserver
    {
    public:

        /**
        * NewL
        * Two-phased constructor.
        * Create a CRecorderAdapter object using two phase construction,
        * and return a pointer to the created object
        * @param aAppUi the User Interface
        * @return  pointer to new object
        */
        static CRecorderAdapter* NewL( CSoundAppUi& aAppUi );

        /**
        * NewLC
        * Two-phased constructor.
        * Create a CRecorderAdapter object using two phase construction,
        * and return a pointer to the created object
        * @param aAppUi the User Interface
        * @return  pointer to new object
        */
        static CRecorderAdapter* NewLC( CSoundAppUi& aAppUi );

        /**
        * ~CRecorderAdapter.
        * Virtual Destructor.
        */
        virtual ~CRecorderAdapter();


    public: // from MAudioAdapter

        /**
        * PlayL
        * Begin playback of the audio sample. 
        */ 
        void PlayL();

        /**
        * StopL
        * Stop playback or recording of the audio sample
        * Note that this implementation of the virtual function does not leave.
        */
        void StopL();

        /**
        * RecordL
        * Record using the audio utility.
        */
        void RecordL();


        /**
        * UpdateMenuL
        * Update the menu aMenuPane to reflect the current state of the 
        * audio player utility. Note that this implementation of the 
        * virtual function does not leave. 
        * @param aMenuPane the menu pane to update
        */
        void UpdateMenuL( CEikMenuPane* aMenuPane );

        /**
        * Identify
        * Return an identifying string 
        * @return An identification string 
        */
        const TDesC& Identify();


    public: // from MMdaObjectStateChangeObserver

        /**
        * MoscoStateChangeEvent
        * 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
        */
        void MoscoStateChangeEvent( CBase* aObject, 
                                    TInt aPreviousState,
                                    TInt aCurrentState, 
                                    TInt aErrorCode );

    private:    // Constructors

        /**
        * CRecorderAdapter.
        * C++ default constructor.
        * Perform the first phase of two phase construction 
        * @param aAppUi the Ui to use
        */
        CRecorderAdapter( CSoundAppUi& aAppUi );
      
        /**
        * ConstructL
        * 2nd phase constructor.
        */
        void ConstructL();

    private:    //Data

        /**
        * iMdaAudioRecorderUtility. The audio recorder utility object
        * owned by CRecorderAdapter object.
        */
        CMdaAudioRecorderUtility* iMdaAudioRecorderUtility;

        /** Reference to the application's UI object. **/
        CSoundAppUi& iAppUi;

        /**
        * itextResourceIdentifier. Textresource for identifier
        * owned by CRecorderAdapter object.
        */
        HBufC* itextResourceIdentifier;
    };

#endif // __CRECORDERADAPTER_H__


// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -