www.pudn.com > Full-Duplex_Audio_Example.rar > ao.cpp


/* 
* ============================================================================= 
*  Name        : ao.cpp 
*  Part of     : FullDuplexEx 
*  Description : Implementation for active object - used by the engine to  
                 signal input stream (init, start, stop, terminate) 
                  
*  Version     :  
* 
*  Copyright © 2007 Nokia. All rights reserved. 
*  This material, including documentation and any related  
*  computer programs, is protected by copyright controlled by  
*  Nokia. All rights are reserved. Copying, including  
*  reproducing, storing, adapting or translating, any  
*  or all of this material requires the prior written consent of  
*  Nokia. This material also contains confidential  
*  information which may not be disclosed to others without the  
*  prior written consent of Nokia. 
* ============================================================================= 
*/ 
 
#include  
#include "ao.h" 
 
#include "InputStreamThread.h" 
 
// Constructs and sets priority 
CAO::CAO(CInputStreamThread* aThread) 
: CActive(CActive::EPriorityStandard), 
  iThread(aThread) 
    { 
	CActiveScheduler::Add(this);		 
    } 
 
// Cancels this task 
void CAO::DoCancel() 
    { 
    TRequestStatus* status = &iStatus; 
    RThread().RequestComplete(status,KErrCancel); 
    } 
 
// Request accepting function 
void CAO::Request() 
    { 
	SetActive();	 
	iStatus = KRequestPending; 
    } 
 
// Informs the requestor that there is a user activity 
// or timer is fired 
void CAO::RunL() 
	{ 
	if(iStatus == KErrNone) 
		{ 
		iThread->DoHandleException(EExcUserInterrupt); 
		Request(); 
		} 
	} 
	 
// end of file