1 /****************************************************************************** 2 Simple Player: this file is part of QtAV examples 3 Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com> 4 5 * This file is part of QtAV 6 7 This program is free software: you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation, either version 3 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program. If not, see <http://www.gnu.org/licenses/>. 19 ******************************************************************************/ 20 21 #ifndef PLAYERWINDOW_H 22 #define PLAYERWINDOW_H 23 24 #include <QWidget> 25 #include <QtAV> 26 27 QT_BEGIN_NAMESPACE 28 class QSlider; 29 class QPushButton; 30 QT_END_NAMESPACE 31 class PlayerWindow : public QWidget 32 { 33 Q_OBJECT 34 public: 35 explicit PlayerWindow(QWidget *parent = 0); 36 public Q_SLOTS: 37 void openMedia(); 38 void seekBySlider(int value); 39 void seekBySlider(); 40 void playPause(); 41 private Q_SLOTS: 42 void updateSlider(qint64 value); 43 void updateSlider(); 44 void updateSliderUnit(); 45 46 private: 47 QtAV::VideoOutput *m_vo; 48 QtAV::AVPlayer *m_player; 49 QSlider *m_slider; 50 QPushButton *m_openBtn; 51 QPushButton *m_playBtn; 52 QPushButton *m_stopBtn; 53 int m_unit; 54 }; 55 56 #endif // PLAYERWINDOW_H 57