File indexing completed on 2024-05-12 16:35:05

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2009 C. Boemann <cbo@boemann.dk>
0003  * Copyright (C) 2012 Gopalakrishna Bhat A <gopalakbhat@gmail.com>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 #ifndef FULLSCREENPLAYER_H
0021 #define FULLSCREENPLAYER_H
0022 
0023 #include <QWidget>
0024 #include <phonon/Global>
0025 
0026 namespace Phonon
0027 {
0028     class MediaObject;
0029     class VideoWidget;
0030     class AudioOutput;
0031     class SeekSlider;
0032     class VolumeSlider;
0033 }
0034 
0035 class QUrl;
0036 class QLabel;
0037 class QToolButton;
0038 
0039 /**
0040  * This class represents the click event action that starts the playing of the video.
0041  */
0042 class FullScreenPlayer : public QWidget
0043 {
0044     Q_OBJECT
0045 public:
0046     explicit FullScreenPlayer(const QUrl &);
0047 
0048     /// destructor
0049     virtual ~FullScreenPlayer();
0050 
0051 protected Q_SLOTS:
0052     void play();
0053     void pause();
0054     void stop();
0055     void mute();
0056     void unmute();
0057     void playStateChanged(Phonon::State newState, Phonon::State oldState);
0058     void muteStateChanged(bool muted);
0059     void updatePlaybackTime(qint64 currentTime);
0060 
0061 protected:
0062     void keyPressEvent(QKeyEvent *event) override; ///reimplemented
0063     void mousePressEvent(QMouseEvent *event) override; ///reimplemented
0064 
0065 
0066     Phonon::MediaObject *m_mediaObject;
0067     Phonon::VideoWidget *m_videoWidget;
0068     Phonon::AudioOutput *m_audioOutput;
0069     Phonon::SeekSlider *m_seekSlider;
0070     Phonon::VolumeSlider *m_volumeSlider;
0071 
0072     QToolButton *m_volumeIconMuted;
0073     QToolButton *m_volumeIconUnmuted;
0074     QLabel *m_playbackTime;
0075     QToolButton *m_play;
0076     QToolButton *m_pause;
0077     QToolButton *m_stop;
0078 };
0079 
0080 #endif