188
188
#endif // QMPWIDGET_H_
189
/* BEGIN_COMMON_COPYRIGHT_HEADER
192
* Copyright: 2012 Labo A.L
194
* Aaron Lewis <the.warl0ck.1989@gmail.com>
196
* This program or library is free software; you can redistribute it
197
* and/or modify it under the terms of the GNU Lesser General Public
198
* License as published by the Free Software Foundation; either
199
* version 2.1 of the License, or (at your option) any later version.
201
* This library is distributed in the hope that it will be useful,
202
* but WITHOUT ANY WARRANTY; without even the implied warranty of
203
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
204
* Lesser General Public License for more details.
206
* You should have received a copy of the GNU Lesser General
207
* Public License along with this library; if not, write to the
208
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
209
* Boston, MA 02110-1301 USA
211
* END_COMMON_COPYRIGHT_HEADER */
213
* qmpwidget - A Qt widget for embedding MPlayer
214
* Copyright (C) 2010 by Jonas Gehring
216
* This program is free software: you can redistribute it and/or modify
217
* it under the terms of the GNU General Public License as published by
218
* the Free Software Foundation, either version 3 of the License, or
219
* (at your option) any later version.
221
* This program is distributed in the hope that it will be useful,
222
* but WITHOUT ANY WARRANTY; without even the implied warranty of
223
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
224
* GNU General Public License for more details.
226
* You should have received a copy of the GNU General Public License
227
* along with this program. If not, see <http://www.gnu.org/licenses/>.
240
class QAbstractSlider;
248
class QMPwidget : public QWidget
251
Q_PROPERTY(State state READ state)
252
Q_PROPERTY(double streamPosition READ tell)
253
Q_PROPERTY(QString videoOutput READ videoOutput WRITE setVideoOutput)
254
Q_PROPERTY(QString mplayerPath READ mplayerPath WRITE setMPlayerPath)
255
Q_PROPERTY(QString mplayerVersion READ mplayerVersion)
260
NotStartedState = -1,
274
double framesPerSecond;
281
QHash<QString, QString> tags;
302
QMPwidget(QWidget *parent = 0);
303
virtual ~QMPwidget();
306
MediaInfo mediaInfo() const;
308
QProcess *process() const;
310
void setMode(Mode mode);
313
void setVideoOutput(const QString &output);
314
QString videoOutput() const;
316
void setMPlayerPath(const QString &path);
317
QString mplayerPath() const;
318
QString mplayerVersion();
320
void setSeekSlider(QAbstractSlider *slider);
321
void setVolumeSlider(QAbstractSlider *slider);
323
void showImage(const QImage &image);
325
virtual QSize sizeHint() const;
328
void start(const QStringList &args = QStringList());
329
void load(const QString &url);
333
bool seek(int offset, int whence = AbsoluteSeek);
334
bool seek(double offset, int whence = AbsoluteSeek);
336
void toggleFullScreen();
338
void writeCommand(const QString &command);
341
virtual void mouseDoubleClickEvent(QMouseEvent *event);
342
virtual void keyPressEvent(QKeyEvent *event);
343
virtual void resizeEvent(QResizeEvent *event);
346
void updateWidgetSize();
349
void setVolume(int volume);
351
void mpStateChanged(int state);
352
void mpStreamPositionChanged(double position);
353
void mpVolumeChanged(int volume);
357
void stateChanged(int state);
358
void error(const QString &reason);
360
void readStandardOutput(const QString &line);
361
void readStandardError(const QString &line);
364
QMPProcess *m_process;
366
QPointer<QAbstractSlider> m_seekSlider;
367
QPointer<QAbstractSlider> m_volumeSlider;
368
Qt::WindowFlags m_windowFlags;
372
QString m_seekCommand;
376
#endif // QMPWIDGET_H_