author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 02 Feb 2010 00:43:10 +0200 | |
changeset 3 | 41300fa6a67c |
parent 0 | 1918ee327afb |
child 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/* This file is part of the KDE project. |
2 |
||
3 |
Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 |
||
5 |
This library is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Lesser General Public License as published by |
|
7 |
the Free Software Foundation, either version 2.1 or 3 of the License. |
|
8 |
||
9 |
This library is distributed in the hope that it will be useful, |
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
GNU Lesser General Public License for more details. |
|
13 |
||
14 |
You should have received a copy of the GNU Lesser General Public License |
|
15 |
along with this library. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
||
17 |
*/ |
|
18 |
||
19 |
#include "mediaobject.h" |
|
20 |
||
21 |
#include "abstractaudioeffect.h" |
|
22 |
||
23 |
QT_BEGIN_NAMESPACE |
|
24 |
||
25 |
using namespace Phonon; |
|
26 |
using namespace Phonon::MMF; |
|
27 |
||
28 |
/*! \class MMF::AbstractAudioEffect |
|
29 |
\internal |
|
30 |
*/ |
|
31 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
32 |
/*! \namespace Phonon::MMF |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
33 |
\internal |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
34 |
*/ |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
35 |
|
0 | 36 |
AbstractAudioEffect::AbstractAudioEffect(QObject *parent, |
37 |
const QList<EffectParameter> ¶ms) : MediaNode::MediaNode(parent) |
|
38 |
, m_params(params) |
|
39 |
{ |
|
40 |
} |
|
41 |
||
42 |
bool AbstractAudioEffect::disconnectMediaNode(MediaNode *target) |
|
43 |
{ |
|
44 |
MediaNode::disconnectMediaNode(target); |
|
45 |
m_effect.reset(); |
|
46 |
return true; |
|
47 |
} |
|
48 |
||
49 |
QList<EffectParameter> AbstractAudioEffect::parameters() const |
|
50 |
{ |
|
51 |
return m_params; |
|
52 |
} |
|
53 |
||
54 |
QVariant AbstractAudioEffect::parameterValue(const EffectParameter &queriedParam) const |
|
55 |
{ |
|
56 |
const QVariant &val = m_values.value(queriedParam.id()); |
|
57 |
||
58 |
if (val.isNull()) |
|
59 |
return queriedParam.defaultValue(); |
|
60 |
else |
|
61 |
return val; |
|
62 |
} |
|
63 |
||
64 |
bool AbstractAudioEffect::activateOnMediaObject(MediaObject *mo) |
|
65 |
{ |
|
66 |
AudioPlayer *const ap = qobject_cast<AudioPlayer *>(mo->abstractPlayer()); |
|
67 |
||
68 |
if (ap) |
|
69 |
return activateOn(ap->player()); |
|
70 |
else |
|
71 |
return true; |
|
72 |
} |
|
73 |
||
74 |
void AbstractAudioEffect::setParameterValue(const EffectParameter ¶m, |
|
75 |
const QVariant &newValue) |
|
76 |
{ |
|
77 |
m_values.insert(param.id(), newValue); |
|
78 |
parameterChanged(param.id(), newValue); |
|
79 |
} |
|
80 |
||
81 |
QT_END_NAMESPACE |
|
82 |