00001 /* 00002 This file is part of the Opie Project 00003 00004 Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 00005 Copyright (c) 2002 LJP <> 00006 Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> 00007 =. 00008 .=l. 00009 .>+-= 00010 _;:, .> :=|. This program is free software; you can 00011 .> <`_, > . <= redistribute it and/or modify it under 00012 :`=1 )Y*s>-.-- : the terms of the GNU General Public 00013 .="- .-=="i, .._ License as published by the Free Software 00014 - . .-<_> .<> Foundation; either version 2 of the License, 00015 ._= =} : or (at your option) any later version. 00016 .%`+i> _;_. 00017 .i_,=:_. -<s. This program is distributed in the hope that 00018 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00019 : .. .:, . . . without even the implied warranty of 00020 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00021 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00022 ..}^=.= = ; Library General Public License for more 00023 ++= -. .` .: details. 00024 : = ...= . :.=- 00025 -. .:....=;==+<; You should have received a copy of the GNU 00026 -_. . . )=. = Library General Public License along with 00027 -- :-=` this library; see the file COPYING.LIB. 00028 If not, write to the Free Software Foundation, 00029 Inc., 59 Temple Place - Suite 330, 00030 Boston, MA 02111-1307, USA. 00031 00032 */ 00033 00034 #ifndef MEDIA_PLAYER_H 00035 #define MEDIA_PLAYER_H 00036 00037 #include "xinecontrol.h" 00038 00039 #include "playlistwidget.h" 00040 #include "skin.h" 00041 00042 class DocLnk; 00043 class VolumeControl; 00044 class MediaPlayerState; 00045 class AudioWidget; 00046 class VideoWidget; 00047 00048 namespace XINE 00049 { 00050 class Lib; 00051 }; 00052 00053 class MediaPlayer : public QObject { 00054 Q_OBJECT 00055 public: 00056 MediaPlayer( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QObject *parent, const char *name ); 00057 ~MediaPlayer(); 00058 00059 public slots: 00060 void reloadSkins(); 00061 00062 private slots: 00063 void setPlaying( bool ); 00064 void pauseCheck( bool ); 00065 void play(); 00066 void next(); 00067 void prev(); 00068 void startIncreasingVolume(); 00069 void startDecreasingVolume(); 00070 void stopChangingVolume(); 00071 void cleanUp(); 00072 void blank( bool ); 00073 00074 protected: 00075 void timerEvent( QTimerEvent *e ); 00076 void keyReleaseEvent( QKeyEvent *e); 00077 00078 private: 00079 AudioWidget *audioUI() const; 00080 VideoWidget *videoUI() const; 00081 XineControl *xineControl() const; 00082 00083 bool isBlanked, l, r; 00084 int fd, fl; 00085 int volumeDirection; 00086 VolumeControl *volControl; 00087 MediaPlayerState &mediaPlayerState; 00088 PlayListWidget &playList; 00089 00090 void recreateAudioAndVideoWidgets() const; 00091 00092 mutable XineControl *m_xineControl; 00093 mutable AudioWidget *m_audioUI; 00094 mutable VideoWidget *m_videoUI; 00095 mutable XINE::Lib *xine; 00096 00097 QGuardedPtr<SkinLoader> m_skinLoader; 00098 }; 00099 00100 00101 #endif // MEDIA_PLAYER_H 00102
1.4.2