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

📄 toneadapter.h

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


#ifndef __CTONEADAPTER_H__
#define __CTONEADAPTER_H__


// INCLUDES
#include <e32std.h>
#include <MdaAudioTonePlayer.h>
#include "audioadapter.h"


// CONSTANTS

// Frequency and duration of the tone to be played
static const TInt KSoundFrequency = 3000;
static const TInt KSoundDuration = 5000000;

// FORWARD DECLARATIONS
class CSoundAppUi;



// CLASS DECLARATION

/**
* CToneAdapter
* An instance of class CToneAdapter is an adapter for 
* the CMdaAudioToneUtility class.
*/
class CToneAdapter : public CBase, 
                     public MAudioAdapter, 
                     public MMdaAudioToneObserver
    {
    public:


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


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

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

    public: // from MAudioAdapter

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

        /**
        * RecordL
        * Do nothing. Recording is not supported.
        */
        void RecordL();

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

        /**
        * UpdateMenuL
        * Update the menu aMenuPane to reflect the 
        * current state of the audio tone 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 MMdaAudioToneObserver

        /**
        * MatoPrepareComplete
        * Handle the event when a tone utility initialisation
        * operation has completed. 
        * @param aError indicates whether an error occurred.
        */
        void MatoPrepareComplete( TInt aError );

        /**
        * MatoPlayComplete
        * Handle the event when a tone playing operation has completed.
        * @param aError indicates whether an error occurred.
        */
        void MatoPlayComplete( TInt aError );
    
    private: // Constructors and destructor

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


        /**
        * ConstructL
        * 2nd phase constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL();

    private:  // Data

        /**
        * iMdaAudioToneUtility The audio tone utility object.
        * owned by CToneAdapter object.
        */
        CMdaAudioToneUtility* iMdaAudioToneUtility;

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

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

#endif // __CTONEADAPTER_H__


// End of File

⌨️ 快捷键说明

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