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

📄 sysinfo60rec.cpp

📁 基于SYMBIAN OS 的Moblile硬件管理器. 支持series 70平台
💻 CPP
字号:

#include "sysinfo60.hrh"
#include "sysinfo60rec.h"
#include "GenFuncs.h"

using namespace NGenFuncs;

CSYSINFO60Rec::CSYSINFO60Rec() 
{
}

CSYSINFO60Rec* CSYSINFO60Rec::NewL(void)
    {
    CSYSINFO60Rec* self = NewLC();
    CleanupStack::Pop(); // self
    return self;
    }

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

void CSYSINFO60Rec::ConstructL()
    {
    iMdaAudioRecorderUtility = CMdaAudioRecorderUtility::NewL(*this);
    }

CSYSINFO60Rec::~CSYSINFO60Rec()
    {
	this->Close();
    delete iMdaAudioRecorderUtility;    
    iMdaAudioRecorderUtility = NULL;
    }

/*
void CSYSINFO60Rec::PlayL()
    {
    iMdaAudioRecorderUtility->SetAudioDeviceMode(CMdaAudioRecorderUtility::ELocal);
    iMdaAudioRecorderUtility->SetVolume(iMdaAudioRecorderUtility->MaxVolume());
    iMdaAudioRecorderUtility->SetPosition(TTimeIntervalMicroSeconds(0));
    iMdaAudioRecorderUtility->PlayL();
    }

void CSYSINFO60Rec::StopL()
    {
    iMdaAudioRecorderUtility->Stop();
    }

void CSYSINFO60Rec::RecordL()
    {
    iMdaAudioRecorderUtility->SetAudioDeviceMode(CMdaAudioRecorderUtility::ELocal);
	iMdaAudioRecorderUtility->SetGain(iMdaAudioRecorderUtility->MaxGain());
    iMdaAudioRecorderUtility->SetPosition(TTimeIntervalMicroSeconds(0));
    iMdaAudioRecorderUtility->CropL();
    iMdaAudioRecorderUtility->RecordL();
    }
*/

TInt CSYSINFO60Rec::MaxGain()
{
	return iMdaAudioRecorderUtility->MaxGain();
}

TInt CSYSINFO60Rec::RecTime()
{
	TInt64 recMs = iMdaAudioRecorderUtility->RecordTimeAvailable().Int64();
	return recMs.operator/(static_cast<TInt64> (1000000)).GetTInt();
}

TInt CSYSINFO60Rec::MaxVol()
{
	return iMdaAudioRecorderUtility->MaxVolume();
}

void CSYSINFO60Rec::OpenL()
{
	iAudioSettings.iSampleRate = KSampleRate;
	iAudioSettings.iChannels = KChannels;	
	iFileClipLocation.iName = KRecorderFile;
	iMdaAudioRecorderUtility->OpenL(&iFileClipLocation, &iWavFormat, &iPcmCodec, &iAudioSettings);
}

void CSYSINFO60Rec::Close()
{
	if (iMdaAudioRecorderUtility->State() == CMdaAudioRecorderUtility::EOpen)
		iMdaAudioRecorderUtility->Close();
}

void CSYSINFO60Rec::MoscoStateChangeEvent(CBase* /*aObject*/, TInt /*aPreviousState*/, TInt /*aCurrentState*/, TInt aErrorCode)
{
#ifndef __WINS__
	if (aErrorCode)
	{
		NShowErrorMsgL(_L("Error "), aErrorCode);
	}
#endif
}

⌨️ 快捷键说明

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