kernel/eka/include/d32soundsc.inl
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32\include\drivers\d32soundsc.inl
       
    15 // User side inline header file for the shared chunk sound driver.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @publishedPartner
       
    22  @prototype
       
    23 */
       
    24 
       
    25 inline TVersion RSoundSc::VersionRequired()
       
    26 	{
       
    27 	const TInt KSoundScMajorVersionNumber=1;
       
    28 	const TInt KSoundScMinorVersionNumber=0;
       
    29 	const TInt KSoundScBuildVersionNumber=KE32BuildVersionNumber;
       
    30 	return TVersion(KSoundScMajorVersionNumber,KSoundScMinorVersionNumber,KSoundScBuildVersionNumber);
       
    31 	}
       
    32 
       
    33 #ifndef __KERNEL_MODE__
       
    34 
       
    35 inline TInt RSoundSc::Open(TInt aUnit)
       
    36 	{return(DoCreate(KDevSoundScName,VersionRequired(),aUnit,NULL,NULL,EOwnerProcess));}
       
    37 	
       
    38 inline void RSoundSc::Caps(TDes8& aCapsBuf)
       
    39 	{DoControl(EControlGetCaps,(TAny*)&aCapsBuf);}
       
    40 	
       
    41 inline void RSoundSc::AudioFormat(TDes8& aFormatBuf)
       
    42 	{DoControl(EControlGetAudioFormat,(TAny*)&aFormatBuf);}
       
    43 	
       
    44 inline TInt RSoundSc::SetAudioFormat(const TDesC8& aFormatBuf)
       
    45 	{return(DoControl(EMsgControlSetAudioFormat,(TAny*)&aFormatBuf));}
       
    46 
       
    47 inline void RSoundSc::GetBufferConfig(TDes8& aConfigBuf)
       
    48 	{DoControl(EControlGetBufConfig,(TAny*)&aConfigBuf);}
       
    49  	
       
    50 inline TInt RSoundSc::SetBufferChunkCreate(const TDesC8& aConfigBuf,RChunk& aChunk)
       
    51  	{return(aChunk.SetReturnedHandle(DoControl(EMsgControlSetBufChunkCreate,(TAny*)&aConfigBuf)));}
       
    52  		
       
    53 inline TInt RSoundSc::SetBufferChunkOpen(const TDesC8& aConfigBuf,RChunk& aChunk)
       
    54  	{return(DoControl(EMsgControlSetBufChunkOpen,(TAny*)&aConfigBuf,(TAny*)aChunk.Handle()));}
       
    55  	
       
    56 inline TInt RSoundSc::Volume()
       
    57 	{return(DoControl(EControlGetVolume));}
       
    58 	
       
    59 inline TInt RSoundSc::SetVolume(TInt aVolume)
       
    60 	{return(DoControl(EMsgControlSetVolume,(TAny*)aVolume));}
       
    61 	
       
    62 inline void RSoundSc::PlayData(TRequestStatus& aStatus,TInt aBufferOffset,TInt aLength,TUint aFlags)
       
    63 	{
       
    64 	SRequestPlayDataInfo info = {aBufferOffset,aLength,aFlags};
       
    65 	DoRequest(EMsgRequestPlayData,aStatus,&info);
       
    66 	}
       
    67 	
       
    68 inline void RSoundSc::RecordData(TRequestStatus& aStatus, TInt& aLength)
       
    69 	{DoRequest(ERequestRecordData,aStatus,(TAny*)&aLength);}	
       
    70 
       
    71 inline TInt RSoundSc::ReleaseBuffer(TInt aChunkOffset)
       
    72 	{return(DoControl(EControlReleaseBuffer,(TAny*)aChunkOffset));}
       
    73 		
       
    74 inline void RSoundSc::CancelPlayData()
       
    75 	{DoCancel(1<<EMsgRequestPlayData);}
       
    76 	
       
    77 inline void RSoundSc::CancelRecordData()
       
    78 	{DoCancel(1<<ERequestRecordData);}	
       
    79 
       
    80 inline void RSoundSc::Cancel(const TRequestStatus& aStatus)
       
    81 	{DoControl(EMsgControlCancelSpecific,(TAny*)&aStatus);}
       
    82 		
       
    83 inline TInt RSoundSc::BytesTransferred()
       
    84 	{return(DoControl(EControlBytesTransferred));}
       
    85 	
       
    86 inline void RSoundSc::ResetBytesTransferred()
       
    87 	{DoControl(EControlResetBytesTransferred);}
       
    88 	
       
    89 inline TInt RSoundSc::Pause()
       
    90 	{return(DoControl(EMsgControlPause));}
       
    91 	
       
    92 inline TInt RSoundSc::Resume()
       
    93 	{return(DoControl(EMsgControlResume));}
       
    94 	
       
    95 inline void RSoundSc::NotifyChangeOfHwConfig(TRequestStatus& aStatus,TBool& aHeadsetPresent)
       
    96 	{DoRequest(ERequestNotifyChangeOfHwConfig,aStatus,(TAny*)&aHeadsetPresent);}
       
    97 
       
    98 inline void RSoundSc::CancelNotifyChangeOfHwConfig()
       
    99 	{DoCancel(1<<ERequestNotifyChangeOfHwConfig);}
       
   100 	
       
   101 inline TInt RSoundSc::CustomConfig(TInt aFunction,TAny* aParam)
       
   102 	{return(DoControl(EMsgControlCustomConfig,(TAny*)aFunction,(TAny*)aParam));}
       
   103 
       
   104 inline TInt RSoundSc::TimePlayed(TTimeIntervalMicroSecondsBuf& aTimePlayed)
       
   105 	{return(DoControl(EControlTimePlayed,(TAny*)&aTimePlayed));}
       
   106 
       
   107 inline TInt RSoundSc::TimeRecorded(TTimeIntervalMicroSecondsBuf& aTimeRecorded)
       
   108 	{return(DoControl(EControlTimeRecorded,(TAny*)&aTimeRecorded));}
       
   109 
       
   110 #endif	// __KERNEL_MODE__
       
   111