MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

ResourcePolicy::AudioResource Class Reference

The AudioResource class represents the audio device. More...

Inherits QObject, and ResourcePolicy::Resource.

Collaboration diagram for ResourcePolicy::AudioResource:
Collaboration graph
[legend]

List of all members.

Signals

void  audioPropertiesChanged (const QString &group, quint32 pid, const QString &name, const QString &value)
  This signal is emitted when any of the properties of the AudioResource are changed.

Public Member Functions

  AudioResource (const QString &audioGroup=QString())
  The constructor.
virtual  ~AudioResource ()
  The destructor.
QString  audioGroup () const
  Accessor for the audioGroup.
bool  audioGroupIsSet () const
  A test to check whether the audio group is set or not.
void  setAudioGroup (const QString &newGroup)
  Sets the audio group (classification).
quint32  processID () const
void  setProcessID (quint32 newPID)
  Use this to indicate to the Resource Manager the PID of the audio Indicates to the Resource Manager the PID of the audio stream renderer.
QString  streamTagName () const
QString  streamTagValue () const
bool  streamTagIsSet () const
  A test to check whether the stream tag has been set or not.
void  setStreamTag (const QString &name, const QString &value)
  Set the stream tag to help policy to correctly identify the audio stream belonging to you.
virtual ResourceType  type () const
  Checks the type of Resource.
bool  isOptional () const
  Whether or not this resource is optional, in that it does not need to be available for the set to be acquired.
void  setOptional (bool resourceIsOptional=true)
  Sets the resource to be optional or mandatory.
bool  isGranted () const
  Whether or not the resource to be shared.

Detailed Description

The AudioResource class represents the audio device.

It is a bit different from other resource types in that in takes more parameters to allow the programmer to classify the audio stream used by the application.


Constructor & Destructor Documentation

ResourcePolicy::AudioResource::AudioResource ( const QString audioGroup = QString()  ) 

The constructor.

Parameters:
audioGroup  The audio group which this application belongs to. This is an optional parameter.

Member Function Documentation

void ResourcePolicy::AudioResource::setAudioGroup ( const QString newGroup  ) 

Sets the audio group (classification).

Parameters:
newGroup  The new audio group to set.
quint32 ResourcePolicy::AudioResource::processID (  )  const
Returns:
The PID of the process which is responsible for rendering the audio stream.
void ResourcePolicy::AudioResource::setProcessID ( quint32  newPID  ) 

Use this to indicate to the Resource Manager the PID of the audio Indicates to the Resource Manager the PID of the audio stream renderer.

Parameters:
newPID  Set this to the PID of the process which will render the audio.
newPID  Sets this to the PID of the process which will render the audio.
QString ResourcePolicy::AudioResource::streamTagName (  )  const
Returns:
the name of the stream tag.
QString ResourcePolicy::AudioResource::streamTagValue (  )  const
Returns:
the value of the stream tag.
void ResourcePolicy::AudioResource::setStreamTag ( const QString name,
const QString value  
)

Set the stream tag to help policy to correctly identify the audio stream belonging to you.

Parameters:
name  The name of the tag. For example "media.name".
value  The value of the stream tag.
virtual ResourceType ResourcePolicy::AudioResource::type (  )  const [virtual]

Checks the type of Resource.

Returns:
The ResourceType associated to this resource

Implements ResourcePolicy::Resource.

void ResourcePolicy::AudioResource::audioPropertiesChanged ( const QString group,
quint32  pid,
const QString name,
const QString value  
) [signal]

This signal is emitted when any of the properties of the AudioResource are changed.

This signal is connected to in the ResourceSet to track the changes to the AudioResource object.

Parameters:
group  The new audio group
pid  The new PID of the audio renderer
name  The new stream tag name
value  the new stream tag value
bool ResourcePolicy::Resource::isOptional (  )  const [inherited]

Whether or not this resource is optional, in that it does not need to be available for the set to be acquired.

Returns:
true when this resource is optional
void ResourcePolicy::Resource::setOptional ( bool  resourceIsOptional = true  )  [inherited]

Sets the resource to be optional or mandatory.

Parameters:
resourceIsOptional  This optional parameter is true by default. The default, true, results in the resource becoming optional. When it is set to false the resource becomes mandatory.
bool ResourcePolicy::Resource::isGranted (  )  const [inherited]

Whether or not the resource to be shared.

If it is shared then other programs are allowed to share this resource.

Returns:
true when this resource is shared

Copyright (C) 2011 Nokia Corporation.
LGPL This file is part of libresourceqt
MeeGo 1.2 Harmattan API