diff -r 000000000000 -r bde4ae8d615e os/mm/devsound/devsoundapi/inc/SoundDevice.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/mm/devsound/devsoundapi/inc/SoundDevice.inl Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,196 @@ + +// SoundDevice.inl + +// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef SOUNDDEVICE_INL +#define SOUNDDEVICE_INL + +#include + +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#include +#endif + +#include + +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS +#include +#include +#endif + + +inline TInt CMMFDevSound::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData) + { + MAutoPauseResumeSupport* support = + static_cast(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface)); + if (support==NULL) + { + return KErrNotSupported; + } + if(aEventType != KMMFEventCategoryAudioResourceAvailable) + { + return KErrNotSupported; + } + else + { + return support->RegisterAsClient(aEventType, aNotificationRegistrationData); + } + } + +inline TInt CMMFDevSound::CancelRegisterAsClient(TUid aEventType) + { + MAutoPauseResumeSupport* support = + static_cast(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface)); + if (support==NULL) + { + return KErrNotSupported; + } + if(aEventType != KMMFEventCategoryAudioResourceAvailable) + { + return KErrNotSupported; + } + else + { + return support->CancelRegisterAsClient(aEventType); + } + } + +inline TInt CMMFDevSound::GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData) + { + MAutoPauseResumeSupport* support = + static_cast(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface)); + if (support==NULL) + { + return KErrNotSupported; + } + if(aEventType != KMMFEventCategoryAudioResourceAvailable) + { + return KErrNotSupported; + } + else + { + return support->GetResourceNotificationData(aEventType, aNotificationData); + } + } + +inline TInt CMMFDevSound::WillResumePlay() + { + MAutoPauseResumeSupport* support = + static_cast(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface)); + if (support==NULL) + { + return KErrNotSupported; + } + return support->WillResumePlay(); + } + +inline TInt CMMFDevSound::EmptyBuffers() + { + MMMFDevSoundEmptyBuffers* emptybuffers = + static_cast(CustomInterface(KMmfUidDevSoundEmptyBuffersCustomInterface)); + if (emptybuffers == NULL) + { + return KErrNotSupported; + } + return emptybuffers->EmptyBuffers(); + } + +inline TInt CMMFDevSound::CancelInitialize() + { + MMMFDevSoundCancelInitialize* cancelInitialize = + static_cast(CustomInterface(KMmfUidDevSoundCancelInitializeCustomInterface)); + if (cancelInitialize == NULL) + { + return KErrNotSupported; + } + return cancelInitialize->CancelInitialize(); + } + +/* + * -doxygen comments in header- + */ +inline TInt CMMFDevSound::SetClientThreadInfo(TThreadId aTid) + { + MAudioClientThreadInfo* threadInfo = + static_cast(CustomInterface(KMmfUidDevSoundAudioClientThreadInfoCustomInterface)); + if (threadInfo) + { + return threadInfo->SetClientThreadInfo(aTid); + } + else + { + return KErrNotSupported; + } + } + +inline TInt CMMFDevSound::GetTimePlayed(TTimeIntervalMicroSeconds& aTime) + { + MMMFDevSoundTimePlayed* timePlayed = + static_cast(CustomInterface(KMmfUidDevSoundTimePlayedCustomInterface)); + if (timePlayed == NULL) + { + return KErrNotSupported; + } + return timePlayed->GetTimePlayed(aTime); + } + +inline TBool CMMFDevSound::IsGetTimePlayedSupported() + { + MMMFDevSoundTimePlayed* timePlayed = + static_cast(CustomInterface(KMmfUidDevSoundTimePlayedCustomInterface)); + if (timePlayed == NULL) + { + return EFalse; + } + return ETrue; + } + +inline TBool CMMFDevSound::QueryIgnoresUnderflow() + { + MMMFDevSoundQueryIgnoresUnderflow* ignoresUnderflow = + static_cast(CustomInterface(KMmfUidDevSoundQueryIgnoresUnderflowCustomInterface)); + if (ignoresUnderflow == NULL) + { + return EFalse; + } + return ignoresUnderflow->QueryIgnoresUnderflow(); + } + +inline TBool CMMFDevSound::IsResumeSupported() + { + MMMFDevSoundTruePause* truePause = + static_cast(CustomInterface(KMmfUidDevSoundTruePauseCustomInterface)); + if (truePause == NULL) + { + return EFalse; + } + return truePause->IsResumeSupported(); + } + +inline TInt CMMFDevSound::Resume() + { + MMMFDevSoundTruePause* truePause = + static_cast(CustomInterface(KMmfUidDevSoundTruePauseCustomInterface)); + if (truePause == NULL || EFalse == truePause->IsResumeSupported() ) + { + return KErrNotSupported; + } + return truePause->Resume(); + } + +#endif // SOUNDDEVICE_INL