os/kernelhwsrv/kernel/eka/include/d32soundsc.inl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/include/d32soundsc.inl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,111 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32\include\drivers\d32soundsc.inl
    1.18 +// User side inline header file for the shared chunk sound driver.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +/**
    1.23 + @file
    1.24 + @publishedPartner
    1.25 + @prototype
    1.26 +*/
    1.27 +
    1.28 +inline TVersion RSoundSc::VersionRequired()
    1.29 +	{
    1.30 +	const TInt KSoundScMajorVersionNumber=1;
    1.31 +	const TInt KSoundScMinorVersionNumber=0;
    1.32 +	const TInt KSoundScBuildVersionNumber=KE32BuildVersionNumber;
    1.33 +	return TVersion(KSoundScMajorVersionNumber,KSoundScMinorVersionNumber,KSoundScBuildVersionNumber);
    1.34 +	}
    1.35 +
    1.36 +#ifndef __KERNEL_MODE__
    1.37 +
    1.38 +inline TInt RSoundSc::Open(TInt aUnit)
    1.39 +	{return(DoCreate(KDevSoundScName,VersionRequired(),aUnit,NULL,NULL,EOwnerProcess));}
    1.40 +	
    1.41 +inline void RSoundSc::Caps(TDes8& aCapsBuf)
    1.42 +	{DoControl(EControlGetCaps,(TAny*)&aCapsBuf);}
    1.43 +	
    1.44 +inline void RSoundSc::AudioFormat(TDes8& aFormatBuf)
    1.45 +	{DoControl(EControlGetAudioFormat,(TAny*)&aFormatBuf);}
    1.46 +	
    1.47 +inline TInt RSoundSc::SetAudioFormat(const TDesC8& aFormatBuf)
    1.48 +	{return(DoControl(EMsgControlSetAudioFormat,(TAny*)&aFormatBuf));}
    1.49 +
    1.50 +inline void RSoundSc::GetBufferConfig(TDes8& aConfigBuf)
    1.51 +	{DoControl(EControlGetBufConfig,(TAny*)&aConfigBuf);}
    1.52 + 	
    1.53 +inline TInt RSoundSc::SetBufferChunkCreate(const TDesC8& aConfigBuf,RChunk& aChunk)
    1.54 + 	{return(aChunk.SetReturnedHandle(DoControl(EMsgControlSetBufChunkCreate,(TAny*)&aConfigBuf)));}
    1.55 + 		
    1.56 +inline TInt RSoundSc::SetBufferChunkOpen(const TDesC8& aConfigBuf,RChunk& aChunk)
    1.57 + 	{return(DoControl(EMsgControlSetBufChunkOpen,(TAny*)&aConfigBuf,(TAny*)aChunk.Handle()));}
    1.58 + 	
    1.59 +inline TInt RSoundSc::Volume()
    1.60 +	{return(DoControl(EControlGetVolume));}
    1.61 +	
    1.62 +inline TInt RSoundSc::SetVolume(TInt aVolume)
    1.63 +	{return(DoControl(EMsgControlSetVolume,(TAny*)aVolume));}
    1.64 +	
    1.65 +inline void RSoundSc::PlayData(TRequestStatus& aStatus,TInt aBufferOffset,TInt aLength,TUint aFlags)
    1.66 +	{
    1.67 +	SRequestPlayDataInfo info = {aBufferOffset,aLength,aFlags};
    1.68 +	DoRequest(EMsgRequestPlayData,aStatus,&info);
    1.69 +	}
    1.70 +	
    1.71 +inline void RSoundSc::RecordData(TRequestStatus& aStatus, TInt& aLength)
    1.72 +	{DoRequest(ERequestRecordData,aStatus,(TAny*)&aLength);}	
    1.73 +
    1.74 +inline TInt RSoundSc::ReleaseBuffer(TInt aChunkOffset)
    1.75 +	{return(DoControl(EControlReleaseBuffer,(TAny*)aChunkOffset));}
    1.76 +		
    1.77 +inline void RSoundSc::CancelPlayData()
    1.78 +	{DoCancel(1<<EMsgRequestPlayData);}
    1.79 +	
    1.80 +inline void RSoundSc::CancelRecordData()
    1.81 +	{DoCancel(1<<ERequestRecordData);}	
    1.82 +
    1.83 +inline void RSoundSc::Cancel(const TRequestStatus& aStatus)
    1.84 +	{DoControl(EMsgControlCancelSpecific,(TAny*)&aStatus);}
    1.85 +		
    1.86 +inline TInt RSoundSc::BytesTransferred()
    1.87 +	{return(DoControl(EControlBytesTransferred));}
    1.88 +	
    1.89 +inline void RSoundSc::ResetBytesTransferred()
    1.90 +	{DoControl(EControlResetBytesTransferred);}
    1.91 +	
    1.92 +inline TInt RSoundSc::Pause()
    1.93 +	{return(DoControl(EMsgControlPause));}
    1.94 +	
    1.95 +inline TInt RSoundSc::Resume()
    1.96 +	{return(DoControl(EMsgControlResume));}
    1.97 +	
    1.98 +inline void RSoundSc::NotifyChangeOfHwConfig(TRequestStatus& aStatus,TBool& aHeadsetPresent)
    1.99 +	{DoRequest(ERequestNotifyChangeOfHwConfig,aStatus,(TAny*)&aHeadsetPresent);}
   1.100 +
   1.101 +inline void RSoundSc::CancelNotifyChangeOfHwConfig()
   1.102 +	{DoCancel(1<<ERequestNotifyChangeOfHwConfig);}
   1.103 +	
   1.104 +inline TInt RSoundSc::CustomConfig(TInt aFunction,TAny* aParam)
   1.105 +	{return(DoControl(EMsgControlCustomConfig,(TAny*)aFunction,(TAny*)aParam));}
   1.106 +
   1.107 +inline TInt RSoundSc::TimePlayed(TTimeIntervalMicroSecondsBuf& aTimePlayed)
   1.108 +	{return(DoControl(EControlTimePlayed,(TAny*)&aTimePlayed));}
   1.109 +
   1.110 +inline TInt RSoundSc::TimeRecorded(TTimeIntervalMicroSecondsBuf& aTimeRecorded)
   1.111 +	{return(DoControl(EControlTimeRecorded,(TAny*)&aTimeRecorded));}
   1.112 +
   1.113 +#endif	// __KERNEL_MODE__
   1.114 +