2 * qmpwidget - A Qt widget for embedding MPlayer
3 * Copyright (C) 2010 by Jonas Gehring
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
29 class QAbstractSlider
;
37 class QMPwidget
: public QWidget
40 Q_PROPERTY(State state READ state
);
41 Q_PROPERTY(double streamPosition READ tell
);
42 Q_PROPERTY(QString videoOutput READ videoOutput WRITE setVideoOutput
);
43 Q_PROPERTY(QString mplayerPath READ mplayerPath WRITE setMPlayerPath
);
44 Q_PROPERTY(QString mplayerVersion READ mplayerVersion
);
63 double framesPerSecond
;
70 QHash
<QString
, QString
> tags
;
91 QMPwidget(QWidget
*parent
= 0);
95 MediaInfo
mediaInfo() const;
97 QProcess
*process() const;
99 void setMode(Mode mode
);
102 void setVideoOutput(const QString
&output
);
103 QString
videoOutput() const;
105 void setMPlayerPath(const QString
&path
);
106 QString
mplayerPath() const;
107 QString
mplayerVersion();
109 void setSeekSlider(QAbstractSlider
*slider
);
110 void setVolumeSlider(QAbstractSlider
*slider
);
112 void showImage(const QImage
&image
);
114 virtual QSize
sizeHint() const;
117 void start(const QStringList
&args
= QStringList());
118 void load(const QString
&url
);
122 bool seek(int offset
, int whence
= AbsoluteSeek
);
123 bool seek(double offset
, int whence
= AbsoluteSeek
);
125 void toggleFullScreen();
127 void writeCommand(const QString
&command
);
129 void updateWidgetSize();
133 virtual void mouseDoubleClickEvent(QMouseEvent
*event
);
134 virtual void keyPressEvent(QKeyEvent
*event
);
135 virtual void resizeEvent(QResizeEvent
*event
);
138 void setVolume(int volume
);
141 void mpStateChanged(int state
);
142 void mpStreamPositionChanged(double position
);
143 void mpVolumeChanged(int volume
);
147 void stateChanged(int state
);
148 void error(const QString
&reason
);
150 void readStandardOutput(const QString
&line
);
151 void readStandardError(const QString
&line
);
154 QMPProcess
*m_process
;
155 QPointer
<QAbstractSlider
> m_seekSlider
;
156 QPointer
<QAbstractSlider
> m_volumeSlider
;
157 Qt::WindowFlags m_windowFlags
;
161 QString m_seekCommand
;
165 #endif // QMPWIDGET_H_