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 "Eclipse Public License v1.0"
8 // which accompanies this distribution, and is available
9 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
11 // Initial Contributors:
12 // Nokia Corporation - initial contribution.
19 #ifndef SOUNDDEVICE_INL
20 #define SOUNDDEVICE_INL
22 #include <mmf/server/mmfdevsoundcustominterfacesupport.h>
24 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
25 #include <mmf/server/mmfdevsoundcustominterfaceobserver.h>
26 #include <mmf/server/mmfdevsoundcustominterfacesupportclasses.h>
29 #include <mmf/common/mmfstandardcustomcommands.h>
31 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
32 #include <mmf/common/mmfstandardcustomcommandsenums.h>
33 #include <mmf/common/mmfstandardcustomcommandsimpl.h>
37 inline TInt CMMFDevSound::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData)
39 MAutoPauseResumeSupport* support =
40 static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
43 return KErrNotSupported;
45 if(aEventType != KMMFEventCategoryAudioResourceAvailable)
47 return KErrNotSupported;
51 return support->RegisterAsClient(aEventType, aNotificationRegistrationData);
55 inline TInt CMMFDevSound::CancelRegisterAsClient(TUid aEventType)
57 MAutoPauseResumeSupport* support =
58 static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
61 return KErrNotSupported;
63 if(aEventType != KMMFEventCategoryAudioResourceAvailable)
65 return KErrNotSupported;
69 return support->CancelRegisterAsClient(aEventType);
73 inline TInt CMMFDevSound::GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData)
75 MAutoPauseResumeSupport* support =
76 static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
79 return KErrNotSupported;
81 if(aEventType != KMMFEventCategoryAudioResourceAvailable)
83 return KErrNotSupported;
87 return support->GetResourceNotificationData(aEventType, aNotificationData);
91 inline TInt CMMFDevSound::WillResumePlay()
93 MAutoPauseResumeSupport* support =
94 static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
97 return KErrNotSupported;
99 return support->WillResumePlay();
102 inline TInt CMMFDevSound::EmptyBuffers()
104 MMMFDevSoundEmptyBuffers* emptybuffers =
105 static_cast<MMMFDevSoundEmptyBuffers*>(CustomInterface(KMmfUidDevSoundEmptyBuffersCustomInterface));
106 if (emptybuffers == NULL)
108 return KErrNotSupported;
110 return emptybuffers->EmptyBuffers();
113 inline TInt CMMFDevSound::CancelInitialize()
115 MMMFDevSoundCancelInitialize* cancelInitialize =
116 static_cast<MMMFDevSoundCancelInitialize*>(CustomInterface(KMmfUidDevSoundCancelInitializeCustomInterface));
117 if (cancelInitialize == NULL)
119 return KErrNotSupported;
121 return cancelInitialize->CancelInitialize();
125 * -doxygen comments in header-
127 inline TInt CMMFDevSound::SetClientThreadInfo(TThreadId aTid)
129 MAudioClientThreadInfo* threadInfo =
130 static_cast<MAudioClientThreadInfo*>(CustomInterface(KMmfUidDevSoundAudioClientThreadInfoCustomInterface));
133 return threadInfo->SetClientThreadInfo(aTid);
137 return KErrNotSupported;
141 inline TInt CMMFDevSound::GetTimePlayed(TTimeIntervalMicroSeconds& aTime)
143 MMMFDevSoundTimePlayed* timePlayed =
144 static_cast<MMMFDevSoundTimePlayed*>(CustomInterface(KMmfUidDevSoundTimePlayedCustomInterface));
145 if (timePlayed == NULL)
147 return KErrNotSupported;
149 return timePlayed->GetTimePlayed(aTime);
152 inline TBool CMMFDevSound::IsGetTimePlayedSupported()
154 MMMFDevSoundTimePlayed* timePlayed =
155 static_cast<MMMFDevSoundTimePlayed*>(CustomInterface(KMmfUidDevSoundTimePlayedCustomInterface));
156 if (timePlayed == NULL)
163 inline TBool CMMFDevSound::QueryIgnoresUnderflow()
165 MMMFDevSoundQueryIgnoresUnderflow* ignoresUnderflow =
166 static_cast<MMMFDevSoundQueryIgnoresUnderflow*>(CustomInterface(KMmfUidDevSoundQueryIgnoresUnderflowCustomInterface));
167 if (ignoresUnderflow == NULL)
171 return ignoresUnderflow->QueryIgnoresUnderflow();
174 inline TBool CMMFDevSound::IsResumeSupported()
176 MMMFDevSoundTruePause* truePause =
177 static_cast<MMMFDevSoundTruePause*>(CustomInterface(KMmfUidDevSoundTruePauseCustomInterface));
178 if (truePause == NULL)
182 return truePause->IsResumeSupported();
185 inline TInt CMMFDevSound::Resume()
187 MMMFDevSoundTruePause* truePause =
188 static_cast<MMMFDevSoundTruePause*>(CustomInterface(KMmfUidDevSoundTruePauseCustomInterface));
189 if (truePause == NULL || EFalse == truePause->IsResumeSupported() )
191 return KErrNotSupported;
193 return truePause->Resume();
196 #endif // SOUNDDEVICE_INL