[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [phonon/five] src: Remove old disabled VideoPlayer class, superseeded by Player
From:       Casian Andrei <skeletk13 () gmail ! com>
Date:       2014-08-01 7:49:57
Message-ID: E1XD7bB-0006r7-Cm () scm ! kde ! org
[Download RAW message or body]

Git commit 74616fc8ab064b116b2e2f662ef72530b7821bb6 by Casian Andrei.
Committed on 01/08/2014 at 07:33.
Pushed by casianandrei into branch 'five'.

Remove old disabled VideoPlayer class, superseeded by Player

M  +0    -1    src/CMakeLists.txt
D  +0    -211  src/video/videoplayer.cpp
D  +0    -204  src/video/videoplayer.h

http://commits.kde.org/phonon/74616fc8ab064b116b2e2f662ef72530b7821bb6

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a622a7b..95060b9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -57,7 +57,6 @@ ${phonon_LIB_SRCS}
 #    swiftslider.cpp
 #    volumefadereffect.cpp
 #    volumeslider.cpp
-#    videoplayer.cpp
     video/videoitem.cpp
 
 # QTC Compat
diff --git a/src/video/videoplayer.cpp b/src/video/videoplayer.cpp
deleted file mode 100644
index 8fec724..0000000
--- a/src/video/videoplayer.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2004-2007 Matthias Kretz <kretz@kde.org>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) version 3, or any
-    later version accepted by the membership of KDE e.V. (or its
-    successor approved by the membership of KDE e.V.), Nokia Corporation 
-    (or its successors, if any) and the KDE Free Qt Foundation, which shall
-    act as a proxy defined in Section 6 of version 3 of the license.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public 
-    License along with this library.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "videoplayer.h"
-#include "mediaobject.h"
-#include "audiooutput.h"
-#include "videowidget.h"
-#include "path.h"
-#include <QBoxLayout>
-#include <QtCore/QEvent>
-
-#ifndef QT_NO_PHONON_VIDEOPLAYER
-
-namespace Phonon
-{
-
-class VideoPlayerPrivate
-{
-    public:
-        VideoPlayerPrivate()
-            : player(0)
-            , aoutput(0)
-            , voutput(0)
-            , category(Phonon::NoCategory)
-            , initialized(false) {}
-
-        void ensureCreated() const;
-
-        mutable MediaObject *player;
-        mutable AudioOutput *aoutput;
-        mutable VideoWidget *voutput;
-
-        mutable MediaSource src;
-        mutable Phonon::Category category;
-        mutable bool initialized;
-        VideoPlayer *q_ptr;
-};
-
-void VideoPlayerPrivate::ensureCreated() const
-{
-    if (!initialized) {
-        initialized = true;
-        QVBoxLayout *layout = new QVBoxLayout(q_ptr);
-        layout->setMargin(0);
-
-        aoutput = new AudioOutput(category, q_ptr);
-        voutput = new VideoWidget(q_ptr);
-        layout->addWidget(voutput);
-
-        player = new MediaObject(q_ptr);
-        Phonon::createPath(player, aoutput);
-        Phonon::createPath(player, voutput);
-
-        q_ptr->connect(player, SIGNAL(finished()), SIGNAL(finished()));
-    }
-}
-
-VideoPlayer::VideoPlayer(Phonon::Category category, QWidget *parent)
-    : QWidget(parent)
-    , d(new VideoPlayerPrivate)
-{
-    d->q_ptr = this;
-    d->category = category;
-}
-
-VideoPlayer::VideoPlayer(QWidget *parent)
-    : QWidget(parent)
-    , d(new VideoPlayerPrivate)
-{
-    d->q_ptr = this;
-    d->category = Phonon::VideoCategory;
-}
-
-VideoPlayer::~VideoPlayer()
-{
-    delete d;
-}
-
-MediaObject *VideoPlayer::mediaObject() const
-{
-    d->ensureCreated();
-    return d->player;
-}
-
-AudioOutput *VideoPlayer::audioOutput() const
-{
-    d->ensureCreated();
-    return d->aoutput;
-}
-
-VideoWidget *VideoPlayer::videoWidget() const
-{
-    d->ensureCreated();
-    return d->voutput;
-}
-
-void VideoPlayer::load(const MediaSource &source)
-{
-    d->ensureCreated();
-    d->player->setCurrentSource(source);
-}
-
-void VideoPlayer::play(const MediaSource &source)
-{
-    d->ensureCreated();
-    if (source == d->player->currentSource()) {
-        if (!isPlaying())
-            d->player->play();
-        return;
-    }
-    // new URL
-    d->player->setCurrentSource(source);
-        
-    if (ErrorState == d->player->state())
-        return;
-
-    d->player->play();
-}
-
-void VideoPlayer::play()
-{
-    d->ensureCreated();
-    d->player->play();
-}
-
-void VideoPlayer::pause()
-{
-    d->ensureCreated();
-    d->player->pause();
-}
-
-void VideoPlayer::stop()
-{
-    d->ensureCreated();
-    d->player->stop();
-}
-
-qint64 VideoPlayer::totalTime() const
-{
-    d->ensureCreated();
-    return d->player->totalTime();
-}
-
-qint64 VideoPlayer::currentTime() const
-{
-    d->ensureCreated();
-    return d->player->currentTime();
-}
-
-void VideoPlayer::seek(qint64 ms)
-{
-    d->ensureCreated();
-    d->player->seek(ms);
-}
-
-float VideoPlayer::volume() const
-{
-    d->ensureCreated();
-    return d->aoutput->volume();
-}
-
-void VideoPlayer::setVolume(float v)
-{
-    d->ensureCreated();
-    d->aoutput->setVolume(v);
-}
-
-bool VideoPlayer::isPlaying() const
-{
-    d->ensureCreated();
-    return (d->player->state() == PlayingState);
-}
-
-bool VideoPlayer::isPaused() const
-{
-    d->ensureCreated();
-    return (d->player->state() == PausedState);
-}
-
-bool VideoPlayer::event(QEvent *e) {
-    if (e->type() == QEvent::Show)
-        d->ensureCreated();
-    return QWidget::event(e);
-}
-
-} // namespaces
-
-#endif //QT_NO_PHONON_VIDEOPLAYER
-
-#include "moc_videoplayer.cpp"
-
-// vim: sw=4 ts=4
diff --git a/src/video/videoplayer.h b/src/video/videoplayer.h
deleted file mode 100644
index 4301527..0000000
--- a/src/video/videoplayer.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2004-2007 Matthias Kretz <kretz@kde.org>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) version 3, or any
-    later version accepted by the membership of KDE e.V. (or its
-    successor approved by the membership of KDE e.V.), Nokia Corporation 
-    (or its successors, if any) and the KDE Free Qt Foundation, which shall
-    act as a proxy defined in Section 6 of version 3 of the license.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public 
-    License along with this library.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef Phonon_VIDEOPLAYER_H
-#define Phonon_VIDEOPLAYER_H
-
-#include "phononexport.h"
-#include "phononglobal.h"
-#include "mediasource.h"
-#include <QWidget>
-
-
-#ifndef QT_NO_PHONON_VIDEOPLAYER
-
-namespace Phonon
-{
-class VideoPlayerPrivate;
-class MediaObject;
-class AudioOutput;
-class VideoWidget;
-
-/** \class VideoPlayer videoplayer.h phonon/VideoPlayer
- * \short Playback class for simple tasks.
- *
- * With %VideoPlayer you can get results quickly and easily. You can do the standard
- * playback tasks like play, pause and stop, but also set a playback volume and
- * seek (there's no guarantee that the seek will work, though).
- *
- * Keep in mind that when the %VideoPlayer instance is deleted the playback will
- * stop.
- *
- * A play and forget code example:
- * \code
- * VideoPlayer *player = new VideoPlayer(parentWidget);
- * connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
- * player->play(url);
- * \endcode
- *
- * \ingroup Playback
- * \ingroup PhononVideo
- * \author Matthias Kretz <kretz@kde.org>
- */
-class PHONON_EXPORT VideoPlayer : public QWidget
-{
-    Q_OBJECT
-    public:
-        /**
-         * Constructs a new %VideoPlayer instance.
-         *
-         * \param category The category used for the audio output device.
-         * \param parent The QObject parent.
-         */
-        explicit VideoPlayer(Phonon::Category category, QWidget *parent = 0);
-
-        /**
-         * Constructs a new video widget with a \p parent
-         * using Phonon::VideoCategory as its category.
-         *
-         * \param parent The QObject parent.
-         */
-        VideoPlayer(QWidget *parent = 0);
-
-        /**
-         * On destruction the playback is stopped, also the audio output is
-         * removed so that the desktop mixer will not show the application
-         * anymore. If you need a persistent audio output don't use
-         * %VideoPlayer but MediaObject, VideoPath and VideoOutput.
-         */
-        ~VideoPlayer();
-
-        /**
-         * Get the total time (in milliseconds) of the file currently being played.
-         */
-        qint64 totalTime() const;
-        /**
-         * Get the current time (in milliseconds) of the file currently being played.
-         */
-        qint64 currentTime() const;
-        /**
-         * This is the current volume of the output as voltage factor.
-         *
-         * 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%
-         */
-        float volume() const;
-
-        /**
-         * \returns \c true if it is currently playing
-         * \returns \c false if it is currently stopped or paused
-         */
-        bool isPlaying() const;
-        /**
-         * \returns \c true if it is currently paused
-         * \returns \c false if it is currently playing or stopped
-         */
-        bool isPaused() const;
-
-        /**
-         * getter for the MediaObject.
-         */
-        MediaObject *mediaObject() const;
-
-        /**
-         * getter for the AudioOutput.
-         */
-        AudioOutput *audioOutput() const;
-
-        /**
-         * getter for the VideoWidget.
-         */
-        VideoWidget *videoWidget() const;
-
-    public Q_SLOTS:
-        /**
-         * Starts preloading the media data and fill audiobuffers in the
-         * backend.
-         *
-         * When there's already a media playing (or paused) it will be stopped
-         * (the finished signal will not be emitted).
-         */
-        void load(const Phonon::MediaSource &source);
-
-        /**
-         * Play the media at the given URL. Starts playback as fast as possible.
-         * This can take a considerable time depending on the URL and the
-         * backend.
-         *
-         * If you need low latency between calling play() and the sound actually
-         * starting to play on your output device you need to use MediaObject
-         * and be able to set the URL before calling play(). Note that
-         * \code
-         * audioPlayer->load(url);
-         * audioPlayer->play();
-         * \endcode
-         * doesn't make a difference: the application should be idle between the
-         * load and play calls so that the backend can start preloading the
-         * media and fill audio buffers.
-         */
-        void play(const Phonon::MediaSource &source);
-
-        /**
-         * Continues playback of a paused media. Restarts playback of a stopped
-         * media.
-         */
-        void play();
-        /**
-         * Pauses the playback.
-         */
-        void pause();
-        /**
-         * Stops the playback.
-         */
-        void stop();
-
-        /**
-         * Seeks to the requested time. Note that the backend is free to ignore
-         * the seek request if the media source isn't seekable.
-         *
-         * \param ms Time in milliseconds from the start of the media.
-         */
-        void seek(qint64 ms);
-        /**
-         * Sets the volume of the output as voltage factor.
-         *
-         * 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%
-         */
-        void setVolume(float volume);
-
-    Q_SIGNALS:
-        /**
-         * This signal is emitted when the playback finished.
-         */
-        void finished();
-
-    protected:
-        bool event(QEvent *);
-        VideoPlayerPrivate *const d;
-};
-
-} //namespace Phonon
-
-#endif //QT_NO_PHONON_VIDEOPLAYER
-
-
-#endif // Phonon_VIDEOPLAYER_H
-// vim: sw=4 ts=4 tw=80
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic