Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32\include\drivers\d32soundsc.inl
15 // User side inline header file for the shared chunk sound driver.
25 inline TVersion RSoundSc::VersionRequired()
27 const TInt KSoundScMajorVersionNumber=1;
28 const TInt KSoundScMinorVersionNumber=0;
29 const TInt KSoundScBuildVersionNumber=KE32BuildVersionNumber;
30 return TVersion(KSoundScMajorVersionNumber,KSoundScMinorVersionNumber,KSoundScBuildVersionNumber);
33 #ifndef __KERNEL_MODE__
35 inline TInt RSoundSc::Open(TInt aUnit)
36 {return(DoCreate(KDevSoundScName,VersionRequired(),aUnit,NULL,NULL,EOwnerProcess));}
38 inline void RSoundSc::Caps(TDes8& aCapsBuf)
39 {DoControl(EControlGetCaps,(TAny*)&aCapsBuf);}
41 inline void RSoundSc::AudioFormat(TDes8& aFormatBuf)
42 {DoControl(EControlGetAudioFormat,(TAny*)&aFormatBuf);}
44 inline TInt RSoundSc::SetAudioFormat(const TDesC8& aFormatBuf)
45 {return(DoControl(EMsgControlSetAudioFormat,(TAny*)&aFormatBuf));}
47 inline void RSoundSc::GetBufferConfig(TDes8& aConfigBuf)
48 {DoControl(EControlGetBufConfig,(TAny*)&aConfigBuf);}
50 inline TInt RSoundSc::SetBufferChunkCreate(const TDesC8& aConfigBuf,RChunk& aChunk)
51 {return(aChunk.SetReturnedHandle(DoControl(EMsgControlSetBufChunkCreate,(TAny*)&aConfigBuf)));}
53 inline TInt RSoundSc::SetBufferChunkOpen(const TDesC8& aConfigBuf,RChunk& aChunk)
54 {return(DoControl(EMsgControlSetBufChunkOpen,(TAny*)&aConfigBuf,(TAny*)aChunk.Handle()));}
56 inline TInt RSoundSc::Volume()
57 {return(DoControl(EControlGetVolume));}
59 inline TInt RSoundSc::SetVolume(TInt aVolume)
60 {return(DoControl(EMsgControlSetVolume,(TAny*)aVolume));}
62 inline void RSoundSc::PlayData(TRequestStatus& aStatus,TInt aBufferOffset,TInt aLength,TUint aFlags)
64 SRequestPlayDataInfo info = {aBufferOffset,aLength,aFlags};
65 DoRequest(EMsgRequestPlayData,aStatus,&info);
68 inline void RSoundSc::RecordData(TRequestStatus& aStatus, TInt& aLength)
69 {DoRequest(ERequestRecordData,aStatus,(TAny*)&aLength);}
71 inline TInt RSoundSc::ReleaseBuffer(TInt aChunkOffset)
72 {return(DoControl(EControlReleaseBuffer,(TAny*)aChunkOffset));}
74 inline void RSoundSc::CancelPlayData()
75 {DoCancel(1<<EMsgRequestPlayData);}
77 inline void RSoundSc::CancelRecordData()
78 {DoCancel(1<<ERequestRecordData);}
80 inline void RSoundSc::Cancel(const TRequestStatus& aStatus)
81 {DoControl(EMsgControlCancelSpecific,(TAny*)&aStatus);}
83 inline TInt RSoundSc::BytesTransferred()
84 {return(DoControl(EControlBytesTransferred));}
86 inline void RSoundSc::ResetBytesTransferred()
87 {DoControl(EControlResetBytesTransferred);}
89 inline TInt RSoundSc::Pause()
90 {return(DoControl(EMsgControlPause));}
92 inline TInt RSoundSc::Resume()
93 {return(DoControl(EMsgControlResume));}
95 inline void RSoundSc::NotifyChangeOfHwConfig(TRequestStatus& aStatus,TBool& aHeadsetPresent)
96 {DoRequest(ERequestNotifyChangeOfHwConfig,aStatus,(TAny*)&aHeadsetPresent);}
98 inline void RSoundSc::CancelNotifyChangeOfHwConfig()
99 {DoCancel(1<<ERequestNotifyChangeOfHwConfig);}
101 inline TInt RSoundSc::CustomConfig(TInt aFunction,TAny* aParam)
102 {return(DoControl(EMsgControlCustomConfig,(TAny*)aFunction,(TAny*)aParam));}
104 inline TInt RSoundSc::TimePlayed(TTimeIntervalMicroSecondsBuf& aTimePlayed)
105 {return(DoControl(EControlTimePlayed,(TAny*)&aTimePlayed));}
107 inline TInt RSoundSc::TimeRecorded(TTimeIntervalMicroSecondsBuf& aTimeRecorded)
108 {return(DoControl(EControlTimeRecorded,(TAny*)&aTimeRecorded));}
110 #endif // __KERNEL_MODE__