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

📄 playeradapter.h

📁 一款大砖块的游戏
💻 H
字号:
// Copyright (c) 2001, Nokia Mobile Phones. All rights reserved.

#ifndef __CPLAYERADAPTER__
#define __CPLAYERADAPTER__

#include <MdaAudioSamplePlayer.h>

/*! 
  @class CPlayerAdapter
  
  @discussion An instance of class CPlayerAdapter is an adapter object for 
              the CMdaAudioPlayerUtility class.
  */
class CPlayerAdapter : public CBase, public MMdaAudioPlayerCallback
    {
public:
/*!
  @function NewL
  
  @discussion Create a CPlayerAdapter object using two phase construction,
  and return a pointer to the created object
  @param aFileName the audio file
  @param aAppUi the User Interface
  @result pointer to new object
  */
    static CPlayerAdapter* NewL(const TDesC& aFileName);
    
/*!
  @function NewLC
  
  @discussion Create a CPlayerAdapter object using two phase construction,
  and return a pointer to the created object
  @param aFileName the audio file
  @param aAppUi the User Interface
  @result pointer to new object
  */
    static CPlayerAdapter* NewLC(const TDesC& aFileName);

/*!
  @function ~CPlayerAdapter
  
  @discussion Destroy the object and release all memory objects
  */
    ~CPlayerAdapter();

public: // from MAudioAdapter
/*!
  @function PlayL
  
  @discussion Begin playback of the audio sample. 
  */
    void PlayL();

/*!
  @function RecordL
  
  @discussion Do nothing. Recording is not supported.
  */
    void RecordL() { /* not suported */ };

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

    void SetVolume(TInt aVolume);

    void SetVolumeFraction(TInt aFraction);

/*!
  @function Identify
  
  @discussion Return an identifying string 
  @result An identification string 
  */
    const TDesC& Identify();
    
public: // from MMdaAudioPlayerCallback
/*!
  @function MapcInitComplete
  
  @discussion Handle the event when initialisation of the audio player utility is complete.
  @param aError The status of the audio sample after initialisation
  @param aDuration The duration of the sample
  */
    void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);

/*!
  @function MapcInitComplete
  
  @discussion Handle the event when when the audio player utility completes asynchronous playing.
  @param aError The status of playback
  */
    void MapcPlayComplete(TInt aError);

private:

/*!
  @function CPlayerAdapter
  
  @discussion Perform the first phase of two phase construction 
  @param aAppUi the Ui to use
  */
    CPlayerAdapter();
    
    
/*!
  @function ConstructL
  
  @discussion Perform the second phase construction of a CPlayerAdapter object
  */
    void ConstructL(const TDesC& aFileName);

public:
	TBool iWantToPlay;

private:
/** The current state of the audio player utility. */
    enum TState
        {
        ENotReady,
        EReadyToPlay,
        EPlaying
        };
    
    TState iState;

    enum {EmdaPriorityNormal};

/** The audio player utility object. */
    CMdaAudioPlayerUtility* iMdaAudioPlayerUtility;

	TInt iVolumeFraction;

    };

#endif // __CPLAYERADAPTER__



⌨️ 快捷键说明

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