File indexing completed on 2024-04-28 04:50:50

0001 /*
0002  * mediawidget_p.h
0003  *
0004  * Copyright (C) 2007-2011 Christoph Pfister <christophpfister@gmail.com>
0005  *
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation; either version 2 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License along
0017  * with this program; if not, write to the Free Software Foundation, Inc.,
0018  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
0019  */
0020 
0021 #ifndef MEDIAWIDGET_P_H
0022 #define MEDIAWIDGET_P_H
0023 
0024 #include <QSlider>
0025 #include <QDialog>
0026 #include "mediawidget.h"
0027 
0028 class QTimeEdit;
0029 
0030 class JumpToPositionDialog : public QDialog
0031 {
0032 public:
0033     explicit JumpToPositionDialog(MediaWidget *mediaWidget_);
0034     ~JumpToPositionDialog();
0035 
0036 private:
0037     void accept() override;
0038 
0039     MediaWidget *mediaWidget;
0040     QTimeEdit *timeEdit;
0041 };
0042 
0043 class SeekSlider : public QSlider
0044 {
0045 public:
0046     explicit SeekSlider(QWidget *parent) : QSlider(parent) { }
0047     ~SeekSlider() { }
0048 
0049 private:
0050     void mousePressEvent(QMouseEvent *event) override;
0051     void wheelEvent(QWheelEvent *event) override;
0052 };
0053 
0054 class MediaSourceUrl : public MediaSource
0055 {
0056 public:
0057     MediaSourceUrl(const QUrl &url_, const QUrl &subtitleUrl_) : url(url_),
0058         subtitleUrl(subtitleUrl_) { }
0059     ~MediaSourceUrl() { }
0060 
0061     Type getType() const override { return Url; }
0062     QUrl getUrl() const override { return url; }
0063 
0064     QUrl url;
0065     QUrl subtitleUrl;
0066 };
0067 
0068 class MediaSourceAudioCd : public MediaSource
0069 {
0070 public:
0071     explicit MediaSourceAudioCd(const QUrl &url_) : url(url_) { }
0072     ~MediaSourceAudioCd() { }
0073 
0074     Type getType() const override { return AudioCd; }
0075     QUrl getUrl() const override { return url; }
0076 
0077     QUrl url;
0078 };
0079 
0080 class MediaSourceVideoCd : public MediaSource
0081 {
0082 public:
0083     explicit MediaSourceVideoCd(const QUrl &url_) : url(url_) { }
0084     ~MediaSourceVideoCd() { }
0085 
0086     Type getType() const override { return VideoCd; }
0087     QUrl getUrl() const override { return url; }
0088 
0089     QUrl url;
0090 };
0091 
0092 class MediaSourceDvd : public MediaSource
0093 {
0094 public:
0095     explicit MediaSourceDvd(const QUrl &url_) : url(url_) { }
0096     ~MediaSourceDvd() { }
0097 
0098     Type getType() const override { return Dvd; }
0099     QUrl getUrl() const override { return url; }
0100 
0101     QUrl url;
0102 };
0103 
0104 #endif /* MEDIAWIDGET_P_H */