File indexing completed on 2024-03-24 16:22:32

0001 /**
0002  * Copyright (C) 2003 by Koos Vriezen <koos.vriezen@gmail.com>
0003  *
0004  *  This library is free software; you can redistribute it and/or
0005  *  modify it under the terms of the GNU Library General Public
0006  *  License version 2 as published by the Free Software Foundation.
0007  *
0008  *  This library is distributed in the hope that it will be useful,
0009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0011  *  Library General Public License for more details.
0012  *
0013  *  You should have received a copy of the GNU Library General Public License
0014  *  along with this library; see the file COPYING.LIB.  If not, write to
0015  *  the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
0016  *  Boston, MA 02110-1301, USA.
0017  **/
0018 
0019 #ifndef _KXINEPLAYER_H_
0020 #define _KXINEPLAYER_H_
0021 
0022 #include <qapplication.h>
0023 #include <qstring.h>
0024 #include <qstringlist.h>
0025 #include <qsessionmanager.h>
0026 
0027 struct XineMovieParamEvent : public QEvent {
0028     XineMovieParamEvent (int l, int w, int h, const QStringList & al, const QStringList & sl, bool ff=false);
0029     int length;
0030     int width;
0031     int height;
0032     QStringList alang;
0033     QStringList slang;
0034     bool first_frame;
0035 };
0036 
0037 struct XineURLEvent : public QEvent {
0038     XineURLEvent (const QString & u);
0039     QString url;
0040 };
0041 
0042 struct XineTitleEvent : public QEvent {
0043     XineTitleEvent (const char *);
0044     QString title;
0045 };
0046 
0047 struct XineProgressEvent : public QEvent {
0048     XineProgressEvent (int p);
0049     int progress;
0050 };
0051 
0052 class KXinePlayer : public QApplication {
0053     Q_OBJECT
0054 public:
0055     KXinePlayer (int argc, char ** argv);
0056     ~KXinePlayer ();
0057 
0058     void init ();
0059     void finished ();
0060     void saturation (int val);
0061     void hue (int val);
0062     void contrast (int val);
0063     void brightness (int val);
0064     void volume (int val);
0065     void seek (int val);
0066     bool event (QEvent * e);
0067     void setAudioLang (int, const QString &);
0068     void setSubtitle (int, const QString &);
0069 public slots:
0070     void play (int repeat_count);
0071     void stop ();
0072     void pause ();
0073     void updatePosition ();
0074     void postFinished ();
0075 protected:
0076     void saveState (QSessionManager & sm);
0077 };
0078 
0079 #endif //_KXINEPLAYER_H_