1 /*************************************************************************
2 This file is part of libresourceqt
4 Copyright (C) 2010 Nokia Corporation.
6 This library is free software; you can redistribute
7 it and/or modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation
9 version 2.1 of the License.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20 *************************************************************************/
22 * @file audio-resource.h
23 * @brief Declaration of ResourcePolicy::AudioResource resource class.
25 * @copyright Copyright (C) 2010 Nokia Corporation.
26 * @author Wolf Bergenheim
29 * This file is part of libresourceqt
31 * Copyright (C) 2010 Nokia Corporation.
33 * This library is free software; you can redistribute
34 * it and/or modify it under the terms of the GNU Lesser General Public
35 * License as published by the Free Software Foundation
36 * version 2.1 of the License.
38 * This library is distributed in the hope that it will be useful,
39 * but WITHOUT ANY WARRANTY; without even the implied warranty of
40 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41 * Lesser General Public License for more details.
43 * You should have received a copy of the GNU Lesser General Public
44 * License along with this library; if not, write to the Free Software
45 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
49 #ifndef AUDIO_RESOURCE_H
50 #define AUDIO_RESOURCE_H
54 #include <policy/resource.h>
56 namespace ResourcePolicy
60 * The AudioResource class represents the audio device. It is a bit
61 * different from other resource types in that in takes more parameters to
62 * allow the programmer to classify the audio stream used by the application.
64 class AudioResource: public QObject, public Resource
70 * \param audioGroup The audio group which this application belongs to.
71 * This is an optional parameter.
73 AudioResource(const QString &audioGroup = QString());
74 AudioResource(const AudioResource &other);
75 virtual ~AudioResource();
77 //! Accessor for the audioGroup.
78 QString audioGroup() const;
79 //! A test to check whether the audio group is set or not.
80 bool audioGroupIsSet() const;
82 * Set the audio group (classification)
83 * \param newGroup The new audio group to set.
85 void setAudioGroup(const QString & newGroup);
87 //! \return The PID of the process which is responsible for rendering the audio stream.
88 quint32 processID() const;
90 * Use this to indicate to the Resource Manager the PID of the audio
92 * \param newPID Set this to the PID of the process which will render the audio.
94 void setProcessID(quint32 newPID);
96 //! \return the name of the stream tag.
97 QString streamTagName() const;
98 //! \return the value of the stream tag.
99 QString streamTagValue() const;
100 //! A test to check whether the stream tag has been set or not.
101 bool streamTagIsSet() const;
103 * Set the tream tag to help policy to correctly identify the audio stream
105 * \param name The name of the tag. For example "media.name"
106 * \param value The value of the stream tag.
108 void setStreamTag(const QString &name, const QString &value);
110 virtual ResourceType type() const;
118 * This signal is emitted when any of the properties of the AudioResource
119 * are changed. This signal is connected to in the ResourceSet to
120 * track the changes to the AudioResource object.
121 * \param group The new audio group
122 * \param pid The new PID of the audio renderer
123 * \param name The new Stream tag name
124 * \param value the new stream tag value
126 void audioPropertiesChanged(const QString &group, quint32 pid,
127 const QString &name, const QString &value);