williamr@2: williamr@2: // MmfDevSoundCustomInterfaceSupport.h williamr@2: williamr@2: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef MMFDEVSOUNDCUSTOMINTERFACESUPPORT_H williamr@2: #define MMFDEVSOUNDCUSTOMINTERFACESUPPORT_H williamr@2: williamr@2: const TUid KMmfUidDevSoundAudioResourceCustomInterface = {0x101FD9F3}; williamr@2: const TUid KMmfUidDevSoundEmptyBuffersCustomInterface = {0x1027379c}; williamr@2: const TUid KMmfUidDevSoundCancelInitializeCustomInterface = {0x102834D3}; williamr@2: const TUid KMmfUidDevSoundAudioClientThreadInfoCustomInterface = {0x102834A7}; williamr@2: williamr@2: /** williamr@2: @publishedAll williamr@2: @released williamr@2: williamr@2: Custom Interface providing support for AutoPauseResume Register, Cancel, GetResourceNotificationData and WillResumePlay. williamr@2: */ williamr@2: williamr@2: class MAutoPauseResumeSupport williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Registers the event for notification when resource is avaliable. williamr@2: williamr@2: @param aEventType williamr@2: The event which the client is notified of. williamr@2: williamr@2: @param aNotificationRegistrationData williamr@2: Notification registration specific data, which has been reserved for future use. williamr@2: williamr@2: @return An error code indicating if the function call was successful. KErrNone on success, otherwise williamr@2: another of the system-wide error codes. williamr@2: */ williamr@2: virtual TInt RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData = KNullDesC8)=0; williamr@2: williamr@2: /** williamr@2: Cancels the registered notification event. williamr@2: williamr@2: @param aEventType williamr@2: The event to notify the client. williamr@2: williamr@2: @return An error code indicating if the function call was successful. KErrNone on success, otherwise williamr@2: another of the system-wide error codes. williamr@2: */ williamr@2: virtual TInt CancelRegisterAsClient(TUid aEventType)=0; williamr@2: /** williamr@2: Gets the notification data for the event. williamr@2: williamr@2: @param aEventType williamr@2: The event which the client is notified of. williamr@2: williamr@2: @param aNotificationData williamr@2: The notification data for the client to resume playing. The actual data depends on the event type. williamr@2: Note that for the event type 'KMMFEventCategoryAudioResourceAvailable' the package buffer returned williamr@2: is TMMFTimeIntervalMicroSecondsPckg, but the contents should be converted to an integer and williamr@2: interpreted as the data returned is samples played, but not as a microsecond value. williamr@2: williamr@2: @return An error code indicating if the function call was successful. KErrNone on success, otherwise williamr@2: another of the system-wide error codes. williamr@2: */ williamr@2: virtual TInt GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData)=0; williamr@2: /** williamr@2: Waits for the client to resume the play even after the default timer expires. williamr@2: williamr@2: @return An error code indicating if the function call was successful. KErrNone on success, otherwise williamr@2: another of the system-wide error codes. williamr@2: */ williamr@2: virtual TInt WillResumePlay()=0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @publishedPartner williamr@2: @prototype williamr@2: williamr@2: Custom Interface class providing support for emptying the play buffers. williamr@2: */ williamr@2: class MMMFDevSoundEmptyBuffers williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: Empties the play buffers below DevSound without causing the codec to be deleted. williamr@2: williamr@2: @return An error code indicating if the function call was successful. KErrNone on success, KErrNotSupported williamr@2: if called in record mode, otherwise another of the system-wide error codes. williamr@2: */ williamr@2: virtual TInt EmptyBuffers() = 0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @publishedPartner williamr@2: @prototype williamr@2: williamr@2: Custom Interface class providing support for canceling initialization. williamr@2: */ williamr@2: class MMMFDevSoundCancelInitialize williamr@2: { williamr@2: public: williamr@2: williamr@2: /** Cancels the initialization process of a CMMFDevSound object williamr@2: williamr@2: @return An error code indicating if the function call was successful. williamr@2: KErrNone on success, williamr@2: KerrNotReady if this is called before InitializeL() call or after williamr@2: the object has been initialized, williamr@2: */ williamr@2: virtual TInt CancelInitialize() = 0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @internalComponent williamr@2: williamr@2: The class is a mixin and is intended to support for closing the Mux and Demux pair in a williamr@2: DevSound Custom Interface. The function encapsulated by this class is called whenever the williamr@2: MMMFDevSoundCustomInterfaceDeMuxPlugin::RefreshL method leaves. williamr@2: */ williamr@2: class MMMFDevSoundCustomInterfaceObserver williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: Closes the Mux and Demux pair of a DevSound Custom Interface. williamr@2: */ williamr@2: virtual void CloseCustomInterface(TInt aIndex) = 0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: @publishedPartner williamr@2: @released williamr@2: williamr@2: Custom Interface class providing support for setting the client thread info for devsound. williamr@2: */ williamr@2: class MAudioClientThreadInfo williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Set client thread info for devsound if plugin implementation requires this info williamr@2: williamr@2: @param aTid the required thread Id williamr@2: @return An error code indicating if the function call was successful. williamr@2: williamr@2: @capability MultimediaDD williamr@2: A process requires MultimediaDD capability to make this call. williamr@2: */ williamr@2: virtual TInt SetClientThreadInfo(TThreadId aTid) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFDevSoundGetTimePlayed williamr@2: williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: const TUid KMmfUidDevSoundTimePlayedCustomInterface = {0x10285CE4}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to querying current play time from DevSound. williamr@2: williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: class MMMFDevSoundTimePlayed williamr@2: { williamr@2: public: williamr@2: /** Retrieves the current play time from the audio renderer. williamr@2: @param aTime williamr@2: A reference to TTimeIntervalMicroSeconds object which will be filled with the current play time by this function. williamr@2: @return An error code indicating if the function call was successful. williamr@2: KErrNone on success, williamr@2: KErrNotSupported if the underlying HwDevice does not support this custominterface williamr@2: */ williamr@2: virtual TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime) = 0; williamr@2: }; williamr@2: williamr@2: /*****************************************************************************/ williamr@2: /** williamr@2: UID associated with the Custom interface MMMFDevSoundQueryIgnoresUnderflow williamr@2: williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: const TUid KMmfUidDevSoundQueryIgnoresUnderflowCustomInterface = {0x10285E7B}; williamr@2: williamr@2: /** williamr@2: This class provides an interface for querying DevSound whether it ignores the underflow errors from the sound driver. williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: class MMMFDevSoundQueryIgnoresUnderflow williamr@2: { williamr@2: public: williamr@2: /** Queries the devsound whether it ignores the underflow errors from the sound driver williamr@2: @return ETrue if the devsound ignores all the underflow errors from the sound driver except for the last buffer. That means DevSound williamr@2: propagates the underflow error from sound driver to its clients only when client sets the last buffer flag on the CMMFBuffer type buffer. williamr@2: EFalse if devsound propagates the underflow errors from the sound driver in all the cases williamr@2: */ williamr@2: virtual TBool QueryIgnoresUnderflow() = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: const TUid KMmfUidDevSoundTruePauseCustomInterface = {0x1028643E}; williamr@2: williamr@2: /** williamr@2: This class provides an interface to be able to Resume from DevSound. williamr@2: @publishedPartner williamr@2: @release williamr@2: */ williamr@2: class MMMFDevSoundTruePause williamr@2: { williamr@2: public: williamr@2: /** Queries the devsound whether it supports True Pause or not williamr@2: This call is only valid when DevSound is initialized williamr@2: @return ETrue if the current DevSound configuration does support this feature williamr@2: EFalse otherwise williamr@2: */ williamr@2: virtual TBool IsResumeSupported() = 0; williamr@2: williamr@2: /** Resume the playback, recording or tone playing that was paused williamr@2: @return An error code indicating if the function call was successful. williamr@2: KErrNone on success, williamr@2: KErrNotReady when is DevSound is not in pause williamr@2: KErrNotSupported if the DevSound configuration does support this feature williamr@2: */ williamr@2: virtual TInt Resume() = 0; williamr@2: }; williamr@2: williamr@2: williamr@2: #endif // MMFDEVSOUNDCUSTOMINTERFACESUPPORT_H