CMdaAudioPlayerUtility Class Reference

#include <mdaaudiosampleplayer.h>

Link against: mediaclientaudio.lib

class CMdaAudioPlayerUtility : public CBase, public MMMFClientUtility

Inherits from

Protected Attributes
CMMFMdaAudioPlayerUtility *iProperties
Public Member Functions
~CMdaAudioPlayerUtility()
IMPORT_C TIntCancelRegisterAudioResourceNotification(TUid)
IMPORT_C TIntClearPlayWindow()
IMPORT_C voidClose()
IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL()
IMPORT_C voidCustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C voidCustomCommandAsync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus &)
IMPORT_C TIntCustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &)
IMPORT_C TIntCustomCommandSync(const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &)
virtual const TTimeIntervalMicroSeconds &Duration()
IMPORT_C TMMFDurationInfoDuration(TTimeIntervalMicroSeconds &)
IMPORT_C voidGetAudioLoadingProgressL(TInt &)
IMPORT_C TIntGetBalance(TInt &)
IMPORT_C TIntGetBitRate(TUint &)
IMPORT_C MMMFDRMCustomCommand *GetDRMCustomCommand()
IMPORT_C CMMFMetaDataEntry *GetMetaDataEntryL(TInt)
IMPORT_C TIntGetNumberOfMetaDataEntries(TInt &)
IMPORT_C TIntGetPosition(TTimeIntervalMicroSeconds &)
IMPORT_C TIntGetVolume(TInt &)
virtual TInt MaxVolume()
IMPORT_C CMdaAudioPlayerUtility *NewDesPlayerL(const TDesC8 &, MMdaAudioPlayerCallback &, TInt, TInt, CMdaServer *)
IMPORT_C CMdaAudioPlayerUtility *NewDesPlayerReadOnlyL(const TDesC8 &, MMdaAudioPlayerCallback &, TInt, TInt, CMdaServer *)
IMPORT_C CMdaAudioPlayerUtility *NewFilePlayerL(const TDesC &, MMdaAudioPlayerCallback &, TInt, TInt, CMdaServer *)
IMPORT_C CMdaAudioPlayerUtility *NewL(MMdaAudioPlayerCallback &, TInt, TInt)
IMPORT_C voidOpenDesL(const TDesC8 &)
IMPORT_C voidOpenFileL(const TDesC &)
IMPORT_C voidOpenFileL(const RFile &)
IMPORT_C voidOpenFileL(const TMMSource &)
IMPORT_C voidOpenUrlL(const TDesC &, TInt, const TDesC8 &)
IMPORT_C TIntPause()
virtual voidPlay()
IMPORT_C TIntRegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &, TUid, const TDesC8 &)
IMPORT_C voidRegisterForAudioLoadingNotification(MAudioLoadingObserver &)
IMPORT_C TIntSetBalance(TInt)
IMPORT_C TIntSetPlayWindow(const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)
IMPORT_C voidSetPosition(const TTimeIntervalMicroSeconds &)
IMPORT_C TIntSetPriority(TInt, TInt)
virtual voidSetRepeats(TInt, const TTimeIntervalMicroSeconds &)
IMPORT_C TIntSetThreadPriority(const TThreadPriority &)
virtual TInt SetVolume(TInt)
virtual voidSetVolumeRamp(const TTimeIntervalMicroSeconds &)
virtual voidStop()
IMPORT_C voidUseSharedHeap()
IMPORT_C TIntWillResumePlay()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()

Detailed Description

Plays sampled audio data.

The class offers a simple interface to open, play and obtain information from, sampled audio data. The audio data can be supplied either in a file (file-based), as a descriptor (descriptor-based) or as a URL reference (since version 7.0s).

While this class is abstract, the three static functions construct, initialise and return pointers to instances of concrete classes derived from this abstract class.

Since
5.0

Member Attribute Documentation

iProperties

CMMFMdaAudioPlayerUtility *iProperties[protected]

This member is internal and not intended for use.

Constructor & Destructor Documentation

~CMdaAudioPlayerUtility ( )

~CMdaAudioPlayerUtility()

Destructor.

Frees all resources owned by the object prior to its destruction.

Member Function Documentation

CancelRegisterAudioResourceNotification ( TUid )

IMPORT_C TIntCancelRegisterAudioResourceNotification(TUidaNotificationEventId)

Cancels the registered notification event.

Parameters
aNotificationEventIdThe Event to notify the client.
Return Value
An error code indicating if the registration was successful. KErrNone on success, otherwise another of the system-wide error codes.

ClearPlayWindow ( )

IMPORT_C TIntClearPlayWindow()

Clears the current playback window.

Since
7.0s
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

Close ( )

IMPORT_C voidClose()

Closes the current audio clip (allowing another clip to be opened).

Since
7.0s

ControllerImplementationInformationL ( )

IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL()

Returns the controller implementation information associated with the current controller.

Since
7.0s
Return Value
The controller implementation structure

CustomCommandAsync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus & )

IMPORT_C voidCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom,
TRequestStatus &aStatus
)

Sends an asynchronous custom command to the controller.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

Since
7.0s
Parameters
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataFromA reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8."
aStatusThe TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.

CustomCommandAsync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TRequestStatus & )

IMPORT_C voidCustomCommandAsync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TRequestStatus &aStatus
)

Sends an asynchronous custom command to the controller.

Note: This method will return immediately. The RunL of the active object owning the aStatus parameter will be called when the command is completed by the controller framework.

Since
7.0s
Parameters
aDestinationThe destination of the message, consisting of the uid of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aStatusThe TRequestStatus of an active object. This will contain the result of the request on completion. The exact range of result values is dependent on the interface.

CustomCommandSync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 &, TDes8 & )

IMPORT_C TIntCustomCommandSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2,
TDes8 &aDataFrom
)

Sends a synchronous custom command to the controller.

Since
7.0s
Parameters
aDestinationThe destination of the message, consisting of the UID of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataFromA reference to an area of memory to which the controller framework will write any data to be passed back to the client. Can't be KNullDesC8.
Return Value
The result of the request. Exact range of values is dependent on the interface.

CustomCommandSync ( const TMMFMessageDestinationPckg &, TInt, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntCustomCommandSync(const TMMFMessageDestinationPckg &aDestination,
TIntaFunction,
const TDesC8 &aDataTo1,
const TDesC8 &aDataTo2
)

Sends a synchronous custom command to the controller.

Since
7.0s
Parameters
aDestinationThe destination of the message, consisting of the UID of the interface of this message.
aFunctionThe function number to indicate which function is to be called on the interface defined in the aDestination parameter.
aDataTo1A reference to the first chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
aDataTo2A reference to the second chunk of data to be copied to the controller framework. The exact contents of the data are dependent on the interface being called. Can be KNullDesC8.
Return Value
The result of the request. Exact range of values is dependent on the interface.

Duration ( )

const TTimeIntervalMicroSeconds &Duration()[virtual]

Returns the duration of the audio sample in microseconds.

Since
5.0
Return Value
The duration of the sample in microseconds.

Duration ( TTimeIntervalMicroSeconds & )

IMPORT_C TMMFDurationInfoDuration(TTimeIntervalMicroSeconds &aDuration)

Returns the duration of the audio sample in microseconds, and the duration state.

Since
9.1
Parameters
aDurationThe duration of the sample in microseconds.
Return Value
The duration state

GetAudioLoadingProgressL ( TInt & )

IMPORT_C voidGetAudioLoadingProgressL(TInt &aPercentageComplete)

Returns the current progress of audio loading.

Since
7.0s
Parameters
aPercentageCompleteThe percentage of the audio clip loaded.

GetBalance ( TInt & )

IMPORT_C TIntGetBalance(TInt &aBalance)

Returns The current playback balance. This function may not return the same value as passed to SetBalance depending on the internal implementation in the underlying components.

Since
7.0s
Parameters
aBalanceA value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

GetBitRate ( TUint & )

IMPORT_C TIntGetBitRate(TUint &aBitRate)

Returns the bit rate of the audio clip.

Since
7.0s
Parameters
aBitRateThe bit rate of the audio clip
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

GetDRMCustomCommand ( )

IMPORT_C MMMFDRMCustomCommand *GetDRMCustomCommand()

Gets a controller's DRM custom command implementation.

Return Value
A pointer to a controller's DRM custom command implementation, or NULL if the controller does not support it.

GetMetaDataEntryL ( TInt )

IMPORT_C CMMFMetaDataEntry *GetMetaDataEntryL(TIntaMetaDataIndex)

Returns the requested meta data entry.

Since
7.0s
Parameters
aMetaDataIndexThe index number of the meta data to retrieve.
Return Value
The requested meta data entry.
Leave Codes
KErrNotFoundThe meta data entry does not exist.
KErrNotImplementedThe controller does not support meta data information for this format.

GetNumberOfMetaDataEntries ( TInt & )

IMPORT_C TIntGetNumberOfMetaDataEntries(TInt &aNumEntries)

Returns the number of meta data entries in the current audio clip.

Since
7.0s
Parameters
aNumEntriesThe number of meta data entries in the header of the current clip.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

GetPosition ( TTimeIntervalMicroSeconds & )

IMPORT_C TIntGetPosition(TTimeIntervalMicroSeconds &aPosition)

Returns the current playback position in microseconds from the start of the clip.

Since
7.0s
Parameters
aPositionThe current time position in microseconds from the start of the clip to the current play position.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

GetVolume ( TInt & )

IMPORT_C TIntGetVolume(TInt &aVolume)

Returns the current playback volume.

Since
7.0s
Parameters
aVolumeA value between 0 and the maximum volume settings returned by MaxVolume().
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

MaxVolume ( )

TInt MaxVolume()[virtual]

Returns an integer representing the maximum volume.

This is the maximum value which can be passed to CMdaAudioPlayerUtility::SetVolume(). This value is platform independent, but is always greater than or equal to one.

Since
5.0
Return Value
The maximum volume setting.
Panic Codes
EMMFMediaClientPanicServerCommunicationProblemis raised when the audio player utility is not initialised.

NewDesPlayerL ( const TDesC8 &, MMdaAudioPlayerCallback &, TInt, TInt, CMdaServer * )

IMPORT_C CMdaAudioPlayerUtility *NewDesPlayerL(const TDesC8 &aData,
MMdaAudioPlayerCallback &aCallback,
TIntaPriority = EMdaPriorityNormal,
TIntaPref = EMdaPriorityPreferenceTimeAndQuality,
CMdaServer *aServer = 0
)[static]

Constructs and initialises a new instance of the audio player utility for playing sampled audio data from a descriptor.

The audio data must be in a supported format (e.g. WAV and AU).

The function leaves if the audio player utility object cannot be created. When initialisation of the audio player utility is complete, successfully or otherwise, the callback function MMdaAudioPlayerCallback::MapcInitComplete() is called.

Note: The Priority Value and Priority Preference are used primarily when deciding what to do when several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may vary between different phones. Portable applications are advised not to assume any specific behaviour.

Parameters
aDataA descriptor containing the audio data. This descriptor must remain in existence for the lifetime of this audio player utility object.
aCallbackThe audio player observer interface.
aPriorityThe Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
aPrefThe Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code.
aServerNot used in 7.0s. This parameter is provided for binary compatibility with previous versions.
Return Value
A pointer to the new audio player utility object.

NewDesPlayerReadOnlyL ( const TDesC8 &, MMdaAudioPlayerCallback &, TInt, TInt, CMdaServer * )

IMPORT_C CMdaAudioPlayerUtility *NewDesPlayerReadOnlyL(const TDesC8 &aData,
MMdaAudioPlayerCallback &aCallback,
TIntaPriority = EMdaPriorityNormal,
TIntaPref = EMdaPriorityPreferenceTimeAndQuality,
CMdaServer *aServer = 0
)[static]

Constructs and initialises a new instance of the audio player utility for playing sampled audio data from a read only descriptor.

The audio data must be in a supported format (e.g. WAV and AU).

The function leaves if the audio player utility object cannot be created. When initialisation of the audio player utility is complete, successfully or otherwise, the callback function MMdaAudioPlayerCallback::MapcInitComplete() is called.

Note: The Priority Value and Priority Preference are used primarily when deciding what to do when several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may vary between different phones. Portable applications are advised not to assume any specific behaviour.

Parameters
aDataA read only descriptor containing the audio data. This descriptor must remain in existence for the lifetime of this audio player utility object.
aCallbackThe audio player observer interface.
aPriorityThe Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
aPrefThe Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code.
aServerNot used in 7.0s. This parameter is provided for binary compatibility with previous versions.
Return Value
A pointer to a new audio player utility.

NewFilePlayerL ( const TDesC &, MMdaAudioPlayerCallback &, TInt, TInt, CMdaServer * )

IMPORT_C CMdaAudioPlayerUtility *NewFilePlayerL(const TDesC &aFileName,
MMdaAudioPlayerCallback &aCallback,
TIntaPriority = EMdaPriorityNormal,
TIntaPref = EMdaPriorityPreferenceTimeAndQuality,
CMdaServer *aServer = 0
)[static]

Constructs and initialises a new instance of the audio player utility for playing sampled audio data from a file. The audio data must be in a supported format (e.g. WAV and AU).

The function leaves if the audio player utility object cannot be created.

When initialisation of the audio player utility is complete, successfully or otherwise, the callback function MMdaAudioPlayerCallback::MapcInitComplete() is called.

Note: The Priority Value and Priority Preference are used primarily when deciding what to do when several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may vary between different phones. Portable applications are advised not to assume any specific behaviour.

Parameters
aFileNameThe full path name of the file containing the audio data.
aCallbackThe audio player observer interface.
aPriorityThe Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
aPrefThe Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code.
aServerNot used in 7.0s. This parameter is provided for binary compatibility with previous versions.
Return Value
A pointer to the new audio player utility object.

NewL ( MMdaAudioPlayerCallback &, TInt, TInt )

IMPORT_C CMdaAudioPlayerUtility *NewL(MMdaAudioPlayerCallback &aCallback,
TIntaPriority = EMdaPriorityNormal,
TIntaPref = EMdaPriorityPreferenceTimeAndQuality
)[static]

Constructs and initialises a new instance of the audio player utility.

The function leaves if the audio player utility object cannot be created.

No callback notification is made upon completion of NewL().

Note: The Priority Value and Priority Preference are used primarily when deciding what to do when several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. Whatever, the decision as to what to do in such situations is up to the audio adaptation, and may vary between different phones. Portable applications are advised not to assume any specific behaviour.

Parameters
aCallbackThe audio player observer interface.
aPriorityThe Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
aPrefThe Priority Preference - an additional audio policy parameter. The suggested default is EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional values may be supported by given phones and/or platforms, but should not be depended upon by portable code.
Return Value
A pointer to the new audio player utility object.

OpenDesL ( const TDesC8 & )

IMPORT_C voidOpenDesL(const TDesC8 &aDescriptor)

Opens an audio clip from a descriptor.

The audio data must be in a supported format (for example, WAV or AU).

Since
7.0s
Parameters
aDescriptorA descriptor containing the audio clip.
Leave Codes
KErrInUseIf a previous open statement is awaiting notification of completion.

OpenFileL ( const TDesC & )

IMPORT_C voidOpenFileL(const TDesC &aFileName)

Opens an audio clip from a file.

The audio data must be in a supported format (for example, WAV or AU).

This function leaves with KErrNotReady if there is a previous open statement awaiting notification of completion.

Since
7.0s
Parameters
aFileNameThe file to open.
Leave Codes
KErrNotReadyIf a previous open statement is awaiting notification of completion. opening the file

OpenFileL ( const RFile & )

IMPORT_C voidOpenFileL(const RFile &aFile)

Opens an audio clip from a file.

The audio data must be in a supported format (for example, WAV or AU).

This function leaves with KErrNotReady if there is a previous open statement awaiting notification of completion.

Note: it is generally advisable that the RFile is shared through the call RFs::ShareProtected(). This allows the adaptation to pass it to another process, if that is required. This is particularly true of playing DRM encrypted files.

Parameters
aFileThe open shared session file handle to use
Leave Codes
KErrBadHandleIf the file handle is not shared through the call
KErrNotReadyIf a previous open statement is awaiting notification of completion. opening the file

OpenFileL ( const TMMSource & )

IMPORT_C voidOpenFileL(const TMMSource &aSource)

Opens an audio clip from a file.

The audio data must be in a supported format (for example, WAV or AU).

This function leaves with KErrNotReady if there is a previous open statement awaiting notification of completion.

Parameters
aSourceThe file to open or an open file handle to use
Leave Codes
KErrNotReadyIf a previous open statement is awaiting notification of completion. opening the file

OpenUrlL ( const TDesC &, TInt, const TDesC8 & )

IMPORT_C voidOpenUrlL(const TDesC &aUrl,
TIntaIapId =  KUseDefaultIap ,
const TDesC8 &aMimeType = KNullDesC8
)

Opens an audio clip from a URL.

The audio data must be in a supported format (for example, WAV or AU).

Since
7.0s
Parameters
aUrlThe URL to open.
aIapIdInternet access point(IAP) ID to use. KUseDefaultIap selects the default IAP.
aMimeTypeMIME type of the URL source.
Leave Codes
KErrInUseIf a previous open statement is awaiting notification of completion.

Pause ( )

IMPORT_C TIntPause()

Pauses the playback of the audio clip.

Since
7.0s
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

Play ( )

voidPlay()[virtual]

Begins playback of audio sample data at the current playback position using the current volume, gain and priority settings.

When playing of the audio sample is complete, successfully or otherwise, the callback function MMdaAudioPlayerCallback::MapcPlayComplete() is called.

If this function is called whilst already playing then MMdaAudioPlayerCallback::MapcPlayComplete will return with the error code KErrNotReady.

Since
5.0

RegisterAudioResourceNotification ( MMMFAudioResourceNotificationCallback &, TUid, const TDesC8 & )

IMPORT_C TIntRegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &aCallback,
TUidaNotificationEventUid,
const TDesC8 &aNotificationRegistrationData = KNullDesC8
)

Registers the Event for Notification when resource is avaliable.

Parameters
aCallbackThe audio outputstream observer interface..
aNotificationEventUidThe Event for which the client is registered.
aNotificationRegistrationDataNotification registration specific data.
Return Value
An error code indicating if the registration was successful. KErrNone on success, otherwise another of the system-wide error codes.

RegisterForAudioLoadingNotification ( MAudioLoadingObserver & )

IMPORT_C voidRegisterForAudioLoadingNotification(MAudioLoadingObserver &aCallback)

Registers callback object to receive notifications of audio loading/rebuffering.

Since
7.0s
Parameters
aCallbackThe object to receive audio loading notifications.

SetBalance ( TInt )

IMPORT_C TIntSetBalance(TIntaBalance =  KMMFBalanceCenter )

Sets the current playback balance.

Since
7.0s
Parameters
aBalanceA value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight. The default value is KMMFBalanceCenter.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

SetPlayWindow ( const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds & )

IMPORT_C TIntSetPlayWindow(const TTimeIntervalMicroSeconds &aStart,
const TTimeIntervalMicroSeconds &aEnd
)

Defines a window on the audio sample data.

The window is defined in terms of a start and end position. When the current playback position reaches the window end position, or Stop() is called, the current playback position is set to the window start position and playback stops.

The current playback position is not affected by a call to SetPlayWindow() unless it is outside the new playback window, in which case it is set to the window start or end position depending on which one is closer.

The window persists until ClearPlayWindow() is called. Loading new audio sample data without adjusting or clearing the window will result in playback errors if the window is outside the new data.

Since
7.0s
Parameters
aStartThe position defining the start of the window, measured in microseconds. If this value is less than zero, it is set to zero. If this value is greater than aEnd, then it is swapped with aEnd.
aEndThe position defining the end of the window, measured in microseconds. If this value is greater than the value returned by Duration(), it is set to the value of Duration(). If this value is less than aStart, then it is swapped with aStart.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

SetPosition ( const TTimeIntervalMicroSeconds & )

IMPORT_C voidSetPosition(const TTimeIntervalMicroSeconds &aPosition)

Sets the current playback position in microseconds from the start of the clip.

Since
7.0s
Parameters
aPositionThe position to move to in microseconds from the start of the clip.

SetPriority ( TInt, TInt )

IMPORT_C TIntSetPriority(TIntaPriority,
TIntaPref
)

Sets the priority for playback. This is used to arbitrate between multiple objects trying to access a single sound device.

Since
7.0s

See also: CMdaAudioPlayerUtility::NewL()

Parameters
aPriorityThe Priority Value.
aPrefThe Priority Preference.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

SetRepeats ( TInt, const TTimeIntervalMicroSeconds & )

voidSetRepeats(TIntaRepeatNumberOfTimes,
const TTimeIntervalMicroSeconds &aTrailingSilence
)[virtual]

Sets the number of times the audio sample is to be repeated during the playback operation.

A period of silence can follow each playing of the sample. The audio sample can be repeated indefinitely.

Since
5.0
Parameters
aRepeatNumberOfTimesThe number of times the audio sample, together with the trailing silence, is to be repeated. If this is set to KMdaRepeatForever, then the audio sample, together with the trailing silence, is repeated indefinitely or until Stop() is called. If this is set to zero, then the audio sample is not repeated.
aTrailingSilenceThe time interval of the trailing silence in microseconds.

SetThreadPriority ( const TThreadPriority & )

IMPORT_C TIntSetThreadPriority(const TThreadPriority &aThreadPriority)const

Set the priority of the controller's sub thread.

This can be used to increase the responsiveness of the audio plugin to minimise any lag in processing. This function should be used with care as it may have knock-on effects elsewhere in the system.

Parameters
aThreadPriorityThe TThreadPriority that the thread should run under. The default is EPriorityNormal.
Return Value
TInt A standard error code: KErrNone if successful, KErrNotReady if the thread does not have a valid handle.

SetVolume ( TInt )

TInt SetVolume(TIntaVolume)[virtual]

Changes the current playback volume to a specified value.

The volume can be changed before or during playback and is effective immediately. The volume can be set to any value between zero (mute) and the maximum permissible volume (determined using MaxVolume()).

Since
5.0
Parameters
aVolumeThe volume setting. This can be any value from zero to the value returned by a call to CMdaAudioPlayerUtility::MaxVolume(). Setting a zero value mutes the sound. Setting the maximum value results in the loudest possible sound. Values less than zero would be set to zero and the values greater than the maximum permitted volume would be set to the maximum volume.
Return Value
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
Panic Codes
EMMFMediaClientBadArgumentis raised when the audio player utility is not initialised.

SetVolumeRamp ( const TTimeIntervalMicroSeconds & )

voidSetVolumeRamp(const TTimeIntervalMicroSeconds &aRampDuration)[virtual]

Defines the period over which the volume level is to rise smoothly from nothing to the normal volume level.

Since
5.0
Parameters
aRampDurationThe period over which the volume is to rise. A zero value causes the audio sample to be played at the normal level for the full duration of the playback. A value which is longer than the duration of the audio sample means that the sample never reaches its normal volume level.

Stop ( )

voidStop()[virtual]

Stops playback of the audio sample as soon as possible.

If the audio sample is playing, playback is stopped as soon as possible. If playback is already complete, nothing further happens as a result of calling this function. The callback function MMdaAudioPlayerCallback::MapcPlayComplete() is not called.

Since
5.0

UseSharedHeap ( )

IMPORT_C voidUseSharedHeap()

Ensures that any subsequent calls to OpenXYZ() will create controllers that share a heap.

The default behaviour is that for each player utility a controller with its own heap is created. Each heap uses a chunk, so using this function avoids situations where the number of chunks per process is limited. The default behaviour is generally to be preferred, and should give lower overall memory usage. However, if many controllers are to be created for a particular thread, then this function should be used to prevent running out of heaps or chunks.

Since
9.1

WillResumePlay ( )

IMPORT_C TIntWillResumePlay()

Waits for the client to resume the play even after the default timer expires.

Return Value
An error code indicating if the registration was successful. KErrNone on success, otherwise another of the system-wide error codes.