/**
Handles a request from the client. Called by the controller framework.

@param aMessage The message to be handled.
*/
void CMidiCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
	{
	if (aMessage.Destination().InterfaceId() == KUidInterfaceMidi)
		{
		TRAPD(error, DoHandleRequestL(aMessage));
		if (error)
			aMessage.Complete(error);
		}
	else
		{
		aMessage.Complete(KErrNotSupported);
		}
	}
// ---------------------------------------------------------
// CListenerOrientationMessageHandler::DoHandleRequestL
// Dispatches the message to the appropriate handler.
// ---------------------------------------------------------
//
void CListenerOrientationMessageHandler::DoHandleRequestL(
	TMMFMessage& aMessage )
	{
	switch( aMessage.Function() )
		{
		case ELofInitialize: // Request to initialize the bassboost
			{
			DoInitializeL(aMessage);
			break;
			}
		case ELofApply: // Request to apply the bassboost settings
			{
			DoApplyL(aMessage);
			break;
			}
		case ELofObserve: // Observation request
			{
			DoObserveL(aMessage);
			break;
			}
		default:
			{
			aMessage.Complete(KErrNotSupported);
			}
		}
	}
// -----------------------------------------------------------------------------
// CRa8CustomInterfaceMsgHdlr::DoFrameNumberL
// Handles the message from the proxy and calls the custom interface method.
// The data passed from the proxy is read from the message and passed to
// the custom interface.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CRa8CustomInterfaceMsgHdlr::DoFrameNumberL(TMMFMessage& aMessage)
    {
	TInt frame = iRa8CustomInterface->FrameNumber();
	TPckgBuf<TInt> pckg(frame);
	aMessage.WriteDataToClientL(pckg);
    aMessage.Complete(KErrNone);
    }
// ---------------------------------------------------------
// CListenerOrientationMessageHandler::DoObserveL
// Receives the observation request message and depending
// on the status of the effect data queue, the message is
// completed immediately or saved for later completion.
// ---------------------------------------------------------
//
void CListenerOrientationMessageHandler::DoObserveL(
	TMMFMessage& aMessage )
	{

#ifdef _DEBUG
    RDebug::Print(_L("CListenerOrientationMessageHandler::DoObserveL"));
#endif

	if ( !iRegistered ) // Don't register again if we're registered.
		{
		iListenerOrientation->RegisterObserverL(*this);
		iRegistered = ETrue;
		}

	if ( iEffectDataQue->IsEmpty() )
		{
		// Message is saved and completed when an event occurs
		iMessage = new(ELeave) TMMFMessage(aMessage);
		}
	else
		{
		TEfOrientationDataPckg dataPckg;
		CEffectDataQueItem* item = iEffectDataQue->First();
		dataPckg.Copy(item->EffectData());
		aMessage.WriteDataToClient(dataPckg);
		aMessage.Complete(KErrNone);
		iEffectDataQue->Remove(*item);
		delete item;
		}
	}
// ---------------------------------------------------------
// CEnvironmentalReverbMessageHandler::DoObserveL
// Receives the observation request message and depending
// on the status of the effect data queue, the message is
// completed immediately or saved for later completion.
// ---------------------------------------------------------
//
void CEnvironmentalReverbMessageHandler::DoObserveL(
	TMMFMessage& aMessage )
	{

#ifdef _DEBUG
    RDebug::Print(_L("CEnvironmentalReverbMessageHandler::DoObserveL"));
#endif

	if ( !iRegistered )
		{
		iEnvironmentalReverb->RegisterObserverL(*this);
		iRegistered = ETrue;
		}

	if ( iEffectDataQue->IsEmpty() )
		{
		//iMessage = &aMessage;
		iMessage = new(ELeave) TMMFMessage(aMessage);
		}
	else
		{
		TEfEnvReverbDataPckg dataPckg;
		CEffectDataQueItem* item = iEffectDataQue->First();
		dataPckg.Copy(item->EffectData());
		aMessage.WriteDataToClient(dataPckg);
		aMessage.Complete(KErrNone);
		iEffectDataQue->Remove(*item);
		delete item;
		}
	}
// ---------------------------------------------------------
// CEnvironmentalReverbMessageHandler::DoHandleRequestL
// Dispatches the message to the appropriate handler.
// ---------------------------------------------------------
//
void CEnvironmentalReverbMessageHandler::DoHandleRequestL(
	TMMFMessage& aMessage )
	{
	switch( aMessage.Function() )
		{
		case EErfInitialize:
			{
			DoInitializeL(aMessage);
			break;
			}
		case EErfApply:
			{
			DoApplyL(aMessage);
			break;
			}
		case EErfObserve:
			{
			DoObserveL(aMessage);
			break;
			}
			
			
			
		default:
			{
			aMessage.Complete(KErrNotSupported);
			}
		}
	}
// ---------------------------------------------------------
// CIlbcEncoderIntfcMsgHdlr::DoHandleRequestL
// Determines which custom interface to call.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CIlbcEncoderIntfcMsgHdlr::DoHandleRequestL(TMMFMessage& aMessage)
	{
	switch(aMessage.Function())
		{
		case EIlbceimSetEncoderMode:
			{
    		DoSetEncoderModeL(aMessage);
			break;
			}
		case EIlbceimSetVadMode:
			{
			DoSetVadModeL(aMessage);
			break;
			}
		case EIlbceimGetVadMode:
			{
			DoGetVadModeL(aMessage);
			break;
			}
		default:
			{
			aMessage.Complete(KErrNotSupported);
			}
		}
	}
// ---------------------------------------------------------
// CIlbcEncoderIntfcMsgHdlr::DoSetVadModeL
// Handles the message from the proxy and calls the custom interface method.
// The data passed from the proxy is read from the message and passed to
// the custom interface.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CIlbcEncoderIntfcMsgHdlr::DoSetVadModeL(TMMFMessage& aMessage)
	{
	TPckgBuf<TBool> pckgBuf;
	aMessage.ReadData1FromClientL(pckgBuf);
	TInt status = iIlbcEncoderIntfcCI->SetVadMode(pckgBuf());
    aMessage.Complete(status);
	}
// ---------------------------------------------------------
// CAacDecoderConfigMsgHdlr::DoSetAudioConfigL
// Handles the message from the proxy and calls the custom interface method.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CAacDecoderConfigMsgHdlr::DoSetAudioConfigL(TMMFMessage& aMessage)
    {
	TPckgBuf<TAudioConfig> pckg;
	aMessage.ReadData1FromClientL(pckg);
	TInt status = iAacDecoderConfigCI->SetAudioConfig(pckg());
    aMessage.Complete(status);
    }
// ---------------------------------------------------------
// CErrorConcealmentIntfcMsgHdlr::DoSetFrameModeL
// Handles the message from the proxy and calls the custom interface method.
// The data passed from the proxy is read from the message and passed to
// the custom interface.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CErrorConcealmentIntfcMsgHdlr::DoSetFrameModeL(TMMFMessage& aMessage)
    {
	TPckgBuf<TBool> pckg;
	aMessage.ReadData1FromClientL(pckg);
	TInt status = iErrorConcealmentIntfcCI->SetFrameMode(pckg());
    aMessage.Complete(status);
    }
// ---------------------------------------------------------
// CErrorConcealmentIntfcMsgHdlr::DoHandleRequestL
// Determines which custom interface to call.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CErrorConcealmentIntfcMsgHdlr::DoHandleRequestL(TMMFMessage& aMessage)
	{
	switch(aMessage.Function())
		{
		case EEcimConcealError:
			{
    		DoConcealErrorForNextBufferL(aMessage);
			break;
			}
		case EEcimSetFrameMode:
			{
    		DoSetFrameModeL(aMessage);
			break;
			}
		case EEcimFrameModeRqrd:
			{
    		DoFrameModeRqrdForEcL(aMessage);
			break;
			}
		default:
			{
			aMessage.Complete(KErrNotSupported);
			}
		}
	}
// ---------------------------------------------------------
// CEnvironmentalReverbMessageHandler::DoInitializeL
// ---------------------------------------------------------
//
void CEnvironmentalReverbMessageHandler::DoInitializeL(TMMFMessage& aMessage)
	{
#ifdef _DEBUG
    RDebug::Print(_L("CEnvironmentalReverbMessageHandler::DoInitializeL"));
#endif
	aMessage.WriteDataToClient(iEnvironmentalReverb->DoEffectData());
	aMessage.Complete(KErrNone);
	}
// -----------------------------------------------------------------------------
// CRa8CustomInterfaceMsgHdlr::HandleRequest
// Handles the messages from the proxy.
// Calls a subfunction which determines which custom interface to call.
// A subfunction is used to contain multiple leaving functions for a single
// trap.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
EXPORT_C void CRa8CustomInterfaceMsgHdlr::HandleRequest(TMMFMessage& aMessage)
	{
	ASSERT(aMessage.Destination().InterfaceId() == KUidRa8DecHwDeviceCI);
	TRAPD(error,DoHandleRequestL(aMessage));
	if (error)
		{
		aMessage.Complete(error);
		}
	}
// Handles a request from the client. Called by the controller framework.
void CStreamControlCustomCommandParser::HandleRequest( TMMFMessage& aMessage )
    {
    TInt status = KErrNotSupported;
    if ( aMessage.Destination().InterfaceId() == KUidIFStreamControlCustomCommands )
        {
        status = DoHandleRequest( aMessage );
        }
    aMessage.Complete(status);
    }
// ---------------------------------------------------------
// CAacDecoderConfigMsgHdlr::HandleRequest
// Handles the messages from the proxy.
// Calls a subfunction which determines which custom interface to call.
// A subfunction is used to contain multiple leaving functions for a single
// trap.
// (other items were commented in a header).
// ---------------------------------------------------------
//
EXPORT_C void CAacDecoderConfigMsgHdlr::HandleRequest(TMMFMessage& aMessage)
	{
	ASSERT(aMessage.Destination().InterfaceId() == KUidAacDecoderConfig);
	TRAPD(error,DoHandleRequestL(aMessage));
	if(error)
		{
		aMessage.Complete(error);
		}
	}
// ---------------------------------------------------------
// CEnvironmentalReverbMessageHandler::HandleRequest
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CEnvironmentalReverbMessageHandler::HandleRequest(
	TMMFMessage& aMessage )
	{
	ASSERT(aMessage.Destination().InterfaceId() == KUidEnvironmentalReverbEffect);
	TRAPD(error,DoHandleRequestL(aMessage));
	if ( error )
		{
		aMessage.Complete(error);
		}
	}
// ---------------------------------------------------------
// CIlbcEncoderIntfcMsgHdlr::HandleRequest
// Handles the messages from the proxy.
// Calls a subfunction which determines which custom interface to call.
// A subfunction is used to contain multiple leaving functions for a single
// trap.
// (other items were commented in a header).
// ---------------------------------------------------------
//
EXPORT_C void CIlbcEncoderIntfcMsgHdlr::HandleRequest(
                                                       TMMFMessage& aMessage)
	{
	ASSERT(aMessage.Destination().InterfaceId() == KUidIlbcEncoderIntfc);
	TRAPD(error,DoHandleRequestL(aMessage));
	if(error)
		{
		aMessage.Complete(error);
		}
	}
// ---------------------------------------------------------
// CListenerOrientationMessageHandler::DoApplyL
// Extracts the data from the message. The client bassboost data
// is applied to the CI bassboost object.
// ---------------------------------------------------------
//
void CListenerOrientationMessageHandler::DoApplyL(
	TMMFMessage& aMessage )
	{
    TEfOrientationDataPckg orientationPckgFromClient;
    aMessage.ReadData1FromClient(orientationPckgFromClient);

	iListenerOrientation->SetEffectData(orientationPckgFromClient);
	iListenerOrientation->ApplyL();
	aMessage.Complete(KErrNone);
	}
// ---------------------------------------------------------
// CListenerOrientationMessageHandler::HandleRequest
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CListenerOrientationMessageHandler::HandleRequest(
	TMMFMessage& aMessage )
	{
	ASSERT(aMessage.Destination().InterfaceId() == KUidListenerOrientationEffect);
	TRAPD(error,DoHandleRequestL(aMessage));
	if ( error )
		{
		aMessage.Complete(error);
		}
	}
// ---------------------------------------------------------
// CIlbcEncoderIntfcMsgHdlr::DoGetVadModeL
// Handles the message from the proxy and calls the custom interface.
// The custom interface returns the data requested and this function
// writes it back to the proxy.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CIlbcEncoderIntfcMsgHdlr::DoGetVadModeL(TMMFMessage& aMessage)
	{
	TBool vadMode;
	TInt status = iIlbcEncoderIntfcCI->GetVadMode(vadMode);
	if (status == KErrNone)
    	{
    	TPckgBuf<TBool> pckgBuf;
	    pckgBuf() = vadMode;
    	aMessage.WriteDataToClientL(pckgBuf);
    	}
    aMessage.Complete(status);
	}
// ---------------------------------------------------------
// CEnvironmentalReverbMessageHandler::DoApplyL
// Extracts the data from the message. The client EnvironmentalReverb
// data is applied to the CI EnvironmentalReverb object.
// ---------------------------------------------------------
//
void CEnvironmentalReverbMessageHandler::DoApplyL(
	TMMFMessage& aMessage )
	{
#ifdef _DEBUG
    RDebug::Print(_L("CEnvironmentalReverbMessageHandler::DoApplyL"));
#endif
    TEfEnvReverbDataPckg environmentalReverbPckgFromClient;
    aMessage.ReadData1FromClient(environmentalReverbPckgFromClient);
	iEnvironmentalReverb->SetEffectData(environmentalReverbPckgFromClient);
	iEnvironmentalReverb->ApplyL();
	aMessage.Complete(KErrNone);
	}
// -----------------------------------------------------------------------------
// CRa8CustomInterfaceMsgHdlr::DoSetInitStringL
// Handles the message from the proxy and calls the custom interface method.
// The data passed from the proxy is read from the message and passed to
// the custom interface.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CRa8CustomInterfaceMsgHdlr::DoSetInitStringL(TMMFMessage& aMessage)
    {
	TInt size = aMessage.SizeOfData1FromClient();
	HBufC8* dataBuf = HBufC8::NewL(size);
	CleanupStack::PushL( dataBuf );
	TPtr8 dataPtr = dataBuf->Des();
    aMessage.ReadData1FromClientL(dataPtr);
	TInt status = iRa8CustomInterface->SetInitString(dataPtr);
	CleanupStack::Pop(dataBuf);
	delete dataBuf;
    aMessage.Complete(status);
    }
// ---------------------------------------------------------
// CErrorConcealmentIntfcMsgHdlr::DoFrameModeRqrdForEcL
// Handles the message from the proxy and calls the custom interface method.
// The custom interface returns the data requested and this function
// writes it back to the proxy.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CErrorConcealmentIntfcMsgHdlr::DoFrameModeRqrdForEcL(TMMFMessage& aMessage)
    {
	TBool frameModeRqrd;
	TInt status = iErrorConcealmentIntfcCI->FrameModeRqrdForEC(frameModeRqrd);
	if (status == KErrNone)
    	{
    	TPckgBuf<TBool> pckg;
	    pckg() = frameModeRqrd;
    	aMessage.WriteDataToClientL(pckg);
    	}
    aMessage.Complete(status);
    }
// ---------------------------------------------------------
// CAacDecoderConfigMsgHdlr::DoHandleRequestL
// Determines which custom interface to call.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CAacDecoderConfigMsgHdlr::DoHandleRequestL(TMMFMessage& aMessage)
	{
	switch(aMessage.Function())
		{
		case EAdcmSetConfig:
			{
    		DoSetAudioConfigL(aMessage);
			break;
			}
		default:
			{
			aMessage.Complete(KErrNotSupported);
			}
		}
	}
void CMMFDurationInfoCustomCommandParser::HandleRequest(TMMFMessage& aMessage)
	{
	TInt err = KErrNotSupported;
	
	if (aMessage.Destination().InterfaceId() == KUidInterfaceMMFDurationInfoControl)
		{
		switch (aMessage.Function())
			{
		case EMMFGetDurationInfo:
			err = GetDurationInfo(aMessage);
			break;
		default:
			err = KErrNotSupported;
			break;
			}
		}

	aMessage.Complete(err);
	}
// -----------------------------------------------------------------------------
// CRa8CustomInterfaceMsgHdlr::DoHandleRequestL
// Determines which custom interface to call.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CRa8CustomInterfaceMsgHdlr::DoHandleRequestL(TMMFMessage& aMessage)
	{
	switch (aMessage.Function())
		{
		case ERa8CiFrameNumber:
			{
    		DoFrameNumberL(aMessage);
			break;
			}
		case ERa8CiSetInitString:
			{
    		DoSetInitStringL(aMessage);
			break;
			}
		default:
			{
			aMessage.Complete(KErrNotSupported);
			}
		}
	}
Beispiel #27
0
void CMMFUrlSink::SinkCustomCommand(TMMFMessage& aMessage)
	{
	aMessage.Complete(KErrNotSupported);
	}
Beispiel #28
0
void CMMFUrlSource::SourceCustomCommand(TMMFMessage& aMessage)
	{
	aMessage.Complete(KErrNotSupported);
	}
// ---------------------------------------------------------
// CListenerOrientationMessageHandler::DoInitializeL
// ---------------------------------------------------------
//
void CListenerOrientationMessageHandler::DoInitializeL(TMMFMessage& aMessage)
	{
	aMessage.WriteDataToClient(iListenerOrientation->DoEffectData());
	aMessage.Complete(KErrNone);
	}
// ---------------------------------------------------------
// CErrorConcealmentIntfcMsgHdlr::DoConcealErrorForNextBufferL
// Handles the message from the proxy and calls the custom interface method.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CErrorConcealmentIntfcMsgHdlr::DoConcealErrorForNextBufferL(
                                                         TMMFMessage& aMessage)
    {
	TInt status = iErrorConcealmentIntfcCI->ConcealErrorForNextBuffer();
    aMessage.Complete(status);
    }