CDrmPlayerUtility Class Reference

#include <DrmAudioSamplePlayer.h>

Link against: DRMAudioPlayer.lib

class CDrmPlayerUtility : public CBase

Inherits from

  • CDrmPlayerUtility
    Protected Attributes
    CDrmAudioPlayerAdaptation *iProperties
    Public Member Functions
    ~CDrmPlayerUtility()
    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 &)
    IMPORT_C const TTimeIntervalMicroSeconds &Duration()
    IMPORT_C voidGetAudioLoadingProgressL(TInt &)
    IMPORT_C TIntGetBalance(TInt &)
    IMPORT_C TIntGetBitRate(TUint &)
    IMPORT_C CMMFMetaDataEntry *GetMetaDataEntryL(TInt)
    IMPORT_C TIntGetNumberOfMetaDataEntries(TInt &)
    IMPORT_C TIntGetPosition(TTimeIntervalMicroSeconds &)
    IMPORT_C TIntGetVolume(TInt &)
    IMPORT_C TIntMaxVolume()
    IMPORT_C CDrmPlayerUtility *NewDesPlayerL(const TDesC8 &, MDrmAudioPlayerCallback &, TInt, TMdaPriorityPreference)
    IMPORT_C CDrmPlayerUtility *NewDesPlayerReadOnlyL(const TDesC8 &, MDrmAudioPlayerCallback &, TInt, TMdaPriorityPreference)
    IMPORT_C CDrmPlayerUtility *NewFilePlayerL(const TDesC &, MDrmAudioPlayerCallback &, TInt, TMdaPriorityPreference)
    IMPORT_C CDrmPlayerUtility *NewL(MDrmAudioPlayerCallback &, TInt, TMdaPriorityPreference)
    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()
    IMPORT_C voidPlay()
    IMPORT_C voidRegisterForAudioLoadingNotification(MAudioLoadingObserver &)
    IMPORT_C TIntSetBalance(TInt)
    IMPORT_C TIntSetPlayWindow(const TTimeIntervalMicroSeconds &, const TTimeIntervalMicroSeconds &)
    IMPORT_C voidSetPosition(const TTimeIntervalMicroSeconds &)
    IMPORT_C TIntSetPriority(TInt, TMdaPriorityPreference)
    IMPORT_C voidSetRepeats(TInt, const TTimeIntervalMicroSeconds &)
    IMPORT_C voidSetVolume(TInt)
    IMPORT_C voidSetVolumeRamp(const TTimeIntervalMicroSeconds &)
    IMPORT_C voidStop()
    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

    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.

    Since
    Series 60 3.0

    Member Attribute Documentation

    iProperties

    CDrmAudioPlayerAdaptation *iProperties[protected]

    This member is internal and not intended for use.

    Constructor & Destructor Documentation

    ~CDrmPlayerUtility ( )

    IMPORT_C~CDrmPlayerUtility()

    Destructor.

    Member Function Documentation

    ClearPlayWindow ( )

    IMPORT_C TIntClearPlayWindow()

    Clears the current playback window.

    Since
    Series 60 3.0

    Returns: KErrNone on success, otherwise another of the system-wide error codes

    Close ( )

    IMPORT_C voidClose()

    Closes the current audio clip.

    Since
    Series 60 3.0

    ControllerImplementationInformationL ( )

    IMPORT_C const CMMFControllerImplementationInformation &ControllerImplementationInformationL()

    Returns controller implementation parameters

    Since
    Series 60 3.0

    Returns: The controller information

    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 a custom command asynchronously to the controller plugin

    Since
    Series 60 3.0
    ParameterDescription
    aDestinationThe 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
    aFunctionThe function number to indicate which function is to be called on the controller's custom command interface.
    aDataTo1A 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.
    aDataTo2A 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
    aDataFromThe 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

    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 a custom command asynchronously to the controller plugin

    Since
    Series 60 3.0
    ParameterDescription
    aDestinationThe 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
    aFunctionThe function number to indicate which function is to be called on the controller's custom command interface.
    aDataTo1A 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.
    aDataTo2A 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

    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 custom command synchronously to the controller plugin

    Since
    Series 60 3.0
    ParameterDescription
    aDestinationThe 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
    aFunctionThe function number to indicate which function is to be called on the controller's custom command interface.
    aDataTo1A 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.
    aDataTo2A 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
    aDataFromA 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

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

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

    Sends a custom command synchronously to the controller plugin

    Since
    Series 60 3.0
    ParameterDescription
    aDestinationThe 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
    aFunctionThe function number to indicate which function is to be called on the controller's custom command interface.
    aDataTo1A 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.
    aDataTo2A 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

    Duration ( )

    IMPORT_C const TTimeIntervalMicroSeconds &Duration()

    Returns the duration of the audio sample in microseconds.

    Since
    Series 60 3.0

    Returns: The duration of the sample in microseconds

    GetAudioLoadingProgressL ( TInt & )

    IMPORT_C voidGetAudioLoadingProgressL(TInt &aPercentageProgress)

    Gets the progress of audio loading

    Since
    Series 60 3.0
    ParameterDescription
    aPercentageProgressUpon return, contains the percentage progress

    GetBalance ( TInt & )

    IMPORT_C TIntGetBalance(TInt &aBalance)

    Returns the current playback balance.

    Since
    Series 60 3.0
    ParameterDescription
    aBalanceOn return, contains the current balance setting

    Returns: KErrNone on success, otherwise another of the system-wide error codes

    GetBitRate ( TUint & )

    IMPORT_C TIntGetBitRate(TUint &aBitRate)

    Returns the current bit rate

    Since
    Series 60 3.0
    ParameterDescription
    aBitRateOn return, contains the current bit rate

    Returns: KErrNone on success, otherwise another of the system-wide error codes

    GetMetaDataEntryL ( TInt )

    IMPORT_C CMMFMetaDataEntry *GetMetaDataEntryL(TIntaMetaDataIndex)

    Returns a specified meta data entry from the audio clip.

    Since
    Series 60 3.0
    ParameterDescription
    aMetaDataIndexThe index of the meta data entry to return

    Returns: The returned meta data entry

    GetNumberOfMetaDataEntries ( TInt & )

    IMPORT_C TIntGetNumberOfMetaDataEntries(TInt &aNumEntries)

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

    Since
    Series 60 3.0
    ParameterDescription
    aNumEntriesOn return, contains the number of meta data entries

    Returns: 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
    Series 60 3.0
    ParameterDescription
    aPositionThe 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

    GetVolume ( TInt & )

    IMPORT_C TIntGetVolume(TInt &aVolume)

    Returns the current playback volume.

    Since
    Series 60 3.0
    ParameterDescription
    aVolumeA value between 0 (mute) and the maximum volume setting

    Returns: KErrNone on success, otherwise another of the system-wide error codes

    MaxVolume ( )

    IMPORT_C TIntMaxVolume()

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

    Since
    Series 60 3.0

    Returns: The maximum permissible volume setting

    NewDesPlayerL ( const TDesC8 &, MDrmAudioPlayerCallback &, TInt, TMdaPriorityPreference )

    IMPORT_C CDrmPlayerUtility *NewDesPlayerL(const TDesC8 &aData,
    MDrmAudioPlayerCallback &aCallback,
    TIntaPriority,
    TMdaPriorityPreferenceaPref
    )[static]

    Two-phased constructor.

    NewDesPlayerReadOnlyL ( const TDesC8 &, MDrmAudioPlayerCallback &, TInt, TMdaPriorityPreference )

    IMPORT_C CDrmPlayerUtility *NewDesPlayerReadOnlyL(const TDesC8 &aData,
    MDrmAudioPlayerCallback &aCallback,
    TIntaPriority,
    TMdaPriorityPreferenceaPref
    )[static]

    Two-phased constructor.

    NewFilePlayerL ( const TDesC &, MDrmAudioPlayerCallback &, TInt, TMdaPriorityPreference )

    IMPORT_C CDrmPlayerUtility *NewFilePlayerL(const TDesC &aFileName,
    MDrmAudioPlayerCallback &aCallback,
    TIntaPriority,
    TMdaPriorityPreferenceaPref
    )[static]

    Two-phased constructor.

    NewL ( MDrmAudioPlayerCallback &, TInt, TMdaPriorityPreference )

    IMPORT_C CDrmPlayerUtility *NewL(MDrmAudioPlayerCallback &aCallback,
    TIntaPriority,
    TMdaPriorityPreferenceaPref
    )[static]

    Two-phased constructor.

    OpenDesL ( const TDesC8 & )

    IMPORT_C voidOpenDesL(const TDesC8 &aDescriptor)

    Opens an audio clip from a descriptor.

    Since
    Series 60 3.0
    ParameterDescription
    aDescriptorThe descriptor containing the audio clip

    OpenFileL ( const TDesC & )

    IMPORT_C voidOpenFileL(const TDesC &aFileName)

    Opens an audio clip from a file.

    Since
    Series 60 3.0
    ParameterDescription
    aFileNameThe file containing the audio clip

    OpenFileL ( const RFile & )

    IMPORT_C voidOpenFileL(const RFile &aFile)

    Opens an audio clip from a file.

    Since
    Series 60 3.0
    ParameterDescription
    aFileThe file handle of the file containing the clip

    OpenFileL ( const TMMSource & )

    IMPORT_C voidOpenFileL(const TMMSource &aSource)

    Opens an audio clip from a file.

    Since
    Series 60 3.0
    ParameterDescription
    aSourceThe source of the file containing the clip

    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.

    Since
    Series 60 3.0
    ParameterDescription
    aUrlThe URL of the audio clip.
    aMimeTypeThe mime type associated with the specified URL/audio clip

    Pause ( )

    IMPORT_C TIntPause()

    Pauses playback of the audio clip

    Since
    Series 60 3.0

    Returns: KErrNone on success, otherwise another of the system-wide error codes

    Play ( )

    IMPORT_C voidPlay()

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

    Since
    Series 60 3.0

    RegisterForAudioLoadingNotification ( MAudioLoadingObserver & )

    IMPORT_C voidRegisterForAudioLoadingNotification(MAudioLoadingObserver &aCallback)

    Allows user to register for audio loading callback

    Since
    Series 60 3.0
    ParameterDescription
    aCallbackReference to the client to be notified

    SetBalance ( TInt )

    IMPORT_C TIntSetBalance(TIntaBalance =  KMMFBalanceCenter )

    Sets the current playback balance.

    Since
    Series 60 3.0
    ParameterDescription
    aBalanceThe balance value to set

    Returns: 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 the size of the current playback window.

    Since
    Series 60 3.0
    ParameterDescription
    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.

    Returns: KErrNone on success, otherwise another of the system-wide error codes

    SetPosition ( const TTimeIntervalMicroSeconds & )

    IMPORT_C voidSetPosition(const TTimeIntervalMicroSeconds &aPosition)

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

    Since
    Series 60 3.0
    ParameterDescription
    aPositionThe 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

    SetPriority ( TInt, TMdaPriorityPreference )

    IMPORT_C TIntSetPriority(TIntaPriority,
    TMdaPriorityPreferenceaPref
    )

    Set the priority for playback.

    Since
    Series 60 3.0
    ParameterDescription
    aPriorityThe 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.
    aPrefThe time and quality preferences to apply.

    Returns: KErrNone on success, otherwise another of the system-wide error codes

    SetRepeats ( TInt, const TTimeIntervalMicroSeconds & )

    IMPORT_C voidSetRepeats(TIntaRepeatNumberOfTimes,
    const TTimeIntervalMicroSeconds &aTrailingSilence
    )

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

    Since
    Series 60 3.0
    ParameterDescription
    aRepeatNumberOfTimesThe number of times to repeat the sample. Use 0 for no repeat, KMdaRepeatForever for continuous, any other value for number of times.
    aTrailingSilenceThe duration of silence after the sample has played in microseconds.

    SetVolume ( TInt )

    IMPORT_C voidSetVolume(TIntaVolume)

    Changes the current playback volume to a specified value.

    Since
    Series 60 3.0
    ParameterDescription
    aVolumeAny value between 0 (mute) and the maximum volume

    SetVolumeRamp ( const TTimeIntervalMicroSeconds & )

    IMPORT_C voidSetVolumeRamp(const TTimeIntervalMicroSeconds &aRampDuration)

    Changes the current playback volume to a specified value.

    Since
    Series 60 3.0

    Stop ( )

    IMPORT_C voidStop()

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

    Since
    Series 60 3.0