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

📄 wavegen_volumesett.cpp

📁 symbian学习音乐播放的源代码
💻 CPP
字号:
//
// wavegen_volumesett.cpp
//
// Copyright (C) 2005 Nokia Corporation. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////

// INCLUDE FILES

#include "wavegen_volumesett.h"
#include "wavegen_engine.h"		// for CStreamAudioEngine
#include "wavegen.hrh"

//
// CWaveGenVolumeSettingItem class - overrides the HandleSettingPageEventL
// function from CAknVolumeSettingItem class
//
/*
-------------------------------------------------------------------------------
    CWaveGenVolumeSettingItem

    Description: Constructor

    Return Value: N/A
-------------------------------------------------------------------------------
*/
CWaveGenVolumeSettingItem::CWaveGenVolumeSettingItem(CStreamAudioEngine* aEng,
TInt aIdentifier, TInt &aExternalVolume)
:   CAknVolumeSettingItem(aIdentifier, aExternalVolume),
    iEng(aEng)
	{
	}

/*
-------------------------------------------------------------------------------
    ~CWaveGenVolumeSettingItem

    Description: Destructor

    Return Value: N/A
-------------------------------------------------------------------------------
*/
CWaveGenVolumeSettingItem::~CWaveGenVolumeSettingItem()
	{
	}

/*
-------------------------------------------------------------------------------
    HandleSettingPageEventL

    Description: Handles an event reported by a setting page to this observer
                 when the setting value of a setting item changes, passes the
                 new values directly to the audio engine
                 
    Parameters: aSettingPage - setting page which reported the event
                aEventType - type of event

    Return Value: N/A
-------------------------------------------------------------------------------
*/
void CWaveGenVolumeSettingItem::HandleSettingPageEventL(CAknSettingPage
    *aSettingPage, TAknSettingPageEvent aEventType)
	{
	if(aEventType == EEventSettingChanged)
		{
        // store the setting page internal value to the external variable
		StoreL();		
		
        // volume editor is distinguished from freq editor by setting item id
        switch(Identifier())
            {
            // pass the changed volume value to the engine
		    case EWaveGenVolume:
			    iEng->SetVolume(InternalVolumeValue());
                break;
            // pass the changed freq. value to the engine
            case EWaveGenFrequency:                                
                iEng->SetFrequency(InternalVolumeValue());
                break;
            default:               
                break;
            }
		}
    // call the base class handler to take care of other event types
	CAknSettingItem::HandleSettingPageEventL(aSettingPage, aEventType);
	}

// eof

⌨️ 快捷键说明

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