audiopkgappview.cpp

来自「封装了Symbian OS 3rd的音频播放器」· C++ 代码 · 共 76 行

CPP
76
字号
/*
============================================================================
 Name        : AudioPkgView.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Application view
============================================================================
*/

#include <coemain.h>
#include "AudioPkgAppView.h"

_LIT( KwavFile, "\\RPGGame\\mainbg.pcm" );

_LIT( Kmp3File, "\\RPGgame\\dyfz.mp3" );
// ============================ MEMBER FUNCTIONS ===============================

CAudioPkgAppView* CAudioPkgAppView::NewL( const TRect& aRect )
    {
    CAudioPkgAppView* self = CAudioPkgAppView::NewLC( aRect );
    CleanupStack::Pop( self );
    return self;
    }

CAudioPkgAppView* CAudioPkgAppView::NewLC( const TRect& aRect )
    {
    CAudioPkgAppView* self = new ( ELeave ) CAudioPkgAppView;
    CleanupStack::PushL( self );
    self->ConstructL( aRect );
    return self;
    }

void CAudioPkgAppView::ConstructL( const TRect& aRect )
    {
    CreateWindowL();
    SetRect( aRect );
    ActivateL();

	iAudioEng = CAudioEngine::NewL( *this );
    }

CAudioPkgAppView::CAudioPkgAppView()
    {

    }

CAudioPkgAppView::~CAudioPkgAppView()
    {
		delete iAudioEng;
    }

void CAudioPkgAppView::Draw( const TRect& /*aRect*/ ) const
    {
    CWindowGc& gc = SystemGc();
    TRect drawRect( Rect());
    gc.Clear( drawRect );
    }

void CAudioPkgAppView::SizeChanged()
    {  
    DrawNow();
    }

void CAudioPkgAppView::HandlePlayingStopedL()
	{
	}

void CAudioPkgAppView::PlayWavL()
	{
	//iAudioEng->PlayWavL( Kmp3File );
	iAudioEng->PLayStreamL( KwavFile );
	//iAudioEng->PlayToneL( );
	}
// End of File

⌨️ 快捷键说明

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