Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / phonon / xine / brightnesscontrol.cpp
blob818577881fb6375f9a4f2393c4722db11d6e4aea
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"
23 #include <kdebug.h>
25 namespace Phonon
27 namespace Xine
30 BrightnessControl::BrightnessControl(QObject *parent)
31 : VideoEffect(1, parent)
32 , m_brightness(100)
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)
49 newBrightness = 0;
50 else if (newBrightness > 65535)
51 newBrightness = 65535;
52 if (m_brightness != newBrightness)
54 m_brightness = newBrightness;
55 XineStream *s = stream();
56 if (s) {
57 kDebug(610) << m_brightness;
58 s->setParam(XINE_PARAM_VO_BRIGHTNESS, m_brightness);
63 int BrightnessControl::upperBound() const
65 return 65535;
68 int BrightnessControl::lowerBound() const
70 return 0;
73 XineStream *BrightnessControl::stream()
75 if (path() && path()->mediaObject()) {
76 return &path()->mediaObject()->stream();
78 return 0;
81 } // namespace Xine
82 } // namespace Phonon
84 #include "brightnesscontrol.moc"
85 // vim: sw=4 ts=4