Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Properties | List of all members
Phonon::VideoWidget Class Reference

Widget to display video. More...

#include <phonon/VideoWidget>

Inheritance diagram for Phonon::VideoWidget:
Phonon::AbstractVideoOutput Phonon::MediaNode

Public Types

enum  AspectRatio { AspectRatioAuto = 0, AspectRatioWidget = 1, AspectRatio4_3 = 2, AspectRatio16_9 = 3 }
 
enum  ScaleMode { FitInView = 0, ScaleAndCrop = 1 }
 

Public Slots

void setFullScreen (bool fullscreen)
 
void exitFullScreen ()
 
void enterFullScreen ()
 
void setAspectRatio (AspectRatio)
 
void setScaleMode (ScaleMode)
 
void setBrightness (qreal value)
 
void setContrast (qreal value)
 
void setHue (qreal value)
 
void setSaturation (qreal value)
 

Public Member Functions

 VideoWidget (QWidget *parent=0)
 
AspectRatio aspectRatio () const
 
ScaleMode scaleMode () const
 
qreal brightness () const
 
qreal contrast () const
 
qreal hue () const
 
qreal saturation () const
 
QImage snapshot () const
 

Protected Member Functions

 VideoWidget (VideoWidgetPrivate &d, QWidget *parent)
 
void mouseMoveEvent (QMouseEvent *)
 
bool event (QEvent *)
 
- Protected Member Functions inherited from Phonon::AbstractVideoOutput
 AbstractVideoOutput (AbstractVideoOutputPrivate &d)
 
- Protected Member Functions inherited from Phonon::MediaNode
 MediaNode (MediaNodePrivate &dd)
 

Properties

bool fullScreen
 
AspectRatio aspectRatio
 
ScaleMode scaleMode
 
qreal brightness
 
qreal contrast
 
qreal hue
 
qreal saturation
 

Additional Inherited Members

- Protected Attributes inherited from Phonon::MediaNode
MediaNodePrivate *const k_ptr
 

Detailed Description

Widget to display video.

This widget shows the video signal.

MediaObject *media = new MediaObject(parent);
VideoWidget *vwidget = new VideoWidget(parent);
Phonon::createPath(media, vwidget);
Author
Matthias Kretz kretz.nosp@m.@kde.nosp@m..org

Member Enumeration Documentation

Defines the width:height to be used for the video.

Enumerator
AspectRatioAuto 

Let the decoder find the aspect ratio automatically from the media file (this is the default).

AspectRatioWidget 

Fits the video into the widget making the aspect ratio depend solely on the size of the widget. This way the aspect ratio is freely resizeable by the user.

AspectRatio4_3 

Make width/height == 4/3, which is the old TV size and monitor size (1024/768 == 4/3). (4:3)

AspectRatio16_9 

Make width/height == 16/9, which is the size of most current media. (16:9)

Constructor & Destructor Documentation

Phonon::VideoWidget::VideoWidget ( QWidget *  parent = 0)

Constructs a new video widget with a parent.

Member Function Documentation

void Phonon::VideoWidget::enterFullScreen ( )
slot

Convenience slot, calling setFullScreen(true)

void Phonon::VideoWidget::exitFullScreen ( )
slot

Convenience slot, calling setFullScreen(false)

Property Documentation

AspectRatio Phonon::VideoWidget::aspectRatio
readwrite

Defaults to AspectRatioAuto.

See Also
AspectRatio
qreal Phonon::VideoWidget::brightness
readwrite

This property holds brightness of the video.

Default is 0. Acceptable values are in range of -1, 1.

qreal Phonon::VideoWidget::contrast
readwrite

This property holds the contrast of the video.

Default is 0. Acceptable values are in range of -1, 1.

bool Phonon::VideoWidget::fullScreen
readwrite

This property holds whether the video is shown using the complete screen.

The property differs from QWidget::fullScreen in that it is writeable.

By default the widget is not shown in fullScreen.

Warning
When switching the video to fullscreen using setFullScreen your application loses control over the widget that actually shows the video (which is then shown as a toplevel window while your application still uses this widget). If you only need to capture key events the event forwarding done internally should suffice for your needs. If you need to map mouse coordinates or add widgets (that are not overlays) you should probably handle fullscreen yourself.
qreal Phonon::VideoWidget::hue
readwrite

This property holds the hue of the video.

Default is 0. Acceptable values are in range of -1, 1.

qreal Phonon::VideoWidget::saturation
readwrite

This property holds saturation of the video.

Default is 0. Acceptable values are in range of -1, 1.

ScaleMode Phonon::VideoWidget::scaleMode
readwrite

If the size of the widget and the size of the video are not equal. The video will be zoomed to fit the widget. The smaller zoom (AddBarsScaleMode) adds black bars at the left/right or top/bottom to make all of the image visible (default). The bigger zoom (ExpandMode) fills the widget completely, keeping all information in one direction and leaving parts of the image outside of the widget in the other direction.


The documentation for this class was generated from the following files: