videoplayer.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2004-2007 Matthias Kretz <kretz@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Lesser General Public
00006     License as published by the Free Software Foundation; either
00007     version 2.1 of the License, or (at your option) version 3, or any
00008     later version accepted by the membership of KDE e.V. (or its
00009     successor approved by the membership of KDE e.V.), Nokia Corporation 
00010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
00011     act as a proxy defined in Section 6 of version 3 of the license.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public 
00019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifndef Phonon_VIDEOPLAYER_H
00024 #define Phonon_VIDEOPLAYER_H
00025 
00026 #include "phonon_export.h"
00027 #include "phononnamespace.h"
00028 #include "mediasource.h"
00029 #include <QtGui/QWidget>
00030 
00031 QT_BEGIN_HEADER
00032 QT_BEGIN_NAMESPACE
00033 
00034 #ifndef QT_NO_PHONON_VIDEOPLAYER
00035 
00036 namespace Phonon
00037 {
00038 class VideoPlayerPrivate;
00039 class MediaObject;
00040 class AudioOutput;
00041 class VideoWidget;
00042 
00064 class PHONON_EXPORT VideoPlayer : public QWidget
00065 {
00066     Q_OBJECT
00067     public:
00074         explicit VideoPlayer(Phonon::Category category, QWidget *parent = 0);
00075 
00082         VideoPlayer(QWidget *parent = 0);
00083 
00090         ~VideoPlayer();
00091 
00095         qint64 totalTime() const;
00099         qint64 currentTime() const;
00105         float volume() const;
00106 
00111         bool isPlaying() const;
00116         bool isPaused() const;
00117 
00121         MediaObject *mediaObject() const;
00122 
00126         AudioOutput *audioOutput() const;
00127 
00131         VideoWidget *videoWidget() const;
00132 
00133     public Q_SLOTS:
00141         void load(const Phonon::MediaSource &source);
00142 
00159         void play(const Phonon::MediaSource &source);
00160 
00165         void play();
00169         void pause();
00173         void stop();
00174 
00181         void seek(qint64 ms);
00187         void setVolume(float volume);
00188 
00189     Q_SIGNALS:
00193         void finished();
00194 
00195     protected:
00196         VideoPlayerPrivate *const d;
00197 };
00198 
00199 } //namespace Phonon
00200 
00201 #endif //QT_NO_PHONON_VIDEOPLAYER
00202 
00203 QT_END_NAMESPACE
00204 QT_END_HEADER
00205 
00206 #endif // Phonon_VIDEOPLAYER_H
00207 // vim: sw=4 ts=4 tw=80