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

📄 mp3decodeengine.cpp

📁 symbian下mp3文件的解码源代码
💻 CPP
字号:
/*
    This file is part of MP3DecodeDLL for Symbian.

    MP3DecodeDLL for Symbian
    Copyright (C) 2004 Denis Mingulov <denis@mingulov.com>

    MP3DecodeDLL for Symbian is free software; you can redistribute
    it and/or modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2 of
    the License, or (at your option) any later version.

    MP3DecodeDLL for Symbian is distributed in the hope that it
    will be useful, but WITHOUT ANY WARRANTY; without even the implied
    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with MP3DecodeDLL for Symbian; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

#include "MP3Decode.h"
#include "MP3DecodeEngine.h"
#include "MP3DecodeNotifier.h"
#include "f32file.h"

EXPORT_C CMP3DecodeEngine* CMP3DecodeEngine::NewL()
{
	CMP3DecodeEngine* self=NewLC();
	CleanupStack::Pop();
	return self;
}

EXPORT_C CMP3DecodeEngine* CMP3DecodeEngine::NewLC()
{
	CMP3DecodeEngine* self=new (ELeave) CMP3DecodeEngine();
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
}

void CMP3DecodeEngine::ConstructL()
{
	iMP3Decode = CMP3Decode::NewL();
}

CMP3DecodeEngine::CMP3DecodeEngine() : iFileSession(NULL), iState(EDoNothing), bFileOpened(EFalse), iMP3Decode(NULL)
{
}

CMP3DecodeEngine::~CMP3DecodeEngine()
{
	delete iMP3Decode;
}

void CMP3DecodeEngine::ChangeState (TMP3DecodeEngineState aState)
{
	iState = aState;
}

EXPORT_C TMP3DecodeEngineState CMP3DecodeEngine::GetState()
{
	return iState;
}

EXPORT_C TInt CMP3DecodeEngine::SetEqualizer(TInt aEq60, TInt aEq170, TInt aEq310, TInt aEq600, TInt aEq1K, TInt aEq3K, TInt aEq6K, TInt aEq12K, TInt aEq14K, TInt aEq16K, TInt aEqZero, TInt aEqDiv)
{
	iMP3Decode->SetEqualizer(aEq60, aEq170, aEq310, aEq600, aEq1K, aEq3K, aEq6K, aEq12K, aEq14K, aEq16K, aEqZero, aEqDiv);

	return 0;
}

EXPORT_C TInt CMP3DecodeEngine::SetResampleRate(TInt aResampleRate)
{
	return iMP3Decode->SetResampleRate(aResampleRate);
}

EXPORT_C TInt CMP3DecodeEngine::OpenFile(RFs& aFileServer, const TDesC &aFileName)
{
	iFileSession = &aFileServer;
	strFileName.Copy(aFileName);

	TInt iErr = iMP3Decode->Open(aFileServer, aFileName);

	if(iErr)
	{
		ChangeState(EDoNothing);
	}
	else
		ChangeState(EOpenComplete);

	return iErr;
}

EXPORT_C TInt CMP3DecodeEngine::CloseFile()
{
	return 0;
}

EXPORT_C TInt CMP3DecodeEngine::DecodeStart()
{
	ChangeState(EDecoding);
	return 0;
}

EXPORT_C TInt CMP3DecodeEngine::DecodeStop()
{
	return 0;
}

EXPORT_C TInt CMP3DecodeEngine::DecodeOneFrame(TDes &aBuffer)
{
	TInt iR=iMP3Decode->DecodeOneFrame(aBuffer);
	return iR;
}

EXPORT_C TInt CMP3DecodeEngine::GetFileLength()
{
	return iMP3Decode->GetFileLength();
}

EXPORT_C TInt CMP3DecodeEngine::GetFilePosition()
{
	return iMP3Decode->GetFilePosition();
}

⌨️ 快捷键说明

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