📄 shoutcasteventdispatcher.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 + -