| 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 | #ifndef PHONON_VIDEOWIDGET_H
 | 
|---|
| 19 | #define PHONON_VIDEOWIDGET_H
 | 
|---|
| 20 | 
 | 
|---|
| 21 | #include <QtGui/QWidget>
 | 
|---|
| 22 | #include <phonon/videowidgetinterface.h>
 | 
|---|
| 23 | #include "backendnode.h"
 | 
|---|
| 24 | 
 | 
|---|
| 25 | QT_BEGIN_NAMESPACE
 | 
|---|
| 26 | 
 | 
|---|
| 27 | #ifndef QT_NO_PHONON_VIDEO
 | 
|---|
| 28 | 
 | 
|---|
| 29 | namespace Phonon
 | 
|---|
| 30 | {
 | 
|---|
| 31 |     namespace DS9
 | 
|---|
| 32 |     {
 | 
|---|
| 33 |         class VideoWindow;
 | 
|---|
| 34 |         class AbstractVideoRenderer;
 | 
|---|
| 35 | 
 | 
|---|
| 36 |         class VideoWidget : public BackendNode, public Phonon::VideoWidgetInterface
 | 
|---|
| 37 |         {
 | 
|---|
| 38 |             enum RendererType
 | 
|---|
| 39 |             {
 | 
|---|
| 40 |                 Native = 0,
 | 
|---|
| 41 |                 NonNative = 1
 | 
|---|
| 42 |             };
 | 
|---|
| 43 | 
 | 
|---|
| 44 |             Q_OBJECT
 | 
|---|
| 45 |                 Q_INTERFACES(Phonon::VideoWidgetInterface)
 | 
|---|
| 46 |         public:
 | 
|---|
| 47 |             VideoWidget(QWidget *parent = 0);
 | 
|---|
| 48 |             ~VideoWidget();
 | 
|---|
| 49 | 
 | 
|---|
| 50 |             Phonon::VideoWidget::AspectRatio aspectRatio() const;
 | 
|---|
| 51 |             void setAspectRatio(Phonon::VideoWidget::AspectRatio aspectRatio);
 | 
|---|
| 52 |             Phonon::VideoWidget::ScaleMode scaleMode() const;
 | 
|---|
| 53 |             void setScaleMode(Phonon::VideoWidget::ScaleMode);
 | 
|---|
| 54 |             qreal brightness() const;
 | 
|---|
| 55 |             void setBrightness(qreal);
 | 
|---|
| 56 |             qreal contrast() const;
 | 
|---|
| 57 |             void setContrast(qreal);
 | 
|---|
| 58 |             qreal hue() const;
 | 
|---|
| 59 |             void setHue(qreal);
 | 
|---|
| 60 |             qreal saturation() const;
 | 
|---|
| 61 |             void setSaturation(qreal);
 | 
|---|
| 62 | 
 | 
|---|
| 63 |             void setCurrentGraph(int index);
 | 
|---|
| 64 | 
 | 
|---|
| 65 |             QWidget *widget();
 | 
|---|
| 66 | 
 | 
|---|
| 67 |             void notifyVideoLoaded();
 | 
|---|
| 68 |             AbstractVideoRenderer *switchRendering(AbstractVideoRenderer *current);
 | 
|---|
| 69 |             void performSoftRendering(const QImage ¤tImage);
 | 
|---|
| 70 | 
 | 
|---|
| 71 |             //apply contrast/brightness/hue/saturation
 | 
|---|
| 72 |             void applyMixerSettings() const;
 | 
|---|
| 73 |             void updateVideoSize() const;
 | 
|---|
| 74 | 
 | 
|---|
| 75 |         protected:
 | 
|---|
| 76 |             virtual void connected(BackendNode *, const InputPin& inpin);
 | 
|---|
| 77 | 
 | 
|---|
| 78 |         private:
 | 
|---|
| 79 |             AbstractVideoRenderer *getRenderer(int graphIndex, RendererType type, bool autoCreate = false);
 | 
|---|
| 80 | 
 | 
|---|
| 81 |             Phonon::VideoWidget::AspectRatio m_aspectRatio;
 | 
|---|
| 82 |             Phonon::VideoWidget::ScaleMode m_scaleMode;
 | 
|---|
| 83 | 
 | 
|---|
| 84 |             VideoWindow *m_widget;
 | 
|---|
| 85 |             qreal m_brightness, m_contrast, m_hue, m_saturation;
 | 
|---|
| 86 |             AbstractVideoRenderer* m_renderers[4];
 | 
|---|
| 87 |             mutable bool m_noNativeRendererSupported;
 | 
|---|
| 88 |         };
 | 
|---|
| 89 |     }
 | 
|---|
| 90 | }
 | 
|---|
| 91 | 
 | 
|---|
| 92 | QT_END_NAMESPACE
 | 
|---|
| 93 | 
 | 
|---|
| 94 | #endif // PHONON_VIDEOWIDGET_H
 | 
|---|
| 95 | 
 | 
|---|
| 96 | #endif //QT_NO_PHONON_VIDEO
 | 
|---|