1 /* This file is part of the KDE project
2 Copyright (C) 2006 Matthias Kretz <kretz@kde.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
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 GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 #include "brightnesscontrol.h"
22 #include "mediaobject.h"
30 BrightnessControl::BrightnessControl(QObject
*parent
)
31 : VideoEffect(1, parent
)
36 BrightnessControl::~BrightnessControl()
40 void BrightnessControl::setPath(VideoPath
*path
)
42 VideoEffect::setPath(path
);
43 //TODO find output and set brightness
46 void BrightnessControl::setBrightness(int newBrightness
)
48 if (newBrightness
< 0)
50 else if (newBrightness
> 65535)
51 newBrightness
= 65535;
52 if (m_brightness
!= newBrightness
)
54 m_brightness
= newBrightness
;
55 XineStream
*s
= stream();
57 kDebug(610) << m_brightness
;
58 s
->setParam(XINE_PARAM_VO_BRIGHTNESS
, m_brightness
);
63 int BrightnessControl::upperBound() const
68 int BrightnessControl::lowerBound() const
73 XineStream
*BrightnessControl::stream()
75 if (path() && path()->mediaObject()) {
76 return &path()->mediaObject()->stream();
84 #include "brightnesscontrol.moc"