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