00001 /* 00002 This file is part of the Opie Project 00003 00004 Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> 00005 Copyright (c) 2002 L. Potter <ljp@llornkcor.com> 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 ..}^=.= = ; General Public License for more 00023 ++= -. .` .: details. 00024 : = ...= . :.=- 00025 -. .:....=;==+<; You should have received a copy of the GNU 00026 -_. . . )=. = 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 // this file is based on work by trolltech 00035 00036 #ifndef MEDIA_PLAYER_STATE_H 00037 #define MEDIA_PLAYER_STATE_H 00038 00039 00040 #include <qobject.h> 00041 00042 00043 class MediaPlayerDecoder; 00044 class Config; 00045 00046 00047 class MediaPlayerState : public QObject { 00048 Q_OBJECT 00049 public: 00050 enum DisplayType { Audio, Video, MediaSelection }; 00051 00052 MediaPlayerState( QObject *parent, const char *name ); 00053 ~MediaPlayerState(); 00054 00055 bool isStreaming() const { return streaming; } 00056 bool isSeekable() const { return seekable; } 00057 bool isFullscreen() const { return fullscreen; } 00058 bool isScaled() const { return scaled; } 00059 bool isLooping() const { return looping; } 00060 bool isShuffled() const { return shuffled; } 00061 bool isPaused() const { return paused; } 00062 bool isPlaying() const { return playing; } 00063 bool isStopped() const { return stopped; } 00064 long position() const { return curPosition; } 00065 long length() const { return curLength; } 00066 DisplayType displayType() const; 00067 00068 public slots: 00069 void setIsStreaming( bool b ); 00070 void setIsSeekable( bool b ); 00071 void setFullscreen( bool b ); 00072 void setScaled( bool b ); 00073 void setLooping( bool b ); 00074 void setShuffled( bool b ); 00075 void setPaused( bool b ); 00076 void setPlaying( bool b ); 00077 void setStopped( bool b ); 00078 void setPosition( long p ); 00079 void updatePosition( long p ); 00080 void setLength( long l ); 00081 void setDisplayType( MediaPlayerState::DisplayType displayType ); 00082 void setBlanked( bool b ); 00083 void setVideoGamma( int v ); 00084 00085 void setPrev(); 00086 void setNext(); 00087 void setList(); 00088 void setVideo(); 00089 void setAudio(); 00090 00091 void toggleFullscreen(); 00092 void toggleScaled(); 00093 void toggleLooping(); 00094 void toggleShuffled(); 00095 void togglePaused(); 00096 void togglePlaying(); 00097 void toggleBlank(); 00098 void writeConfig( Config& cfg ) const; 00099 00100 signals: 00101 void fullscreenToggled( bool ); 00102 void scaledToggled( bool ); 00103 void loopingToggled( bool ); 00104 void shuffledToggled( bool ); 00105 void pausedToggled( bool ); 00106 void playingToggled( bool ); 00107 void stopToggled( bool ); 00108 void positionChanged( long ); // When the slider is moved 00109 void positionUpdated( long ); // When the media file progresses 00110 void lengthChanged( long ); 00111 void displayTypeChanged( MediaPlayerState::DisplayType type ); 00112 void isSeekableToggled( bool ); 00113 void blankToggled( bool ); 00114 void videoGammaChanged( int ); 00115 void prev(); 00116 void next(); 00117 00118 private: 00119 bool streaming : 1; 00120 bool seekable : 1; 00121 bool fullscreen: 1; 00122 bool scaled : 1; 00123 bool blanked : 1; 00124 bool looping : 1; 00125 bool shuffled : 1; 00126 bool usePlaylist : 1; 00127 bool paused : 1; 00128 bool playing : 1; 00129 bool stopped : 1; 00130 long curPosition; 00131 long curLength; 00132 DisplayType m_displayType; 00133 int videoGamma; 00134 void readConfig( Config& cfg ); 00135 00136 }; 00137 00138 00139 #endif // MEDIA_PLAYER_STATE_H 00140
1.4.2