4 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
5 // All rights reserved.
6 // This component and the accompanying materials are made available
7 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
8 // which accompanies this distribution, and is available
9 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
11 // Initial Contributors:
12 // Nokia Corporation - initial contribution.
19 #ifndef SOUNDDEVICE_INL
20 #define SOUNDDEVICE_INL
22 #include <mmf/server/mmfdevsoundcustominterfacesupport.h>
23 #include <mmf/common/mmfstandardcustomcommands.h>
25 inline TInt CMMFDevSound::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData)
27 MAutoPauseResumeSupport* support =
28 static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
31 return KErrNotSupported;
33 if(aEventType != KMMFEventCategoryAudioResourceAvailable)
35 return KErrNotSupported;
39 return support->RegisterAsClient(aEventType, aNotificationRegistrationData);
43 inline TInt CMMFDevSound::CancelRegisterAsClient(TUid aEventType)
45 MAutoPauseResumeSupport* support =
46 static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
49 return KErrNotSupported;
51 if(aEventType != KMMFEventCategoryAudioResourceAvailable)
53 return KErrNotSupported;
57 return support->CancelRegisterAsClient(aEventType);
61 inline TInt CMMFDevSound::GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData)
63 MAutoPauseResumeSupport* support =
64 static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
67 return KErrNotSupported;
69 if(aEventType != KMMFEventCategoryAudioResourceAvailable)
71 return KErrNotSupported;
75 return support->GetResourceNotificationData(aEventType, aNotificationData);
79 inline TInt CMMFDevSound::WillResumePlay()
81 MAutoPauseResumeSupport* support =
82 static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
85 return KErrNotSupported;
87 return support->WillResumePlay();
90 inline TInt CMMFDevSound::EmptyBuffers()
92 MMMFDevSoundEmptyBuffers* emptybuffers =
93 static_cast<MMMFDevSoundEmptyBuffers*>(CustomInterface(KMmfUidDevSoundEmptyBuffersCustomInterface));
94 if (emptybuffers == NULL)
96 return KErrNotSupported;
98 return emptybuffers->EmptyBuffers();
101 inline TInt CMMFDevSound::CancelInitialize()
103 MMMFDevSoundCancelInitialize* cancelInitialize =
104 static_cast<MMMFDevSoundCancelInitialize*>(CustomInterface(KMmfUidDevSoundCancelInitializeCustomInterface));
105 if (cancelInitialize == NULL)
107 return KErrNotSupported;
109 return cancelInitialize->CancelInitialize();
113 * -doxygen comments in header-
115 inline TInt CMMFDevSound::SetClientThreadInfo(TThreadId aTid)
117 MAudioClientThreadInfo* threadInfo =
118 static_cast<MAudioClientThreadInfo*>(CustomInterface(KMmfUidDevSoundAudioClientThreadInfoCustomInterface));
121 return threadInfo->SetClientThreadInfo(aTid);
125 return KErrNotSupported;
129 inline TInt CMMFDevSound::GetTimePlayed(TTimeIntervalMicroSeconds& aTime)
131 MMMFDevSoundTimePlayed* timePlayed =
132 static_cast<MMMFDevSoundTimePlayed*>(CustomInterface(KMmfUidDevSoundTimePlayedCustomInterface));
133 if (timePlayed == NULL)
135 return KErrNotSupported;
137 return timePlayed->GetTimePlayed(aTime);
140 inline TBool CMMFDevSound::IsGetTimePlayedSupported()
142 MMMFDevSoundTimePlayed* timePlayed =
143 static_cast<MMMFDevSoundTimePlayed*>(CustomInterface(KMmfUidDevSoundTimePlayedCustomInterface));
144 if (timePlayed == NULL)
151 inline TBool CMMFDevSound::QueryIgnoresUnderflow()
153 MMMFDevSoundQueryIgnoresUnderflow* ignoresUnderflow =
154 static_cast<MMMFDevSoundQueryIgnoresUnderflow*>(CustomInterface(KMmfUidDevSoundQueryIgnoresUnderflowCustomInterface));
155 if (ignoresUnderflow == NULL)
159 return ignoresUnderflow->QueryIgnoresUnderflow();
162 inline TBool CMMFDevSound::IsResumeSupported()
164 MMMFDevSoundTruePause* truePause =
165 static_cast<MMMFDevSoundTruePause*>(CustomInterface(KMmfUidDevSoundTruePauseCustomInterface));
166 if (truePause == NULL)
170 return truePause->IsResumeSupported();
173 inline TInt CMMFDevSound::Resume()
175 MMMFDevSoundTruePause* truePause =
176 static_cast<MMMFDevSoundTruePause*>(CustomInterface(KMmfUidDevSoundTruePauseCustomInterface));
177 if (truePause == NULL || EFalse == truePause->IsResumeSupported() )
179 return KErrNotSupported;
181 return truePause->Resume();
184 #endif // SOUNDDEVICE_INL