Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <Tuner.h>
Link against: tuner.lib
This item is not part of the S60 5th Edition SDK

Class CMMTunerAudioPlayerUtility

class CMMTunerAudioPlayerUtility : public CBase;

Description

The Tuner Audio Player Utility is used to initiate and control playback of audio from the tuner.

Derivation

Members

Defined in CMMTunerAudioPlayerUtility:

Inherited from CBase:


Construction and destruction


NewL(CMMTunerUtility &,MMMTunerAudioPlayerObserver &)

Interface status: deprecated Use CMMTunerUtility::GetTunerAudioPlayerUtilityL() instead

IMPORT_C static CMMTunerAudioPlayerUtility* NewL(CMMTunerUtility &aTuner, MMMTunerAudioPlayerObserver &aObserver);

Description

Factory function to create a new Tuner Audio Player utility. Note that only one audio player utility may be created per instance of CMMTunerUtility. Multiple instances will result in an error of KErrAlreadyExists when CMMTunerAudioPlayerUtility::InitializeL(TInt,TMdaPriorityPreference) is called.

Parameters

CMMTunerUtility &aTuner

The tuner object which this utility will play the audio from.

MMMTunerAudioPlayerObserver &aObserver

The observer of the player utility to receive asychronous completion and notifiction callbacks.

Return value

CMMTunerAudioPlayerUtility *

A new tuner audio player utility.

Leave codes

KErrNoMemory

Out of memory

KErrNotSupported

If the given tuner doesn't support audio playback.


~CMMTunerAudioPlayerUtility()

IMPORT_C virtual ~CMMTunerAudioPlayerUtility();

Description

Destructor

[Top]


Member functions


InitializeL(TInt,TMdaPriorityPreference)

IMPORT_C void InitializeL(TInt aAudioPriority=EMdaPriorityNormal, TMdaPriorityPreference aPref=EMdaPriorityPreferenceTimeAndQuality);

Description

Set-up the API for playing the output from tuner to the speaker asynchronously. Calls MMMTunerAudioPlayerObserver::MTapoInitializeComplete(TInt) on completion. This must be called before Play.

Parameters

TInt aAudioPriority

Sound device priority value

TMdaPriorityPreference aPref

Sound device priority preference value


Play()

IMPORT_C void Play();

Description

Start playback of the tuner output. To stop playback, call Mute, or Stop if play will not need to be restarted. CMMTunerAudioPlayerUtility::InitializeL(TInt,TMdaPriorityPreference) must have already been called, and a callback to MTapoInitializeComplete with an error of KErrNone must have occurred; if this is not the case, this raises a TunerAudioPlay 1 panic.


Mute(TBool)

IMPORT_C TInt Mute(TBool aMute);

Description

Mute or unmute playback.

Raises a TunerAudioPlay 1 panic if the player is not properly initialized.

Parameters

TBool aMute

ETrue to mute the audio, EFalse to unmute it.

Return value

TInt

A standard system error code


Stop()

IMPORT_C void Stop();

Description

Stop playback, and release the output device for use by other clients

Raises a TunerAudioPlay 1 panic if the player is not properly initialized.

Playback should already be under way.


SetPriority(TInt,TMdaPriorityPreference)

IMPORT_C TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref);

Description

Set the current audio priority. This priority is used to arbitrate between multiple audio sources trying to access the audio hardware.

Parameters

TInt aPriority

A priority between EMdaPriorityMin and EMdaPriorityMax

TMdaPriorityPreference aPref

Time vs Quality priority preferences, enumerated in TMdaPriorityPreference

Return value

TInt

A standard system error code


GetPriority(TInt &,TMdaPriorityPreference &)const

IMPORT_C TInt GetPriority(TInt &aPriority, TMdaPriorityPreference &aPref) const;

Description

Get the current audio priority. This is used to arbitrate between simultaneous accesses to the sound hardware.

Parameters

TInt &aPriority

A priority between EMdaPriorityMin and EMdaPriorityMax to return

TMdaPriorityPreference &aPref

Time vs Quality priority preferences to return, enumerated in TMdaPriorityPreference

Return value

TInt

A standard system error code


SetVolume(TInt)

IMPORT_C TInt SetVolume(TInt aVolume);

Description

Set the volume to the specified level

Raises a TunerAudioPlay 1 panic if the player is not properly initialized.

Parameters

TInt aVolume

The volume level to set

Return value

TInt

A standard system error code


GetVolume(TInt &)const

IMPORT_C TInt GetVolume(TInt &aVolume) const;

Description

Return the current volume

Parameters

TInt &aVolume

The variable to set to the current volume

Return value

TInt

A standard system error code


SetVolumeRamp(const TTimeIntervalMicroSeconds &)

IMPORT_C TInt SetVolumeRamp(const TTimeIntervalMicroSeconds &aRampInterval);

Description

Define a volume ramp, aRampInterval defining the interval between valid volume settings

Raises a TunerAudioPlay 1 panic if the player is not properly initialized.

Parameters

const TTimeIntervalMicroSeconds &aRampInterval

The time interval over which the volume should be increased from zero to the current volume setting

Return value

TInt

A standard system error code


MaxVolume()const

IMPORT_C TInt MaxVolume() const;

Description

Return the maximum volume supported

Return value

TInt

The maximum volume setting permitted


SetBalance(TInt)

IMPORT_C TInt SetBalance(TInt aBalance=KMMFBalanceCenter);

Description

Set the stereo balance between left and right channels

Raises a TunerAudioPlay 1 panic if the player is not properly initialized.

Parameters

TInt aBalance

The balance value to set - must be between KMMFBalanceMaxLeft and KMMFBalanceMaxRight

Return value

TInt

A standard system error code


GetBalance(TInt &)const

IMPORT_C TInt GetBalance(TInt &aBalance) const;

Description

Return the current stereo balance

Parameters

TInt &aBalance

The variable to set to the current balance

Return value

TInt

A standard system error code


RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &,TUid,const TDesC8 *)

IMPORT_C TInt RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback &aCallback, TUid aNotificationEventUid, const TDesC8 *aNotificationRegistrationData=0);

Description

Register for audio resource notifications, in the event that the audio resource is lost due to pre-emption by a higher priority audio client.

Parameters

MMMFAudioResourceNotificationCallback &aCallback

instance of callback class to be used

TUid aNotificationEventUid

event uid to use on callback

const TDesC8 *aNotificationRegistrationData

additional user data required by the callback

Return value

TInt


CancelRegisterAudioResourceNotification(TUid)

IMPORT_C void CancelRegisterAudioResourceNotification(TUid aNotificationEventId);

Description

Cancel an outstanding audio resource notification.

Parameters

TUid aNotificationEventId

uid of event to cancel


ControllerImplementationInformationL()

IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();

Description

Returns the controller implementation information associated with the current controller, if any.

Return value

const CMMFControllerImplementationInformation &

The controller implementation structure associated with the controller

Leave codes

KErrNotFound

if no controller is in use.


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

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

Description

Send a synchronous custom command to the playback controller, if ones exists.

Parameters

const TPckgBuf &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

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

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

TInt

A standard system error code


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);

Description

Send a synchronous custom command to the playback controller, if ones exists.

Parameters

const TPckgBuf &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

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

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

The 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

TInt

A standard system error code


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);

Description

Send an asynchronous custom command to the playback controller, if ones exists.

Parameters

const TPckgBuf &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

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

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.


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);

Description

Send an asynchronous custom command to the playback controller, if ones exists.

Parameters

const TPckgBuf &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

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

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

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