summaryrefslogtreecommitdiffstats
path: root/src/part/videoWindow.h
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2020-06-13 22:45:28 +0900
committerMichele Calgaro <[email protected]>2020-06-13 22:45:28 +0900
commit5f44f7b187093ef290315b7f8766b540a31de35f (patch)
tree27ffb7b218199ca04f240c390c52426c65f45dce /src/part/videoWindow.h
downloadcodeine-5f44f7b187093ef290315b7f8766b540a31de35f.tar.gz
codeine-5f44f7b187093ef290315b7f8766b540a31de35f.zip
Initial code import from debian snapshot
https://snapshot.debian.org/package/codeine/1.0.1-3.dfsg-3.1/ Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/part/videoWindow.h')
-rw-r--r--src/part/videoWindow.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/src/part/videoWindow.h b/src/part/videoWindow.h
new file mode 100644
index 0000000..7db72ab
--- /dev/null
+++ b/src/part/videoWindow.h
@@ -0,0 +1,94 @@
+// (C) 2005 Max Howell ([email protected])
+// See COPYING file for licensing information
+
+#ifndef CODEINE_VIDEO_WINDOW_H
+#define CODEINE_VIDEO_WINDOW_H
+
+#include "../codeine.h"
+#include <qtimer.h>
+#include <qwidget.h>
+#include <kurl.h>
+
+typedef struct xine_s xine_t;
+typedef struct xine_stream_s xine_stream_t;
+typedef struct xine_video_port_s xine_video_port_t;
+typedef struct xine_audio_port_s xine_audio_port_t;
+typedef struct xine_event_queue_s xine_event_queue_t;
+typedef struct xine_post_s xine_post_t;
+typedef struct xine_osd_s xine_osd_t;
+
+
+namespace Codeine
+{
+ class VideoWindow : public QWidget
+ {
+ Q_OBJECT
+
+ static VideoWindow *s_instance;
+ static const uint CURSOR_HIDE_TIMEOUT = 2000;
+
+ friend VideoWindow* const videoWindow();
+
+ public:
+ VideoWindow( QWidget *parent, const char *name );
+ ~VideoWindow();
+
+ bool init();
+
+ bool play( KURL );
+ void eject();
+
+ int position();
+
+ signals:
+ void statusMessage( const QString& );
+ void titleChanged( const QString& );
+
+ private:
+ /// @see xineEngine.cpp
+ #ifdef HAVE_XINE_H
+ static void xineEventListener( void*, const xine_event_t* );
+ #endif
+
+ void showErrorMessage(); //TODO don't use this, just show delayed message
+
+ virtual void customEvent( QCustomEvent* );
+ virtual bool x11Event( XEvent* );
+ virtual bool event( QEvent* );
+
+ xine_osd_t *m_osd;
+ xine_stream_t *m_stream;
+ xine_event_queue_t *m_eventQueue;
+ xine_video_port_t *m_videoPort;
+ xine_audio_port_t *m_audioPort;
+ xine_t *m_xine;
+
+ KURL m_url;
+
+ private:
+ void *x11Visual() const;
+
+ static void destSizeCallBack( void*, int, int, double, int*, int*, double* );
+ static void frameOutputCallBack( void*, int, int, double, int*, int*, int*, int*, double*, int*, int* );
+
+ double m_displayRatio;
+ QTimer m_timer;
+
+ public slots:
+ void togglePlay();
+ void toggleMute();
+
+ private slots:
+ void hideCursor();
+
+ private:
+ /// prevent compiler generated functions
+ VideoWindow( const VideoWindow& );
+ VideoWindow &operator=( const VideoWindow& );
+ bool operator==( const VideoWindow& );
+ };
+
+ inline VideoWindow* const videoWindow() { return VideoWindow::s_instance; }
+}
+
+#endif