CMdaAudioPlayerUtility Class Reference

class CMdaAudioPlayerUtility : public CBase

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

Inherits from

Public Member Functions
~CMdaAudioPlayerUtility ()
IMPORT_C TInt CancelRegisterAudioResourceNotification ( TUid )
IMPORT_C TInt ClearPlayWindow ()
IMPORT_C void Close ()
IMPORT_C const CMMFControllerImplementationInformation & ControllerImplementationInformationL ()
IMPORT_C void CustomCommandAsync (const TMMFMessageDestinationPckg &, TInt , const TDesC8 &, const TDesC8 &, TDes8 &, TRequestStatus &)
IMPORT_C void CustomCommandAsync (const TMMFMessageDestinationPckg &, TInt , const TDesC8 &, const TDesC8 &, TRequestStatus &)
IMPORT_C TInt CustomCommandSync (const TMMFMessageDestinationPckg &, TInt , const TDesC8 &, const TDesC8 &, TDes8 &)
IMPORT_C TInt CustomCommandSync (const TMMFMessageDestinationPckg &, TInt , const TDesC8 &, const TDesC8 &)
const TTimeIntervalMicroSeconds & Duration ()
IMPORT_C TMMFDurationInfo Duration ( TTimeIntervalMicroSeconds &)
IMPORT_C void GetAudioLoadingProgressL ( TInt &)
IMPORT_C TInt GetBalance ( TInt &)
IMPORT_C TInt GetBitRate ( TUint &)
IMPORT_C MMMFDRMCustomCommand * GetDRMCustomCommand ()
IMPORT_C CMMFMetaDataEntry * GetMetaDataEntryL ( TInt )
IMPORT_C TInt GetNumberOfMetaDataEntries ( TInt &)
IMPORT_C TInt GetPosition ( TTimeIntervalMicroSeconds &)
IMPORT_C TInt GetVolume ( TInt &)
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 void OpenDesL (const TDesC8 &)
IMPORT_C void OpenFileL (const TDesC &)
IMPORT_C void OpenFileL (const RFile &)
IMPORT_C void OpenFileL (const TMMSource &)
IMPORT_C void OpenUrlL (const TDesC &, TInt , const TDesC8 &)
IMPORT_C TInt Pause ()
void Play ()
IMPORT_C TInt RegisterAudioResourceNotification ( MMMFAudioResourceNotificationCallback &, TUid , const TDesC8 &)
IMPORT_C void RegisterForAudioLoadingNotification ( MAudioLoadingObserver &)
IMPORT_C TInt SetBalance ( TInt )
IMPORT_C TInt SetPlayWindow (const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)
IMPORT_C void SetPosition (const TTimeIntervalMicroSeconds &)
IMPORT_C TInt SetPriority ( TInt , TInt )
void SetRepeats ( TInt , const TTimeIntervalMicroSeconds &)
IMPORT_C TInt SetThreadPriority (const TThreadPriority &)
TInt SetVolume ( TInt )
void SetVolumeRamp (const TTimeIntervalMicroSeconds &)
void Stop ()
IMPORT_C void UseSharedHeap ()
IMPORT_C TInt WillResumePlay ()
Private Member Functions
CMdaAudioPlayerUtility ()
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()
Protected Attributes
CMMFMdaAudioPlayerUtility * iProperties

Constructor & Destructor Documentation

CMdaAudioPlayerUtility()

CMdaAudioPlayerUtility ( ) [private]

~CMdaAudioPlayerUtility()

~CMdaAudioPlayerUtility ( )

Destructor.

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

Member Functions Documentation

CancelRegisterAudioResourceNotification(TUid)

IMPORT_C TInt CancelRegisterAudioResourceNotification ( TUid aNotificationEventId )

Cancels the registered notification event.

Parameters

TUid aNotificationEventId The Event to notify the client.

ClearPlayWindow()

IMPORT_C TInt ClearPlayWindow ( )

Clears the current playback window.

Since
7.0s

Close()

IMPORT_C void Close ( )

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

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

IMPORT_C void CustomCommandAsync ( const TMMFMessageDestinationPckg & aDestination,
TInt aFunction,
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

const TMMFMessageDestinationPckg & aDestination The destination of the message, consisting of the uid of the interface of this message.
TInt aFunction The function number to indicate which function is to be called on the interface defined in the aDestination parameter.
const TDesC8 & aDataTo1 A 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.
const TDesC8 & aDataTo2 A 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.
TDes8 & aDataFrom A 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."
TRequestStatus & aStatus The 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 void CustomCommandAsync ( const TMMFMessageDestinationPckg & aDestination,
TInt aFunction,
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

const TMMFMessageDestinationPckg & aDestination The destination of the message, consisting of the uid of the interface of this message.
TInt aFunction The function number to indicate which function is to be called on the interface defined in the aDestination parameter.
const TDesC8 & aDataTo1 A 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.
const TDesC8 & aDataTo2 A 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.
TRequestStatus & aStatus The 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 TInt CustomCommandSync ( const TMMFMessageDestinationPckg & aDestination,
TInt aFunction,
const TDesC8 & aDataTo1,
const TDesC8 & aDataTo2,
TDes8 & aDataFrom
)

Sends a synchronous custom command to the controller.

Since
7.0s

Parameters

const TMMFMessageDestinationPckg & aDestination The destination of the message, consisting of the UID of the interface of this message.
TInt aFunction The function number to indicate which function is to be called on the interface defined in the aDestination parameter.
const TDesC8 & aDataTo1 A 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.
const TDesC8 & aDataTo2 A 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.
TDes8 & aDataFrom A 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.

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

IMPORT_C TInt CustomCommandSync ( const TMMFMessageDestinationPckg & aDestination,
TInt aFunction,
const TDesC8 & aDataTo1,
const TDesC8 & aDataTo2
)

Sends a synchronous custom command to the controller.

Since
7.0s

Parameters

const TMMFMessageDestinationPckg & aDestination The destination of the message, consisting of the UID of the interface of this message.
TInt aFunction The function number to indicate which function is to be called on the interface defined in the aDestination parameter.
const TDesC8 & aDataTo1 A 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.
const TDesC8 & aDataTo2 A 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.

Duration()

const TTimeIntervalMicroSeconds & Duration ( ) [virtual]

Returns the duration of the audio sample in microseconds.

Since
5.0

Duration(TTimeIntervalMicroSeconds &)

IMPORT_C TMMFDurationInfo Duration ( TTimeIntervalMicroSeconds & aDuration )

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

Since
9.1

Parameters

TTimeIntervalMicroSeconds & aDuration The duration of the sample in microseconds.

GetAudioLoadingProgressL(TInt &)

IMPORT_C void GetAudioLoadingProgressL ( TInt & aPercentageComplete )

Returns the current progress of audio loading.

Since
7.0s

Parameters

TInt & aPercentageComplete The percentage of the audio clip loaded.

GetBalance(TInt &)

IMPORT_C TInt GetBalance ( 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

TInt & aBalance A value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight.

GetBitRate(TUint &)

IMPORT_C TInt GetBitRate ( TUint & aBitRate )

Returns the bit rate of the audio clip.

Since
7.0s

Parameters

TUint & aBitRate The bit rate of the audio clip

GetDRMCustomCommand()

IMPORT_C MMMFDRMCustomCommand * GetDRMCustomCommand ( )

Gets a controller's DRM custom command implementation.

GetMetaDataEntryL(TInt)

IMPORT_C CMMFMetaDataEntry * GetMetaDataEntryL ( TInt aMetaDataIndex )

Returns the requested meta data entry.

leave
KErrNotFound The meta data entry does not exist.
leave
KErrNotImplemented The controller does not support meta data information for this format.
Since
7.0s

Parameters

TInt aMetaDataIndex The index number of the meta data to retrieve.

GetNumberOfMetaDataEntries(TInt &)

IMPORT_C TInt GetNumberOfMetaDataEntries ( TInt & aNumEntries )

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

Since
7.0s

Parameters

TInt & aNumEntries The number of meta data entries in the header of the current clip.

GetPosition(TTimeIntervalMicroSeconds &)

IMPORT_C TInt GetPosition ( TTimeIntervalMicroSeconds & aPosition )

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

Since
7.0s

Parameters

TTimeIntervalMicroSeconds & aPosition The current time position in microseconds from the start of the clip to the current play position.

GetVolume(TInt &)

IMPORT_C TInt GetVolume ( TInt & aVolume )

Returns the current playback volume.

Since
7.0s

Parameters

TInt & aVolume A value between 0 and the maximum volume settings returned by MaxVolume().

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.

panic
EMMFMediaClientPanicServerCommunicationProblem is raised when the audio player utility is not initialised.
Since
5.0

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

IMPORT_C CMdaAudioPlayerUtility * NewDesPlayerL ( const TDesC8 & aData,
MMdaAudioPlayerCallback & aCallback,
TInt aPriority = EMdaPriorityNormal,
TInt aPref = EMdaPriorityPreferenceTimeAndQuality,
CMdaServer * aServer = NULL
) [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

const TDesC8 & aData A descriptor containing the audio data. This descriptor must remain in existence for the lifetime of this audio player utility object.
MMdaAudioPlayerCallback & aCallback The audio player observer interface.
TInt aPriority = EMdaPriorityNormal The 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.
TInt aPref = EMdaPriorityPreferenceTimeAndQuality The 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.
CMdaServer * aServer = NULL Not used in 7.0s. This parameter is provided for binary compatibility with previous versions.

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

IMPORT_C CMdaAudioPlayerUtility * NewDesPlayerReadOnlyL ( const TDesC8 & aData,
MMdaAudioPlayerCallback & aCallback,
TInt aPriority = EMdaPriorityNormal,
TInt aPref = EMdaPriorityPreferenceTimeAndQuality,
CMdaServer * aServer = NULL
) [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

const TDesC8 & aData A read only descriptor containing the audio data. This descriptor must remain in existence for the lifetime of this audio player utility object.
MMdaAudioPlayerCallback & aCallback The audio player observer interface.
TInt aPriority = EMdaPriorityNormal The 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.
TInt aPref = EMdaPriorityPreferenceTimeAndQuality The 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.
CMdaServer * aServer = NULL Not used in 7.0s. This parameter is provided for binary compatibility with previous versions.

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

IMPORT_C CMdaAudioPlayerUtility * NewFilePlayerL ( const TDesC & aFileName,
MMdaAudioPlayerCallback & aCallback,
TInt aPriority = EMdaPriorityNormal,
TInt aPref = EMdaPriorityPreferenceTimeAndQuality,
CMdaServer * aServer = NULL
) [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

const TDesC & aFileName The full path name of the file containing the audio data.
MMdaAudioPlayerCallback & aCallback The audio player observer interface.
TInt aPriority = EMdaPriorityNormal The 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.
TInt aPref = EMdaPriorityPreferenceTimeAndQuality The 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.
CMdaServer * aServer = NULL Not used in 7.0s. This parameter is provided for binary compatibility with previous versions.

NewL(MMdaAudioPlayerCallback &, TInt, TInt)

IMPORT_C CMdaAudioPlayerUtility * NewL ( MMdaAudioPlayerCallback & aCallback,
TInt aPriority = EMdaPriorityNormal,
TInt aPref = 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

MMdaAudioPlayerCallback & aCallback The audio player observer interface.
TInt aPriority = EMdaPriorityNormal The 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.
TInt aPref = EMdaPriorityPreferenceTimeAndQuality The 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.

OpenDesL(const TDesC8 &)

IMPORT_C void OpenDesL ( const TDesC8 & aDescriptor )

Opens an audio clip from a descriptor.

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

leave
KErrInUse If a previous open statement is awaiting notification of completion.
Since
7.0s

Parameters

const TDesC8 & aDescriptor A descriptor containing the audio clip.

OpenFileL(const TDesC &)

IMPORT_C void OpenFileL ( 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.

leave
KErrNotReady If a previous open statement is awaiting notification of completion. opening the file
Since
7.0s

Parameters

const TDesC & aFileName The file to open.

OpenFileL(const RFile &)

IMPORT_C void OpenFileL ( 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.

leave
KErrBadHandle If the file handle is not shared through the call RFs::ShareProtected() , and the adaptation needs it to be.
leave
KErrNotReady If a previous open statement is awaiting notification of completion. opening the file

Parameters

const RFile & aFile The open shared session file handle to use

OpenFileL(const TMMSource &)

IMPORT_C void OpenFileL ( 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.

leave
KErrNotReady If a previous open statement is awaiting notification of completion. opening the file

Parameters

const TMMSource & aSource The file to open or an open file handle to use

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

IMPORT_C void OpenUrlL ( const TDesC & aUrl,
TInt aIapId =  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).

leave
KErrInUse If a previous open statement is awaiting notification of completion.
Since
7.0s

Parameters

const TDesC & aUrl The URL to open.
TInt aIapId =  KUseDefaultIap Internet access point(IAP) ID to use. KUseDefaultIap selects the default IAP.
const TDesC8 & aMimeType =  KNullDesC8 MIME type of the URL source.

Pause()

IMPORT_C TInt Pause ( )

Pauses the playback of the audio clip.

Since
7.0s

Play()

void Play ( ) [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 TInt RegisterAudioResourceNotification ( MMMFAudioResourceNotificationCallback & aCallback,
TUid aNotificationEventUid,
const TDesC8 & aNotificationRegistrationData =  KNullDesC8
)

Registers the Event for Notification when resource is avaliable.

Parameters

MMMFAudioResourceNotificationCallback & aCallback The audio outputstream observer interface..
TUid aNotificationEventUid The Event for which the client is registered.
const TDesC8 & aNotificationRegistrationData =  KNullDesC8 Notification registration specific data.

RegisterForAudioLoadingNotification(MAudioLoadingObserver &)

IMPORT_C void RegisterForAudioLoadingNotification ( MAudioLoadingObserver & aCallback )

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

Since
7.0s

Parameters

MAudioLoadingObserver & aCallback The object to receive audio loading notifications.

SetBalance(TInt)

IMPORT_C TInt SetBalance ( TInt aBalance =  KMMFBalanceCenter )

Sets the current playback balance.

Since
7.0s

Parameters

TInt aBalance =  KMMFBalanceCenter A value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight. The default value is KMMFBalanceCenter.

SetPlayWindow(const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)

IMPORT_C TInt SetPlayWindow ( 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

const TTimeIntervalMicroSeconds & aStart The 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.
const TTimeIntervalMicroSeconds & aEnd The 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.

SetPosition(const TTimeIntervalMicroSeconds &)

IMPORT_C void SetPosition ( const TTimeIntervalMicroSeconds & aPosition )

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

Since
7.0s

Parameters

const TTimeIntervalMicroSeconds & aPosition The position to move to in microseconds from the start of the clip.

SetPriority(TInt, TInt)

IMPORT_C TInt SetPriority ( TInt aPriority,
TInt aPref
)

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

Parameters

TInt aPriority The Priority Value.
TInt aPref The Priority Preference.

SetRepeats(TInt, const TTimeIntervalMicroSeconds &)

void SetRepeats ( TInt aRepeatNumberOfTimes,
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

TInt aRepeatNumberOfTimes The 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.
const TTimeIntervalMicroSeconds & aTrailingSilence The time interval of the trailing silence in microseconds.

SetThreadPriority(const TThreadPriority &)

IMPORT_C TInt SetThreadPriority ( 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

const TThreadPriority & aThreadPriority The TThreadPriority that the thread should run under. The default is EPriorityNormal.

SetVolume(TInt)

TInt SetVolume ( TInt aVolume ) [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() ).

panic
EMMFMediaClientBadArgument is raised when the audio player utility is not initialised.
Since
5.0

Parameters

TInt aVolume The 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.

SetVolumeRamp(const TTimeIntervalMicroSeconds &)

void SetVolumeRamp ( 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

const TTimeIntervalMicroSeconds & aRampDuration The 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()

void Stop ( ) [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 void UseSharedHeap ( )

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 TInt WillResumePlay ( )

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

Member Data Documentation

CMMFMdaAudioPlayerUtility * iProperties

CMMFMdaAudioPlayerUtility * iProperties [protected]

This member is internal and not intended for use.