summaryrefslogtreecommitdiffstats
path: root/src/kviewmpeg2.h
blob: bd212538c7e66b17d1f2f4d0f1618c78e8139121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/**************************************************************************
*   Copyright (C) 2005 by Jean-Michel Petit                               *
*   [email protected]                                                  *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
*   This program 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 General Public License for more details.                          *
*                                                                         *
*   You should have received a copy of the GNU General Public License     *
*   along with this program; if not, write to the                         *
*   Free Software Foundation, Inc.,                                       *
*   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
***************************************************************************/

#ifndef KVIEWMPEG2_H
#define KVIEWMPEG2_H

#include "k9dvdtitle.h"

#include <qthread.h>
#include <viewmpeg2.h>
#include <qwidget.h>
#include <qstring.h>
#include <qevent.h>
#include <qmutex.h>
#include <qgl.h>
#include "k9plaympeg2.h"
#include "k9glwidget.h"
#include "k9mplayer.h"

/**
  *@author 
  */

class k9Widget : public QWidget {
Q_OBJECT
protected:
   QImage *m_image;
   void paintEvent ( QPaintEvent * _event);
public:
   k9Widget (QWidget *_parent);
   void setImage(QImage *_image);
};


class kViewMPEG2 : public ViewMPEG2  {
Q_OBJECT
public: 
	kViewMPEG2();
	~kViewMPEG2();
private:
  QMutex mutex;
  k9DVDTitle *m_title;
  QString dev;
  int selTitle;
  unsigned long  idxLect;
  bool pause;
  bool lockSlider;
  QImage img;
  bool stopped;
  void sliderReleased();  
  /** No descriptions */
  void sliderPressed();
  void lock();
  void unlock();
  QString file;
  QString errMsg;
  bool error;
  QString length;
  uint startSector;
  uint lastSector;
  k9PlayMPEG2 m_player;
  QGridLayout *m_layout;
  bool m_prefUseGL;
  k9GLWidget *m_GLwidget;
  k9Widget *m_widget;
protected:
 void closeEvent( QCloseEvent* );
 void resizeEvent ( QResizeEvent * );
public slots: // Public slots
  /** No descriptions */
  int open (k9DVD *_dvd,k9DVDTitle * title,int chapter);
  void drawPixmap( QImage *image);
  void drawppm(uchar *_buf,int _width,int _height,int _len);
  void setError(const QString & err);
  void setPosition(uint32_t _position);
  void setMax(uint32_t _position);
  void setMin(uint32_t _position);
  void bPlayClick();
  void bStopClick();
  void readSettings();

};

#endif