epoc32/include/mmf/server/mmfdevsoundcustominterfacesupport.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
williamr@2
     2
// MmfDevSoundCustomInterfaceSupport.h
williamr@2
     3
williamr@2
     4
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     5
// All rights reserved.
williamr@2
     6
// This component and the accompanying materials are made available
williamr@2
     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
williamr@2
     8
// which accompanies this distribution, and is available
williamr@2
     9
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
    10
//
williamr@2
    11
// Initial Contributors:
williamr@2
    12
// Nokia Corporation - initial contribution.
williamr@2
    13
//
williamr@2
    14
// Contributors:
williamr@2
    15
//
williamr@2
    16
// Description:
williamr@2
    17
//
williamr@2
    18
williamr@2
    19
#ifndef MMFDEVSOUNDCUSTOMINTERFACESUPPORT_H
williamr@2
    20
#define MMFDEVSOUNDCUSTOMINTERFACESUPPORT_H
williamr@2
    21
williamr@2
    22
const TUid KMmfUidDevSoundAudioResourceCustomInterface = {0x101FD9F3};
williamr@2
    23
const TUid KMmfUidDevSoundEmptyBuffersCustomInterface = {0x1027379c};
williamr@2
    24
const TUid KMmfUidDevSoundCancelInitializeCustomInterface = {0x102834D3};
williamr@2
    25
const TUid KMmfUidDevSoundAudioClientThreadInfoCustomInterface = {0x102834A7};
williamr@2
    26
williamr@2
    27
/**
williamr@2
    28
@publishedAll
williamr@2
    29
@released
williamr@2
    30
williamr@2
    31
Custom Interface providing support for AutoPauseResume Register, Cancel, GetResourceNotificationData and WillResumePlay.
williamr@2
    32
*/
williamr@2
    33
williamr@2
    34
class MAutoPauseResumeSupport
williamr@2
    35
	{
williamr@2
    36
public:
williamr@2
    37
	/**
williamr@2
    38
	Registers the event for notification when resource is avaliable.
williamr@2
    39
williamr@2
    40
	@param aEventType
williamr@2
    41
		The event which the client is notified of.
williamr@2
    42
		
williamr@2
    43
	@param aNotificationRegistrationData
williamr@2
    44
		Notification registration specific data, which has been reserved for future use.
williamr@2
    45
williamr@2
    46
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
    47
	        another of the system-wide error codes.
williamr@2
    48
	*/
williamr@2
    49
	virtual TInt RegisterAsClient(TUid aEventType, const TDesC8& aNotificationRegistrationData = KNullDesC8)=0;
williamr@2
    50
	
williamr@2
    51
	/**
williamr@2
    52
	Cancels the registered notification event.
williamr@2
    53
williamr@2
    54
	@param  aEventType
williamr@2
    55
		The event to notify the client.
williamr@2
    56
williamr@2
    57
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
    58
	        another of the system-wide error codes.
williamr@2
    59
	*/
williamr@2
    60
	virtual TInt CancelRegisterAsClient(TUid aEventType)=0;
williamr@2
    61
	/**
williamr@2
    62
	Gets the notification data for the event.
williamr@2
    63
	
williamr@2
    64
	@param  aEventType
williamr@2
    65
		The event which the client is notified of.
williamr@2
    66
		
williamr@2
    67
	@param aNotificationData
williamr@2
    68
		The notification data for the client to resume playing. The actual data depends on the event type.
williamr@2
    69
		Note that for the event type 'KMMFEventCategoryAudioResourceAvailable' the package buffer returned
williamr@2
    70
		is TMMFTimeIntervalMicroSecondsPckg, but the contents should be converted to an integer and
williamr@2
    71
		interpreted as the data returned is samples played, but not as a microsecond value.
williamr@2
    72
williamr@2
    73
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
    74
	        another of the system-wide error codes.
williamr@2
    75
	*/
williamr@2
    76
	virtual TInt GetResourceNotificationData(TUid aEventType,TDes8& aNotificationData)=0;
williamr@2
    77
	/**
williamr@2
    78
	Waits for the client to resume the play even after the default timer expires.
williamr@2
    79
williamr@2
    80
	@return An error code indicating if the function call was successful. KErrNone on success, otherwise
williamr@2
    81
	        another of the system-wide error codes.
williamr@2
    82
	*/
williamr@2
    83
	virtual TInt WillResumePlay()=0;
williamr@2
    84
	};
williamr@2
    85
williamr@2
    86
/**
williamr@2
    87
@publishedPartner
williamr@2
    88
@prototype
williamr@2
    89
williamr@2
    90
Custom Interface class providing support for emptying the play buffers.
williamr@2
    91
*/
williamr@2
    92
class MMMFDevSoundEmptyBuffers
williamr@2
    93
	{	
williamr@2
    94
public:
williamr@2
    95
	
williamr@2
    96
	/**
williamr@2
    97
	Empties the play buffers below DevSound without causing the codec to be deleted.
williamr@2
    98
williamr@2
    99
	@return An error code indicating if the function call was successful. KErrNone on success, KErrNotSupported 
williamr@2
   100
			if called in record mode, otherwise another of the system-wide error codes.
williamr@2
   101
	*/
williamr@2
   102
	virtual TInt EmptyBuffers() = 0;
williamr@2
   103
	};	
williamr@2
   104
williamr@2
   105
/**
williamr@2
   106
@publishedPartner
williamr@2
   107
@prototype
williamr@2
   108
williamr@2
   109
Custom Interface class providing support for canceling initialization.
williamr@2
   110
*/
williamr@2
   111
class MMMFDevSoundCancelInitialize
williamr@2
   112
	{	
williamr@2
   113
public:
williamr@2
   114
	
williamr@2
   115
	/** Cancels the initialization process of a CMMFDevSound object
williamr@2
   116
williamr@2
   117
	@return An error code indicating if the function call was successful. 
williamr@2
   118
			KErrNone on success,
williamr@2
   119
			KerrNotReady if this is called before InitializeL() call or after      
williamr@2
   120
			the object has been initialized, 
williamr@2
   121
	*/
williamr@2
   122
	virtual TInt CancelInitialize() = 0;
williamr@2
   123
	};	
williamr@2
   124
williamr@2
   125
/**
williamr@2
   126
@internalComponent
williamr@2
   127
williamr@2
   128
The class is a mixin and is intended to support for closing the Mux and Demux pair in a
williamr@2
   129
DevSound Custom Interface. The function encapsulated by this class is called whenever the 
williamr@2
   130
MMMFDevSoundCustomInterfaceDeMuxPlugin::RefreshL method leaves.
williamr@2
   131
*/
williamr@2
   132
class MMMFDevSoundCustomInterfaceObserver
williamr@2
   133
	{	
williamr@2
   134
public:
williamr@2
   135
	
williamr@2
   136
	/**
williamr@2
   137
	Closes the Mux and Demux pair of a DevSound Custom Interface.
williamr@2
   138
	*/
williamr@2
   139
	virtual void CloseCustomInterface(TInt aIndex) = 0;
williamr@2
   140
	};	
williamr@2
   141
williamr@2
   142
/**
williamr@2
   143
@publishedPartner
williamr@2
   144
@released
williamr@2
   145
williamr@2
   146
Custom Interface class providing support for setting the client thread info for devsound.
williamr@2
   147
*/
williamr@2
   148
class MAudioClientThreadInfo
williamr@2
   149
	{	
williamr@2
   150
public:
williamr@2
   151
	/**
williamr@2
   152
	Set client thread info for devsound if plugin implementation requires this info
williamr@2
   153
	
williamr@2
   154
	@param  aTid the required thread Id
williamr@2
   155
	@return An error code indicating if the function call was successful.
williamr@2
   156
williamr@2
   157
	@capability MultimediaDD
williamr@2
   158
		A process requires MultimediaDD capability to make this call. 
williamr@2
   159
	*/
williamr@2
   160
	virtual TInt SetClientThreadInfo(TThreadId aTid) = 0;
williamr@2
   161
	};	
williamr@2
   162
williamr@2
   163
/*****************************************************************************/
williamr@2
   164
/**
williamr@2
   165
UID associated with the Custom interface MMMFDevSoundGetTimePlayed
williamr@2
   166
williamr@2
   167
@publishedPartner
williamr@2
   168
@released
williamr@2
   169
*/
williamr@2
   170
const TUid KMmfUidDevSoundTimePlayedCustomInterface = {0x10285CE4};
williamr@2
   171
williamr@2
   172
/**
williamr@2
   173
This class provides an interface to querying current play time from DevSound.
williamr@2
   174
williamr@2
   175
@publishedPartner
williamr@2
   176
@released
williamr@2
   177
*/	
williamr@2
   178
class MMMFDevSoundTimePlayed
williamr@2
   179
	{
williamr@2
   180
public:
williamr@2
   181
	/** Retrieves the current play time from the audio renderer.
williamr@2
   182
	@param  aTime
williamr@2
   183
	        A reference to TTimeIntervalMicroSeconds object which will be filled with the current play time by this function.
williamr@2
   184
	@return An error code indicating if the function call was successful. 
williamr@2
   185
			KErrNone on success,
williamr@2
   186
			KErrNotSupported if the underlying HwDevice does not support this custominterface
williamr@2
   187
	*/
williamr@2
   188
	virtual TInt GetTimePlayed(TTimeIntervalMicroSeconds& aTime) = 0;
williamr@2
   189
	};
williamr@2
   190
williamr@2
   191
/*****************************************************************************/
williamr@2
   192
/**
williamr@2
   193
UID associated with the Custom interface MMMFDevSoundQueryIgnoresUnderflow
williamr@2
   194
williamr@2
   195
@publishedPartner
williamr@2
   196
@released
williamr@2
   197
*/
williamr@2
   198
const TUid KMmfUidDevSoundQueryIgnoresUnderflowCustomInterface = {0x10285E7B};
williamr@2
   199
williamr@2
   200
/**
williamr@2
   201
This class provides an interface for querying DevSound whether it ignores the underflow errors from the sound driver.
williamr@2
   202
@publishedPartner
williamr@2
   203
@released
williamr@2
   204
*/	
williamr@2
   205
class MMMFDevSoundQueryIgnoresUnderflow
williamr@2
   206
	{
williamr@2
   207
public:
williamr@2
   208
	/** Queries the devsound whether it ignores the underflow errors from the sound driver
williamr@2
   209
	@return ETrue 	if the devsound ignores all the underflow errors from the sound driver except for the last buffer. That means DevSound
williamr@2
   210
					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
   211
			EFalse 	if devsound propagates the underflow errors from the sound driver in all the cases
williamr@2
   212
	*/
williamr@2
   213
	virtual TBool QueryIgnoresUnderflow() = 0;
williamr@2
   214
	};
williamr@2
   215
williamr@2
   216
williamr@2
   217
const TUid KMmfUidDevSoundTruePauseCustomInterface = {0x1028643E};
williamr@2
   218
williamr@2
   219
/**
williamr@2
   220
This class provides an interface to be able to Resume from DevSound.
williamr@2
   221
@publishedPartner
williamr@2
   222
@release
williamr@2
   223
*/	
williamr@2
   224
class MMMFDevSoundTruePause
williamr@2
   225
	{
williamr@2
   226
public:
williamr@2
   227
	/** Queries the devsound whether it supports True Pause or not
williamr@2
   228
	This call is only valid when DevSound is initialized
williamr@2
   229
	@return ETrue if the current DevSound configuration does support this feature
williamr@2
   230
			EFalse otherwise
williamr@2
   231
	*/
williamr@2
   232
	virtual TBool IsResumeSupported() = 0;
williamr@2
   233
williamr@2
   234
	/** Resume the playback, recording or tone playing that was paused
williamr@2
   235
	@return An error code indicating if the function call was successful. 
williamr@2
   236
			KErrNone on success,
williamr@2
   237
			KErrNotReady when is DevSound is not in pause
williamr@2
   238
			KErrNotSupported if the DevSound configuration does support this feature
williamr@2
   239
	*/
williamr@2
   240
	virtual TInt Resume() = 0;
williamr@2
   241
	};
williamr@2
   242
williamr@2
   243
williamr@2
   244
#endif // MMFDEVSOUNDCUSTOMINTERFACESUPPORT_H