![]() |
VLC-Qt 0.8.0- (Different version)
|
00001 /**************************************************************************** 00002 * VLC-Qt - Qt and libvlc connector library 00003 * Copyright (C) 2012 Tadej Novak <tadej@tano.si> 00004 * 00005 * This library is free software: you can redistribute it and/or modify 00006 * it under the terms of the GNU Lesser General Public License as published 00007 * by the Free Software Foundation, either version 3 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License 00016 * along with this library. If not, see <http://www.gnu.org/licenses/>. 00017 *****************************************************************************/ 00018 00019 #ifndef VLCQT_WIDGETSEEK_H_ 00020 #define VLCQT_WIDGETSEEK_H_ 00021 00022 #include <QtCore/QPoint> 00023 #include <QWidget> 00024 00025 #include "SharedExportWidgets.h" 00026 00027 class QLabel; 00028 class QProgressBar; 00029 class QTimer; 00030 00031 class VlcMediaPlayer; 00032 00040 class VLCQT_WIDGETS_EXPORT VlcWidgetSeek : public QWidget 00041 { 00042 Q_OBJECT 00043 public: 00049 explicit VlcWidgetSeek(VlcMediaPlayer *player, 00050 QWidget *parent = 0); 00051 00056 explicit VlcWidgetSeek(QWidget *parent = 0); 00057 00061 ~VlcWidgetSeek(); 00062 00067 bool autoHide() const { return _autoHide; } 00068 00076 void setAutoHide(const bool &autoHide); 00077 00082 void setMediaPlayer(VlcMediaPlayer *player); 00083 00084 protected: 00085 void mouseMoveEvent(QMouseEvent *event); 00086 void mousePressEvent(QMouseEvent *event); 00087 void mouseReleaseEvent(QMouseEvent *event); 00088 void wheelEvent(QWheelEvent *event); 00089 00090 private slots: 00091 void end(); 00092 void updateCurrentTime(const int &time); 00093 void updateFullTime(const int &time); 00094 00095 private: 00096 void initWidgetSeek(); 00097 void updateEvent(const QPoint &pos); 00098 00099 void lock(); 00100 void unlock(); 00101 00102 bool _lock; 00103 00104 VlcMediaPlayer *_vlcMediaPlayer; 00105 00106 bool _autoHide; 00107 QProgressBar *_seek; 00108 QLabel *_labelElapsed; 00109 QLabel *_labelFull; 00110 }; 00111 00112 #endif // VLCQT_WIDGETSEEK_H_