»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
Multimedia TUNER »
CMMTunerAudioPlayerUtility
Location:
Tuner.h
Link against: tuner.lib
This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.
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
CBase
- Base class for all classes to be instantiated on the heap
CMMTunerAudioPlayerUtility
- The Tuner Audio Player Utility is used to initiate and control playback of audio from the tuner
Members
Defined in CMMTunerAudioPlayerUtility
:
CancelRegisterAudioResourceNotification()
, ControllerImplementationInformationL()
, CustomCommandAsync()
, CustomCommandAsync()
, CustomCommandSync()
, CustomCommandSync()
, GetBalance()
, GetPriority()
, GetVolume()
, InitializeL()
, MaxVolume()
, Mute()
, NewL()
, Play()
, RegisterAudioResourceNotification()
, SetBalance()
, SetPriority()
, SetVolume()
, SetVolumeRamp()
, Stop()
, ~CMMTunerAudioPlayerUtility()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Construction and destruction
static IMPORT_C 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 InitializeL()
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
Leave codes
KErrNoMemory |
Out of memory
|
KErrNotSupported |
If the given tuner doesn't support audio playback.
|
|
~CMMTunerAudioPlayerUtility()
virtual IMPORT_C ~CMMTunerAudioPlayerUtility();
Description
Destructor
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
on completion. This must be called before Play.
Parameters
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. InitializeL()
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.
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
|
|
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.
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
IMPORT_C TInt MaxVolume() const;
Description
Return the maximum volume supported
Return value
TInt
|
The maximum volume setting permitted
|
|
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
|
|
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()
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
Return value
CancelRegisterAudioResourceNotification()
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
Leave codes
KErrNotFound |
if no controller is in use.
|
|
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 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 |
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
|
|
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 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 |
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
|
|
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 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 |
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.
|
|
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 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 |
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.
|
|