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 |
child 7 | f7bc934e204c |
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 |
#include "utils.h" |
|
21 |
#include "videooutput.h" |
|
22 |
||
23 |
#include "videowidget.h" |
|
24 |
||
25 |
QT_BEGIN_NAMESPACE |
|
26 |
||
27 |
using namespace Phonon; |
|
28 |
using namespace Phonon::MMF; |
|
29 |
||
30 |
/*! \class MMF::VideoWidget |
|
31 |
\internal |
|
32 |
*/ |
|
33 |
||
34 |
//----------------------------------------------------------------------------- |
|
35 |
// Constants |
|
36 |
//----------------------------------------------------------------------------- |
|
37 |
||
38 |
static const qreal DefaultBrightness = 1.0; |
|
39 |
static const qreal DefaultContrast = 1.0; |
|
40 |
static const qreal DefaultHue = 1.0; |
|
41 |
static const qreal DefaultSaturation = 1.0; |
|
42 |
||
43 |
||
44 |
//----------------------------------------------------------------------------- |
|
45 |
// Constructor / destructor |
|
46 |
//----------------------------------------------------------------------------- |
|
47 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
48 |
MMF::VideoWidget::VideoWidget |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
49 |
(AncestorMoveMonitor* ancestorMoveMonitor, QWidget* parent) |
0 | 50 |
: MediaNode(parent) |
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
51 |
, m_videoOutput(new VideoOutput(ancestorMoveMonitor, parent)) |
0 | 52 |
, m_brightness(DefaultBrightness) |
53 |
, m_contrast(DefaultContrast) |
|
54 |
, m_hue(DefaultHue) |
|
55 |
, m_saturation(DefaultSaturation) |
|
56 |
{ |
|
57 |
TRACE_CONTEXT(VideoWidget::VideoWidget, EVideoApi); |
|
58 |
TRACE_ENTRY_0(); |
|
59 |
||
60 |
TRACE_EXIT_0(); |
|
61 |
} |
|
62 |
||
63 |
MMF::VideoWidget::~VideoWidget() |
|
64 |
{ |
|
65 |
TRACE_CONTEXT(VideoWidget::~VideoWidget, EVideoApi); |
|
66 |
TRACE_ENTRY_0(); |
|
67 |
||
68 |
TRACE_EXIT_0(); |
|
69 |
} |
|
70 |
||
71 |
||
72 |
//----------------------------------------------------------------------------- |
|
73 |
// VideoWidgetInterface |
|
74 |
//----------------------------------------------------------------------------- |
|
75 |
||
76 |
Phonon::VideoWidget::AspectRatio MMF::VideoWidget::aspectRatio() const |
|
77 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
78 |
return m_videoOutput->aspectRatio(); |
0 | 79 |
} |
80 |
||
81 |
void MMF::VideoWidget::setAspectRatio |
|
82 |
(Phonon::VideoWidget::AspectRatio aspectRatio) |
|
83 |
{ |
|
84 |
TRACE_CONTEXT(VideoWidget::setAspectRatio, EVideoApi); |
|
85 |
TRACE("aspectRatio %d", aspectRatio); |
|
86 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
87 |
m_videoOutput->setAspectRatio(aspectRatio); |
0 | 88 |
} |
89 |
||
90 |
qreal MMF::VideoWidget::brightness() const |
|
91 |
{ |
|
92 |
return m_brightness; |
|
93 |
} |
|
94 |
||
95 |
void MMF::VideoWidget::setBrightness(qreal brightness) |
|
96 |
{ |
|
97 |
TRACE_CONTEXT(VideoWidget::setBrightness, EVideoApi); |
|
98 |
TRACE("brightness %f", brightness); |
|
99 |
||
100 |
m_brightness = brightness; |
|
101 |
} |
|
102 |
||
103 |
Phonon::VideoWidget::ScaleMode MMF::VideoWidget::scaleMode() const |
|
104 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
105 |
return m_videoOutput->scaleMode(); |
0 | 106 |
} |
107 |
||
108 |
void MMF::VideoWidget::setScaleMode(Phonon::VideoWidget::ScaleMode scaleMode) |
|
109 |
{ |
|
110 |
TRACE_CONTEXT(VideoWidget::setScaleMode, EVideoApi); |
|
111 |
TRACE("setScaleMode %d", setScaleMode); |
|
112 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
113 |
m_videoOutput->setScaleMode(scaleMode); |
0 | 114 |
} |
115 |
||
116 |
qreal MMF::VideoWidget::contrast() const |
|
117 |
{ |
|
118 |
return m_contrast; |
|
119 |
} |
|
120 |
||
121 |
void MMF::VideoWidget::setContrast(qreal contrast) |
|
122 |
{ |
|
123 |
TRACE_CONTEXT(VideoWidget::setContrast, EVideoApi); |
|
124 |
TRACE("contrast %f", contrast); |
|
125 |
||
126 |
m_contrast = contrast; |
|
127 |
} |
|
128 |
||
129 |
qreal MMF::VideoWidget::hue() const |
|
130 |
{ |
|
131 |
return m_hue; |
|
132 |
} |
|
133 |
||
134 |
void MMF::VideoWidget::setHue(qreal hue) |
|
135 |
{ |
|
136 |
TRACE_CONTEXT(VideoWidget::setHue, EVideoApi); |
|
137 |
TRACE("hue %f", hue); |
|
138 |
||
139 |
m_hue = hue; |
|
140 |
} |
|
141 |
||
142 |
qreal MMF::VideoWidget::saturation() const |
|
143 |
{ |
|
144 |
return m_saturation; |
|
145 |
} |
|
146 |
||
147 |
void MMF::VideoWidget::setSaturation(qreal saturation) |
|
148 |
{ |
|
149 |
TRACE_CONTEXT(VideoWidget::setSaturation, EVideoApi); |
|
150 |
TRACE("saturation %f", saturation); |
|
151 |
||
152 |
m_saturation = saturation; |
|
153 |
} |
|
154 |
||
155 |
QWidget* MMF::VideoWidget::widget() |
|
156 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
157 |
return m_videoOutput.data(); |
0 | 158 |
} |
159 |
||
160 |
bool MMF::VideoWidget::activateOnMediaObject(MediaObject *mo) |
|
161 |
{ |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
162 |
mo->setVideoOutput(m_videoOutput.data()); |
0 | 163 |
return true; |
164 |
} |
|
165 |
||
166 |
QT_END_NAMESPACE |
|
167 |