Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
videoplayer.h
1 /* This file is part of the KDE project
2  Copyright (C) 2004-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 
23 #ifndef Phonon_VIDEOPLAYER_H
24 #define Phonon_VIDEOPLAYER_H
25 
26 #include "phonon_export.h"
27 #include "phononnamespace.h"
28 #include "mediasource.h"
29 #include <QWidget>
30 
31 
32 #ifndef QT_NO_PHONON_VIDEOPLAYER
33 
34 namespace Phonon
35 {
36 class VideoPlayerPrivate;
37 class MediaObject;
38 class AudioOutput;
39 class VideoWidget;
40 
62 class PHONON_EXPORT VideoPlayer : public QWidget
63 {
64  Q_OBJECT
65  public:
72  explicit VideoPlayer(Phonon::Category category, QWidget *parent = 0);
73 
80  VideoPlayer(QWidget *parent = 0);
81 
88  ~VideoPlayer();
89 
93  qint64 totalTime() const;
97  qint64 currentTime() const;
103  float volume() const;
104 
109  bool isPlaying() const;
114  bool isPaused() const;
115 
119  MediaObject *mediaObject() const;
120 
124  AudioOutput *audioOutput() const;
125 
129  VideoWidget *videoWidget() const;
130 
131  public Q_SLOTS:
139  void load(const Phonon::MediaSource &source);
140 
157  void play(const Phonon::MediaSource &source);
158 
163  void play();
167  void pause();
171  void stop();
172 
179  void seek(qint64 ms);
185  void setVolume(float volume);
186 
187  Q_SIGNALS:
191  void finished();
192 
193  protected:
194  bool event(QEvent *);
195  VideoPlayerPrivate *const d;
196 };
197 
198 } //namespace Phonon
199 
200 #endif //QT_NO_PHONON_VIDEOPLAYER
201 
202 
203 #endif // Phonon_VIDEOPLAYER_H
204 // vim: sw=4 ts=4 tw=80