epoc32/include/mmf/server/sounddevice.inl
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 
     2 // SoundDevice.inl
     3 
     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".
    10 //
    11 // Initial Contributors:
    12 // Nokia Corporation - initial contribution.
    13 //
    14 // Contributors:
    15 //
    16 // Description:
    17 //
    18 
    19 #ifndef SOUNDDEVICE_INL
    20 #define SOUNDDEVICE_INL
    21 
    22 #include <mmf/server/mmfdevsoundcustominterfacesupport.h>
    23 #include <mmf/common/mmfstandardcustomcommands.h>
    24 
    25 inline TInt CMMFDevSound::RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData)
    26 	{
    27 	MAutoPauseResumeSupport* support = 
    28 				static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
    29 	if (support==NULL)
    30 		{
    31 		return KErrNotSupported;
    32 		}
    33 	if(aEventType != KMMFEventCategoryAudioResourceAvailable)
    34 		{
    35 		return KErrNotSupported;
    36 		}
    37 	else
    38 		{ 
    39 		return support->RegisterAsClient(aEventType, aNotificationRegistrationData);	
    40 		}
    41 	}
    42 
    43 inline TInt CMMFDevSound::CancelRegisterAsClient(TUid aEventType)
    44 	{
    45 	MAutoPauseResumeSupport* support = 
    46 			static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
    47 	if (support==NULL)
    48 		{
    49 		return KErrNotSupported;
    50 		}
    51 	if(aEventType != KMMFEventCategoryAudioResourceAvailable)
    52 		{
    53 		return KErrNotSupported;
    54 		}
    55 	else
    56 		{
    57 		return support->CancelRegisterAsClient(aEventType);
    58 		}
    59 	}
    60 
    61 inline TInt CMMFDevSound::GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData)
    62 	{
    63 	MAutoPauseResumeSupport* support = 
    64 			static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
    65 	if (support==NULL)
    66 		{
    67 		return KErrNotSupported;
    68 		}
    69 	if(aEventType != KMMFEventCategoryAudioResourceAvailable)
    70 		{
    71 		return KErrNotSupported;
    72 		}
    73 	else
    74 		{
    75 		return support->GetResourceNotificationData(aEventType, aNotificationData);
    76 		}
    77 	}
    78 
    79 inline TInt CMMFDevSound::WillResumePlay()
    80 	{
    81 	MAutoPauseResumeSupport* support = 
    82 			static_cast<MAutoPauseResumeSupport*>(CustomInterface(KMmfUidDevSoundAudioResourceCustomInterface));
    83 	if (support==NULL)
    84 		{
    85 		return KErrNotSupported;
    86 		}
    87 	return support->WillResumePlay();
    88 	}
    89 
    90 inline TInt CMMFDevSound::EmptyBuffers()
    91 	{
    92 	MMMFDevSoundEmptyBuffers* emptybuffers = 
    93 			static_cast<MMMFDevSoundEmptyBuffers*>(CustomInterface(KMmfUidDevSoundEmptyBuffersCustomInterface));
    94 	if (emptybuffers == NULL)
    95 		{
    96 		return KErrNotSupported;
    97 		}
    98 	return emptybuffers->EmptyBuffers();
    99 	}
   100 
   101 inline TInt CMMFDevSound::CancelInitialize()
   102 	{
   103 	MMMFDevSoundCancelInitialize* cancelInitialize = 
   104 			static_cast<MMMFDevSoundCancelInitialize*>(CustomInterface(KMmfUidDevSoundCancelInitializeCustomInterface));
   105 	if (cancelInitialize == NULL)
   106 		{
   107 		return KErrNotSupported;
   108 		}
   109 	return cancelInitialize->CancelInitialize();
   110 	}
   111 
   112 /*
   113  *  -doxygen comments in header-
   114  */
   115 inline TInt CMMFDevSound::SetClientThreadInfo(TThreadId aTid)
   116 	{
   117 	MAudioClientThreadInfo* threadInfo = 
   118 			static_cast<MAudioClientThreadInfo*>(CustomInterface(KMmfUidDevSoundAudioClientThreadInfoCustomInterface));
   119 	if (threadInfo)
   120 		{
   121 		return threadInfo->SetClientThreadInfo(aTid);
   122 		}
   123 	else
   124 		{
   125 		return KErrNotSupported;
   126 		}
   127 	}
   128 
   129 inline TInt CMMFDevSound::GetTimePlayed(TTimeIntervalMicroSeconds& aTime)
   130 	{
   131 	MMMFDevSoundTimePlayed* timePlayed = 
   132 			static_cast<MMMFDevSoundTimePlayed*>(CustomInterface(KMmfUidDevSoundTimePlayedCustomInterface));
   133 	if (timePlayed == NULL)
   134 		{
   135 		return KErrNotSupported;
   136 		}
   137 	return timePlayed->GetTimePlayed(aTime);
   138 	}
   139 
   140 inline TBool CMMFDevSound::IsGetTimePlayedSupported()
   141 	{
   142 	MMMFDevSoundTimePlayed* timePlayed = 
   143 			static_cast<MMMFDevSoundTimePlayed*>(CustomInterface(KMmfUidDevSoundTimePlayedCustomInterface));
   144 	if (timePlayed == NULL)
   145 		{
   146 		return EFalse;
   147 		}
   148 	return ETrue;
   149 	}
   150 
   151 inline TBool CMMFDevSound::QueryIgnoresUnderflow()
   152 	{
   153 	MMMFDevSoundQueryIgnoresUnderflow* ignoresUnderflow = 
   154 			static_cast<MMMFDevSoundQueryIgnoresUnderflow*>(CustomInterface(KMmfUidDevSoundQueryIgnoresUnderflowCustomInterface));
   155 	if (ignoresUnderflow == NULL)
   156 		{
   157 		return EFalse;
   158 		}
   159 	return ignoresUnderflow->QueryIgnoresUnderflow();
   160 	}
   161 
   162 inline TBool CMMFDevSound::IsResumeSupported()
   163 	{
   164 	MMMFDevSoundTruePause* truePause = 
   165 			static_cast<MMMFDevSoundTruePause*>(CustomInterface(KMmfUidDevSoundTruePauseCustomInterface));
   166 	if (truePause == NULL)
   167 		{
   168 		return EFalse;
   169 		}
   170 	return truePause->IsResumeSupported();
   171 	}
   172 
   173 inline TInt CMMFDevSound::Resume()
   174 	{
   175 	MMMFDevSoundTruePause* truePause = 
   176 			static_cast<MMMFDevSoundTruePause*>(CustomInterface(KMmfUidDevSoundTruePauseCustomInterface));
   177 	if (truePause == NULL || EFalse == truePause->IsResumeSupported() )
   178 		{
   179 		return KErrNotSupported;
   180 		}
   181 	return truePause->Resume();
   182 	}
   183 
   184 #endif // SOUNDDEVICE_INL