phonon/videowidget.h Source File

videowidget.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2005-2007 Matthias Kretz <kretz@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), Nokia Corporation
10  (or its successors, if any) and the KDE Free Qt Foundation, which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 
21 */
22 #ifndef Phonon_VIDEOWIDGET_H
23 #define Phonon_VIDEOWIDGET_H
24 
25 #include "phonon_export.h"
26 #include "phonondefs.h"
27 #include "abstractvideooutput.h"
28 #include <QtGui/QWidget>
29 
32 
33 class QString;
34 
35 #ifndef QT_NO_PHONON_VIDEO
36 
37 namespace Phonon
38 {
39 class AbstractVideoOutput;
40  class VideoWidgetPrivate;
57  {
59  Q_OBJECT
78  Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen)
85  Q_PROPERTY(AspectRatio aspectRatio READ aspectRatio WRITE setAspectRatio)
86 
96  Q_PROPERTY(ScaleMode scaleMode READ scaleMode WRITE setScaleMode)
97 
103  Q_PROPERTY(qreal brightness READ brightness WRITE setBrightness)
109  Q_PROPERTY(qreal contrast READ contrast WRITE setContrast)
115  Q_PROPERTY(qreal hue READ hue WRITE setHue)
121  Q_PROPERTY(qreal saturation READ saturation WRITE setSaturation)
122 
123  public:
128  {
133  AspectRatioAuto = 0,
139  AspectRatioWidget = 1,
144  AspectRatio4_3 = 2,
149  AspectRatio16_9 = 3
150 //X /**
151 //X * Assume that every pixel of the video image needs to be displayed with the same
152 //X * physical width and height. (1:1 image pixels, not imagewidth
153 //X * = imageheight)
154 //X */
155 //X AspectRatioSquare = 4,
156  };
157 
158  enum ScaleMode {
159  FitInView = 0,
160  ScaleAndCrop = 1
161  };
162 
166  VideoWidget(QWidget *parent = 0);
167 
168  AspectRatio aspectRatio() const;
169  ScaleMode scaleMode() const;
170 
171  qreal brightness() const;
172  qreal contrast() const;
173  qreal hue() const;
174  qreal saturation() const;
175  QImage snapshot() const;
176 
177  //TODO: bar colors property
178  public Q_SLOTS:
179  void setFullScreen(bool fullscreen);
180 
184  void exitFullScreen();
185 
189  void enterFullScreen();
190 
191  void setAspectRatio(AspectRatio);
192  void setScaleMode(ScaleMode);
193 
194  void setBrightness(qreal value);
195  void setContrast(qreal value);
196  void setHue(qreal value);
197  void setSaturation(qreal value);
198 
199  protected:
206  VideoWidget(VideoWidgetPrivate &d, QWidget *parent);
207 
208  void mouseMoveEvent(QMouseEvent *);
209  bool event(QEvent *);
210  };
211 
212 } //namespace Phonon
213 
214 #endif //QT_NO_PHONON_VIDEO
215 
218 
219 // vim: sw=4 ts=4 tw=80
220 #endif // Phonon_VIDEOWIDGET_H
#define QT_END_NAMESPACE
Definition: qglobal.h:128
#define Q_PROPERTY(text)
Definition: qobjectdefs.h:80
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
Widget to display video.
Definition: videowidget.h:56
#define Q_SLOTS
Definition: qobjectdefs.h:71
#define Q_ENUMS(x)
Definition: qobjectdefs.h:84
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
AspectRatio
Defines the width:height to be used for the video.
Definition: videowidget.h:127
Definition: qimage.h:87
#define Q_OBJECT
Definition: qobjectdefs.h:157
GLsizei const GLfloat * value
Definition: GLee.h:1742
The KDE Multimedia classes.
Common base class for all video outputs.
#define K_DECLARE_PRIVATE(Class)
Definition: phonondefs.h:46
#define PHONON_EXPORT
Definition: phonon_export.h:38
#define QT_END_HEADER
Definition: qglobal.h:142