mmfenh/enhancedmediaclient/Client/src/Components/ClientProgDLSource/EventAO.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:23:00 +0100
branchRCL_3
changeset 46 0ac9a5310753
parent 0 71ca22bcf22a
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Implementation of EventAO class.
*
*/


#include "EventAO.h"

using namespace multimedia;

CEventAO::CEventAO(MSourceStateObserver& aObserver )
: CActive(CActive::EPriorityStandard),
iObserver(aObserver),
iError(KErrNone)
    {
    CActiveScheduler::Add(this);
    }

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

CEventAO* CEventAO::NewL( MSourceStateObserver& aObserver )
    {
    CEventAO* self = new (ELeave)CEventAO( aObserver );
    CleanupStack::PushL( self );
    self->ConstructL();
    CleanupStack::Pop( self );
    return self;
    }

void CEventAO::ConstructL()
    {
    }

void CEventAO::SetActive()
    {
    if (!IsActive())
        {
        CActive::SetActive();
        }
    }

TInt CEventAO::Error()
    {
    return iError;
    }

// From CActive
void CEventAO::RunL()
    {
    // Save the error code
    iError = iStatus.Int();
    // Signal the observer that this request is serviced
    iObserver.SourceStateChanged();
    }

void CEventAO::DoCancel()
    {
    if(iStatus.Int() != 0)
        {
        TRequestStatus* status = &iStatus;
        User::RequestComplete(status,KErrCancel);
        }
    }

TInt CEventAO::RunError( TInt /*aError*/ )
    {
    return KErrNone;
    }

// End of File