CDrmPlayerUtility Class Reference

API published in: S60 3rd Ed
API deprecated in: S60 5th Ed

Link against: drmaudioplayutility.lib

Capability Information

Required Capabilities

None


#include <drmaudiosampleplayer.h>

Detailed Description

Used by third party developers to play 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.


Public Member Functions

IMPORT_C  ~CDrmPlayerUtility ()
  Destructor.
IMPORT_C void  Play ()
  Begins playback of the initialised audio sample at the current volume and priority levels.
IMPORT_C void  Stop ()
  Stops playback of the audio sample as soon as is possible.
IMPORT_C TInt  Pause ()
  Pauses playback of the audio clip.
IMPORT_C void  SetVolume (TInt aVolume)
  Changes the current playback volume to a specified value.
IMPORT_C void  SetRepeats (TInt aRepeatNumberOfTimes, const TTimeIntervalMicroSeconds &aTrailingSilence)
  Sets the number of times the audio sample should be repeated during the playback operation.
IMPORT_C void  SetVolumeRamp (const TTimeIntervalMicroSeconds &aRampDuration)
  Changes the current playback volume to a specified value.
IMPORT_C const TTimeIntervalMicroSeconds &  Duration ()
  Returns the duration of the audio sample in microseconds.
IMPORT_C TInt  MaxVolume ()
  Returns an integer representing the maximum volume that the audio clip can support.
IMPORT_C void  OpenFileL (const TDesC &aFileName)
  Opens an audio clip from a file.
IMPORT_C void  OpenFileL (const RFile &aFile)
  Opens an audio clip from a file.
IMPORT_C void  OpenFileL (const TMMSource &aSource)
  Opens an audio clip from a file.
IMPORT_C void  OpenDesL (const TDesC8 &aDescriptor)
  Opens an audio clip from a descriptor.
IMPORT_C void  OpenUrlL (const TDesC &aUrl, TInt aIapId=KUseDefaultIap, const TDesC8 &aMimeType=KNullDesC8)
  Opens an audio clip from a URL.
IMPORT_C void  Close ()
  Closes the current audio clip.
IMPORT_C TInt  GetPosition (TTimeIntervalMicroSeconds &aPosition)
  Returns the current playback position in microseconds from the start of the clip.
IMPORT_C void  SetPosition (const TTimeIntervalMicroSeconds &aPosition)
  Returns the current playback position in microseconds from the start of the clip.
IMPORT_C TInt  SetPriority (TInt aPriority, TMdaPriorityPreference aPref)
  Set the priority for playback.
IMPORT_C TInt  GetVolume (TInt &aVolume)
  Returns the current playback volume.
IMPORT_C TInt  GetNumberOfMetaDataEntries (TInt &aNumEntries)
  Gets the number of meta data entries in the current audio clip.
IMPORT_C CMMFMetaDataEntry *  GetMetaDataEntryL (TInt aMetaDataIndex)
  Returns a specified meta data entry from the audio clip.
IMPORT_C TInt  SetPlayWindow (const TTimeIntervalMicroSeconds &aStart, const TTimeIntervalMicroSeconds &aEnd)
  Defines the size of the current playback window.
IMPORT_C TInt  ClearPlayWindow ()
  Clears the current playback window.
IMPORT_C TInt  SetBalance (TInt aBalance=KMMFBalanceCenter)
  Sets the current playback balance.
IMPORT_C TInt  GetBalance (TInt &aBalance)
  Returns the current playback balance.
IMPORT_C TInt  GetBitRate (TUint &aBitRate)
  Returns the current bit rate.
IMPORT_C void  RegisterForAudioLoadingNotification (MAudioLoadingObserver &aCallback)
  Allows user to register for audio loading callback.
IMPORT_C void  GetAudioLoadingProgressL (TInt &aPercentageProgress)
  Gets the progress of audio loading.
IMPORT_C const CMMFControllerImplementationInformation &  ControllerImplementationInformationL ()
  Returns controller implementation parameters.
IMPORT_C TInt  CustomCommandSync (const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TDes8 &aDataFrom)
  Sends a custom command synchronously to the controller plugin.
IMPORT_C TInt  CustomCommandSync (const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2)
  Sends a custom command synchronously to the controller plugin.
IMPORT_C void  CustomCommandAsync (const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TDes8 &aDataFrom, TRequestStatus &aStatus)
  Sends a custom command asynchronously to the controller plugin.
IMPORT_C void  CustomCommandAsync (const TMMFMessageDestinationPckg &aDestination, TInt aFunction, const TDesC8 &aDataTo1, const TDesC8 &aDataTo2, TRequestStatus &aStatus)
  Sends a custom command asynchronously to the controller plugin.

Static Public Member Functions

static IMPORT_C CDrmPlayerUtility NewL (MDrmAudioPlayerCallback &aCallback, TInt aPriority, TMdaPriorityPreference aPref)
  Two-phased constructor.
static IMPORT_C CDrmPlayerUtility NewFilePlayerL (const TDesC &aFileName, MDrmAudioPlayerCallback &aCallback, TInt aPriority, TMdaPriorityPreference aPref)
  Two-phased constructor.
static IMPORT_C CDrmPlayerUtility NewDesPlayerL (const TDesC8 &aData, MDrmAudioPlayerCallback &aCallback, TInt aPriority, TMdaPriorityPreference aPref)
  Two-phased constructor.
static IMPORT_C CDrmPlayerUtility NewDesPlayerReadOnlyL (const TDesC8 &aData, MDrmAudioPlayerCallback &aCallback, TInt aPriority, TMdaPriorityPreference aPref)
  Two-phased constructor.

Protected Attributes

CMMFDrmAudioPlayerUtility *  iProperties
  This member is internal and not intended for use.

Constructor & Destructor Documentation

IMPORT_C CDrmPlayerUtility::~CDrmPlayerUtility  ) 
 

Destructor.


Member Function Documentation

IMPORT_C TInt CDrmPlayerUtility::ClearPlayWindow  ) 
 

Clears the current playback window.

Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C void CDrmPlayerUtility::Close  ) 
 

Closes the current audio clip.

IMPORT_C const CMMFControllerImplementationInformation& CDrmPlayerUtility::ControllerImplementationInformationL  ) 
 

Returns controller implementation parameters.

Returns:
The controller information
IMPORT_C void CDrmPlayerUtility::CustomCommandAsync const TMMFMessageDestinationPckg &  aDestination,
TInt  aFunction,
const TDesC8 &  aDataTo1,
const TDesC8 &  aDataTo2,
TRequestStatus &  aStatus
 

Sends a custom command asynchronously to the controller plugin.

Parameters:
aDestination  The destination of the custom command, consisting of the unique ID of the interface of this custom command and a special handle id KMMFObjectHandleController to indicate that the custom command is to be handled by the controller plugin
aFunction  The function number to indicate which function is to be called on the controller's custom command interface.
aDataTo1  A reference to data to be copied to the controller plugin. The exact contents of the data are dependent on the custom command interface of the controller. Can be NULL.
aDataTo2  A reference to data to be copied to the controller plugin. The exact contents of the data are dependent on the custom command interface of the controller. Can be NULL
aDataFrom  A reference to an area of memory to which the controller plugin will write any data to be passed back to the client. Cannot be NULL
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C void CDrmPlayerUtility::CustomCommandAsync const TMMFMessageDestinationPckg &  aDestination,
TInt  aFunction,
const TDesC8 &  aDataTo1,
const TDesC8 &  aDataTo2,
TDes8 &  aDataFrom,
TRequestStatus &  aStatus
 

Sends a custom command asynchronously to the controller plugin.

Parameters:
aDestination  The destination of the custom command, consisting of the unique ID of the interface of this custom command and a special handle id KMMFObjectHandleController to indicate that the custom command is to be handled by the controller plugin
aFunction  The function number to indicate which function is to be called on the controller's custom command interface.
aDataTo1  A reference to data to be copied to the controller plugin. The exact contents of the data are dependent on the custom command interface of the controller. Can be NULL.
aDataTo2  A reference to data to be copied to the controller plugin. The exact contents of the data are dependent on the custom command interface of the controller. Can be NULL
aDataFrom  A reference to an area of memory to which the controller plugin will write any data to be passed back to the client. Cannot be NULL
aDataFrom  The TRequestStatus of an active object. This will contain the result of the custom command on completion. The exact range of result values is dependent on the custom command interface
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C TInt CDrmPlayerUtility::CustomCommandSync const TMMFMessageDestinationPckg &  aDestination,
TInt  aFunction,
const TDesC8 &  aDataTo1,
const TDesC8 &  aDataTo2
 

Sends a custom command synchronously to the controller plugin.

Parameters:
aDestination  The destination of the custom command, consisting of the unique ID of the interface of this custom command and a special handle id KMMFObjectHandleController to indicate that the custom command is to be handled by the controller plugin
aFunction  The function number to indicate which function is to be called on the controller's custom command interface.
aDataTo1  A reference to data to be copied to the controller plugin. The exact contents of the data are dependent on the custom command interface of the controller. Can be NULL.
aDataTo2  A reference to data to be copied to the controller plugin. The exact contents of the data are dependent on the custom command interface of the controller. Can be NULL
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C TInt CDrmPlayerUtility::CustomCommandSync const TMMFMessageDestinationPckg &  aDestination,
TInt  aFunction,
const TDesC8 &  aDataTo1,
const TDesC8 &  aDataTo2,
TDes8 &  aDataFrom
 

Sends a custom command synchronously to the controller plugin.

Parameters:
aDestination  The destination of the custom command, consisting of the unique ID of the interface of this custom command and a special handle id KMMFObjectHandleController to indicate that the custom command is to be handled by the controller plugin
aFunction  The function number to indicate which function is to be called on the controller's custom command interface.
aDataTo1  A reference to data to be copied to the controller plugin. The exact contents of the data are dependent on the custom command interface of the controller. Can be NULL.
aDataTo2  A reference to data to be copied to the controller plugin. The exact contents of the data are dependent on the custom command interface of the controller. Can be NULL
aDataFrom  A reference to an area of memory to which the controller plugin will write any data to be passed back to the client. Cannot be NULL
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C const TTimeIntervalMicroSeconds& CDrmPlayerUtility::Duration  ) 
 

Returns the duration of the audio sample in microseconds.

Returns:
The duration of the sample in microseconds
IMPORT_C void CDrmPlayerUtility::GetAudioLoadingProgressL TInt &  aPercentageProgress  ) 
 

Gets the progress of audio loading.

Parameters:
aPercentageProgress  Upon return, contains the percentage progress
IMPORT_C TInt CDrmPlayerUtility::GetBalance TInt &  aBalance  ) 
 

Returns the current playback balance.

Parameters:
aBalance  On return, contains the current balance setting
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C TInt CDrmPlayerUtility::GetBitRate TUint &  aBitRate  ) 
 

Returns the current bit rate.

Parameters:
aBitRate  On return, contains the current bit rate
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C CMMFMetaDataEntry* CDrmPlayerUtility::GetMetaDataEntryL TInt  aMetaDataIndex  ) 
 

Returns a specified meta data entry from the audio clip.

Parameters:
aMetaDataIndex  The index of the meta data entry to return
Returns:
The returned meta data entry
IMPORT_C TInt CDrmPlayerUtility::GetNumberOfMetaDataEntries TInt &  aNumEntries  ) 
 

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

Parameters:
aNumEntries  On return, contains the number of meta data entries
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C TInt CDrmPlayerUtility::GetPosition TTimeIntervalMicroSeconds &  aPosition  ) 
 

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

Parameters:
aPosition  The number of microseconds from the start of the clip to the current play position
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C TInt CDrmPlayerUtility::GetVolume TInt &  aVolume  ) 
 

Returns the current playback volume.

Parameters:
aVolume  A value between 0 (mute) and the maximum volume setting
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C TInt CDrmPlayerUtility::MaxVolume  ) 
 

Returns an integer representing the maximum volume that the audio clip can support.

Returns:
The maximum permissible volume setting
static IMPORT_C CDrmPlayerUtility* CDrmPlayerUtility::NewDesPlayerL const TDesC8 &  aData,
MDrmAudioPlayerCallback aCallback,
TInt  aPriority,
TMdaPriorityPreference  aPref
[static]
 

Two-phased constructor.

static IMPORT_C CDrmPlayerUtility* CDrmPlayerUtility::NewDesPlayerReadOnlyL const TDesC8 &  aData,
MDrmAudioPlayerCallback aCallback,
TInt  aPriority,
TMdaPriorityPreference  aPref
[static]
 

Two-phased constructor.

static IMPORT_C CDrmPlayerUtility* CDrmPlayerUtility::NewFilePlayerL const TDesC &  aFileName,
MDrmAudioPlayerCallback aCallback,
TInt  aPriority,
TMdaPriorityPreference  aPref
[static]
 

Two-phased constructor.

static IMPORT_C CDrmPlayerUtility* CDrmPlayerUtility::NewL MDrmAudioPlayerCallback aCallback,
TInt  aPriority,
TMdaPriorityPreference  aPref
[static]
 

Two-phased constructor.

IMPORT_C void CDrmPlayerUtility::OpenDesL const TDesC8 &  aDescriptor  ) 
 

Opens an audio clip from a descriptor.

Parameters:
aDescriptor  The descriptor containing the audio clip
IMPORT_C void CDrmPlayerUtility::OpenFileL const TMMSource &  aSource  ) 
 

Opens an audio clip from a file.

Parameters:
aSource  The source of the file containing the clip
IMPORT_C void CDrmPlayerUtility::OpenFileL const RFile &  aFile  ) 
 

Opens an audio clip from a file.

Parameters:
aFile  The file handle of the file containing the clip
IMPORT_C void CDrmPlayerUtility::OpenFileL const TDesC &  aFileName  ) 
 

Opens an audio clip from a file.

Parameters:
aFileName  The file containing the audio clip
IMPORT_C void CDrmPlayerUtility::OpenUrlL const TDesC &  aUrl,
TInt  aIapId = KUseDefaultIap,
const TDesC8 &  aMimeType = KNullDesC8
 

Opens an audio clip from a URL.

Parameters:
aUrl  The URL of the audio clip.
aMimeType  The mime type associated with the specified URL/audio clip
IMPORT_C TInt CDrmPlayerUtility::Pause  ) 
 

Pauses playback of the audio clip.

Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C void CDrmPlayerUtility::Play  ) 
 

Begins playback of the initialised audio sample at the current volume and priority levels.

IMPORT_C void CDrmPlayerUtility::RegisterForAudioLoadingNotification MAudioLoadingObserver &  aCallback  ) 
 

Allows user to register for audio loading callback.

Parameters:
aCallback  Reference to the client to be notified
IMPORT_C TInt CDrmPlayerUtility::SetBalance TInt  aBalance = KMMFBalanceCenter  ) 
 

Sets the current playback balance.

Parameters:
aBalance  The balance value to set
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C TInt CDrmPlayerUtility::SetPlayWindow const TTimeIntervalMicroSeconds &  aStart,
const TTimeIntervalMicroSeconds &  aEnd
 

Defines the size of the current playback window.

Parameters:
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.
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.
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C void CDrmPlayerUtility::SetPosition const TTimeIntervalMicroSeconds &  aPosition  ) 
 

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

Parameters:
aPosition  The number of microseconds from the start of the clip to the current play position
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C TInt CDrmPlayerUtility::SetPriority TInt  aPriority,
TMdaPriorityPreference  aPref
 

Set the priority for playback.

Parameters:
aPriority  The priority level to apply, EMdaPriorityMin client can be interrupted by any other client, EMdaPriorityNormal client can only be interrupted by a client with a higher priority or EMdaPriorityMax client cannot be interrupted by other clients.
aPref  The time and quality preferences to apply.
Returns:
KErrNone on success, otherwise another of the system-wide error codes
IMPORT_C void CDrmPlayerUtility::SetRepeats TInt  aRepeatNumberOfTimes,
const TTimeIntervalMicroSeconds &  aTrailingSilence
 

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

Parameters:
aRepeatNumberOfTimes  The number of times to repeat the sample. Use 0 for no repeat, KMdaRepeatForever for continuous, any other value for number of times.
aTrailingSilence  The duration of silence after the sample has played in microseconds.
IMPORT_C void CDrmPlayerUtility::SetVolume TInt  aVolume  ) 
 

Changes the current playback volume to a specified value.

Parameters:
aVolume  Any value between 0 (mute) and the maximum volume
IMPORT_C void CDrmPlayerUtility::SetVolumeRamp const TTimeIntervalMicroSeconds &  aRampDuration  ) 
 

Changes the current playback volume to a specified value.

Parameters:
aVolume  Any value between 0 (mute) and the maximum volume returned by
IMPORT_C void CDrmPlayerUtility::Stop  ) 
 

Stops playback of the audio sample as soon as is possible.


Field Documentation

CMMFDrmAudioPlayerUtility* CDrmPlayerUtility::iProperties [protected]
 

This member is internal and not intended for use.


The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top