author | bipolar <bipolar> | 2002-03-03 17:13:17 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-03-03 17:13:17 (UTC) |
commit | a99347380a9006ec81a9dba2340d6aaab690a86e (patch) (unidiff) | |
tree | 73fdc2eff476fba2113172ed881dd64a4031def6 /core/multimedia/opieplayer/mediaplayerstate.h | |
parent | 0e245156b28b70be5cd98a58a9256fe5e2739562 (diff) | |
download | opie-a99347380a9006ec81a9dba2340d6aaab690a86e.zip opie-a99347380a9006ec81a9dba2340d6aaab690a86e.tar.gz opie-a99347380a9006ec81a9dba2340d6aaab690a86e.tar.bz2 |
commited by ljp (llornkcor) reverted to qpe's interface for compatibility. Added playlist features:
save, remove, and have different ones. Uncommented code for background image and added opielogo.
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerstate.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.h | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/core/multimedia/opieplayer/mediaplayerstate.h b/core/multimedia/opieplayer/mediaplayerstate.h index e82c263..ad273f1 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.h +++ b/core/multimedia/opieplayer/mediaplayerstate.h | |||
@@ -1,116 +1,119 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef MEDIA_PLAYER_STATE_H | 20 | #ifndef MEDIA_PLAYER_STATE_H |
21 | #define MEDIA_PLAYER_STATE_H | 21 | #define MEDIA_PLAYER_STATE_H |
22 | 22 | ||
23 | |||
23 | #include <qobject.h> | 24 | #include <qobject.h> |
24 | 25 | ||
25 | 26 | ||
26 | class MediaPlayerDecoder; | 27 | class MediaPlayerDecoder; |
27 | class Config; | 28 | class Config; |
28 | 29 | ||
29 | 30 | ||
30 | class MediaPlayerState : public QObject { | 31 | class MediaPlayerState : public QObject { |
31 | Q_OBJECT | 32 | Q_OBJECT |
32 | public: | 33 | public: |
33 | MediaPlayerState( QObject *parent, const char *name ); | 34 | MediaPlayerState( QObject *parent, const char *name ); |
34 | ~MediaPlayerState(); | 35 | ~MediaPlayerState(); |
35 | 36 | ||
36 | bool fullscreen() { return isFullscreen; } | 37 | |
37 | bool scaled() { return isScaled; } | 38 | bool fullscreen() { return isFullscreen; } |
38 | bool looping() { return isLooping; } | 39 | bool scaled() { return isScaled; } |
39 | bool shuffled() { return isShuffled; } | 40 | bool looping() { return isLooping; } |
40 | bool playlist() { return usePlaylist; } | 41 | bool shuffled() { return isShuffled; } |
41 | bool paused() { return isPaused; } | 42 | bool playlist() { return usePlaylist; } |
42 | bool playing() { return isPlaying; } | 43 | bool paused() { return isPaused; } |
43 | long position() { return curPosition; } | 44 | bool playing() { return isPlaying; } |
44 | long length() { return curLength; } | 45 | long position() { return curPosition; } |
45 | char view() { return curView; } | 46 | long length() { return curLength; } |
47 | char view() { return curView; } | ||
46 | 48 | ||
47 | MediaPlayerDecoder *newDecoder( const QString& file ); | 49 | MediaPlayerDecoder *newDecoder( const QString& file ); |
48 | MediaPlayerDecoder *curDecoder(); | 50 | MediaPlayerDecoder *curDecoder(); |
49 | MediaPlayerDecoder *libMpeg3Decoder(); // ### Yucky hack needed to use libmpeg3plugin to get the | 51 | MediaPlayerDecoder *libMpeg3Decoder(); // ### Yucky hack needed to use libmpeg3plugin to get the |
50 | // number of audio samples if we are using the libmad plugin | 52 | // number of audio samples if we are using the libmad plugin |
51 | public slots: | 53 | public slots: |
52 | void setFullscreen( bool b ) { if ( isFullscreen == b ) return; isFullscreen = b; emit fullscreenToggled(b); } | 54 | void setFullscreen( bool b ) { if ( isFullscreen == b ) return; isFullscreen = b; emit fullscreenToggled(b); } |
53 | void setScaled( bool b ) { if ( isScaled == b ) return; isScaled = b; emit scaledToggled(b); } | 55 | void setScaled( bool b ) { if ( isScaled == b ) return; isScaled = b; emit scaledToggled(b); } |
54 | void setLooping( bool b ) { if ( isLooping == b ) return; isLooping = b; emit loopingToggled(b); } | 56 | void setLooping( bool b ) { if ( isLooping == b ) return; isLooping = b; emit loopingToggled(b); } |
55 | void setShuffled( bool b ) { if ( isShuffled == b ) return; isShuffled = b; emit shuffledToggled(b); } | 57 | void setShuffled( bool b ) { if ( isShuffled == b ) return; isShuffled = b; emit shuffledToggled(b); } |
56 | void setPlaylist( bool b ) { if ( usePlaylist == b ) return; usePlaylist = b; emit playlistToggled(b); } | 58 | void setPlaylist( bool b ) { if ( usePlaylist == b ) return; usePlaylist = b; emit playlistToggled(b); } |
57 | void setPaused( bool b ) { if ( isPaused == b ) return; isPaused = b; emit pausedToggled(b); } | 59 | void setPaused( bool b ) { if ( isPaused == b ) return; isPaused = b; emit pausedToggled(b); } |
58 | void setPlaying( bool b ) { if ( isPlaying == b ) return; isPlaying = b; emit playingToggled(b); } | 60 | void setPlaying( bool b ) { if ( isPlaying == b ) return; isPlaying = b; emit playingToggled(b); } |
59 | void setPosition( long p ) { if ( curPosition == p ) return; curPosition = p; emit positionChanged(p); } | 61 | void setPosition( long p ) { if ( curPosition == p ) return; curPosition = p; emit positionChanged(p); } |
60 | void updatePosition( long p ){ if ( curPosition == p ) return; curPosition = p; emit positionUpdated(p); } | 62 | void updatePosition( long p ){ if ( curPosition == p ) return; curPosition = p; emit positionUpdated(p); } |
61 | void setLength( long l ) { if ( curLength == l ) return; curLength = l; emit lengthChanged(l); } | 63 | void setLength( long l ) { if ( curLength == l ) return; curLength = l; emit lengthChanged(l); } |
62 | void setView( char v ) { if ( curView == v ) return; curView = v; emit viewChanged(v); } | 64 | void setView( char v ) { if ( curView == v ) return; curView = v; emit viewChanged(v); } |
63 | 65 | ||
64 | void setPrev() { emit prev(); } | 66 | void setPrev() { emit prev(); } |
65 | void setNext() { emit next(); } | 67 | void setNext() { emit next(); } |
66 | void setList() { setPlaying( FALSE ); setView('l'); } | 68 | void setList() { setPlaying( FALSE ); setView('l'); } |
67 | void setVideo() { setView('v'); } | 69 | void setVideo() { setView('v'); } |
68 | void setAudio() { setView('a'); } | 70 | void setAudio() { setView('a'); } |
69 | 71 | ||
70 | void toggleFullscreen() { setFullscreen( !isFullscreen ); } | 72 | void toggleFullscreen() { setFullscreen( !isFullscreen ); } |
71 | void toggleScaled() { setScaled( !isScaled); } | 73 | void toggleScaled() { setScaled( !isScaled); } |
72 | void toggleLooping() { setLooping( !isLooping); } | 74 | void toggleLooping() { setLooping( !isLooping); } |
73 | void toggleShuffled() { setShuffled( !isShuffled); } | 75 | void toggleShuffled() { setShuffled( !isShuffled); } |
74 | void togglePlaylist() { setPlaylist( !usePlaylist); } | 76 | void togglePlaylist() { setPlaylist( !usePlaylist); } |
75 | void togglePaused() { setPaused( !isPaused); } | 77 | void togglePaused() { setPaused( !isPaused); } |
76 | void togglePlaying() { setPlaying( !isPlaying); } | 78 | void togglePlaying() { setPlaying( !isPlaying); } |
77 | 79 | ||
78 | signals: | 80 | signals: |
79 | void fullscreenToggled( bool ); | 81 | void fullscreenToggled( bool ); |
80 | void scaledToggled( bool ); | 82 | void scaledToggled( bool ); |
81 | void loopingToggled( bool ); | 83 | void loopingToggled( bool ); |
82 | void shuffledToggled( bool ); | 84 | void shuffledToggled( bool ); |
83 | void playlistToggled( bool ); | 85 | void playlistToggled( bool ); |
84 | void pausedToggled( bool ); | 86 | void pausedToggled( bool ); |
85 | void playingToggled( bool ); | 87 | void playingToggled( bool ); |
86 | void positionChanged( long ); // When the slider is moved | 88 | void positionChanged( long ); // When the slider is moved |
87 | void positionUpdated( long ); // When the media file progresses | 89 | void positionUpdated( long ); // When the media file progresses |
88 | void lengthChanged( long ); | 90 | void lengthChanged( long ); |
89 | void viewChanged( char ); | 91 | void viewChanged( char ); |
90 | 92 | ||
91 | void prev(); | 93 | void prev(); |
92 | void next(); | 94 | void next(); |
93 | 95 | ||
94 | private: | 96 | private: |
95 | bool isFullscreen; | 97 | bool isFullscreen; |
96 | bool isScaled; | 98 | bool isScaled; |
97 | bool isLooping; | 99 | bool isLooping; |
98 | bool isShuffled; | 100 | bool isShuffled; |
99 | bool usePlaylist; | 101 | bool usePlaylist; |
100 | bool isPaused; | 102 | bool isPaused; |
101 | bool isPlaying; | 103 | bool isPlaying; |
102 | long curPosition; | 104 | long curPosition; |
103 | long curLength; | 105 | long curLength; |
104 | char curView; | 106 | char curView; |
105 | 107 | ||
106 | MediaPlayerDecoder *decoder; | 108 | MediaPlayerDecoder *decoder; |
107 | MediaPlayerDecoder *libmpeg3decoder; | 109 | MediaPlayerDecoder *libmpeg3decoder; |
110 | // MediaPlayerDecoder *libwavdecoder; | ||
108 | 111 | ||
109 | void loadPlugins(); | 112 | void loadPlugins(); |
110 | void readConfig( Config& cfg ); | 113 | void readConfig( Config& cfg ); |
111 | void writeConfig( Config& cfg ) const; | 114 | void writeConfig( Config& cfg ) const; |
112 | }; | 115 | }; |
113 | 116 | ||
114 | 117 | ||
115 | #endif // MEDIA_PLAYER_STATE_H | 118 | #endif // MEDIA_PLAYER_STATE_H |
116 | 119 | ||