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

📄 shoutcasteventdispatcher.cpp

📁 这是一个使用 ShortCast的IP网络流式播放的symbian的软件源码.里面有ShortCast短播协议的实现以及AAC音频,MP3音频流式播放的实现.
💻 CPP
字号:
/*
* ==============================================================================
*  Name        : ShoutcastEventDispatcher.cpp
*  Part of     : Shoutcast Engine
*  Interface   :
*  Description : Event Dispatcher Implementation
*  Version     : 1
*
*  Copyright (c) 2006 Nokia Corporation.
*  This material, including documentation and any related
*  computer programs, is protected by copyright controlled by
*  Nokia Corporation. All rights are reserved. Copying,
*  including reproducing, storing, adapting or translating, any
*  or all of this material requires the prior written consent of
*  Nokia Corporation. This material also contains confidential
*  information which may not be disclosed to others without the
*  prior written consent of Nokia Corporation.
* ==============================================================================
*/

#include <e32svr.h>
#include "ShoutcastEventDispatcher.h"

// -----------------------------------------------------------------------------
// CEventDispatcher::CEventDispatcher
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CEventDispatcher::CEventDispatcher(
	MShoutcastStreamObserver& aObserver )
	: CActive(CActive::EPriorityStandard),
	  iObserver(aObserver)
	{
	CActiveScheduler::Add(this);
	}

// -----------------------------------------------------------------------------
// CShoutcastStream::NewL
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CEventDispatcher* CEventDispatcher::NewL(
	MShoutcastStreamObserver& aObserver )
	{
	return new(ELeave) CEventDispatcher(aObserver);
	}


CEventDispatcher::~CEventDispatcher()
	{
	Cancel();
	}

// -----------------------------------------------------------------------------
// CShoutcastStream::SendEvent
// Requesting event to be sent, after a context jump.
// -----------------------------------------------------------------------------
//
void CEventDispatcher::SendEvent(TUid aEvent, TInt aError)
	{
	iEvent = aEvent;
	iError = aError;
	if (!IsActive())
		{
		TRequestStatus* s = &iStatus;
		SetActive();
	        User::RequestComplete(s, KErrNone);
		}
	}

// -----------------------------------------------------------------------------
// CShoutcastStream::RunL
// Send event to observer
// -----------------------------------------------------------------------------
//
void CEventDispatcher::RunL()
	{
	iObserver.HandleEvent(iEvent, iError);
	}

// -----------------------------------------------------------------------------
// CShoutcastStream::DoCancel
// Cancel any outstanding requests
// -----------------------------------------------------------------------------
//
void CEventDispatcher::DoCancel()
	{
	// Nothing to cancel
	}

⌨️ 快捷键说明

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