Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol_threaded.h') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol_threaded.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol_threaded.h b/core/multimedia/opieplayer/loopcontrol_threaded.h new file mode 100644 index 0000000..9a009d1 --- a/dev/null +++ b/core/multimedia/opieplayer/loopcontrol_threaded.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef MPEGVIEW_H | ||
21 | #define MPEGVIEW_H | ||
22 | |||
23 | |||
24 | #include <qwidget.h> | ||
25 | #include <qdatetime.h> | ||
26 | |||
27 | |||
28 | class LoopControl : public QObject { | ||
29 | Q_OBJECT | ||
30 | public: | ||
31 | LoopControl( QObject *parent, const char *name ); | ||
32 | ~LoopControl(); | ||
33 | |||
34 | bool init( const QString& filename ); | ||
35 | |||
36 | bool hasVideo() const { return hasVideoChannel; } | ||
37 | bool hasAudio() const { return hasAudioChannel; } | ||
38 | |||
39 | long totalPlaytime() { return (long)(hasVideoChannel ? total_video_frames / framerate : total_audio_samples / freq); } | ||
40 | |||
41 | // These are public to run them from global functions needed to start threads | ||
42 | // Otherwise they would be private | ||
43 | void startAudio(); | ||
44 | void startVideo(); | ||
45 | public slots: | ||
46 | void play(); | ||
47 | void stop( bool willPlayAgainShortly = FALSE ); | ||
48 | |||
49 | void setMute( bool ); | ||
50 | void setPaused( bool ); | ||
51 | void setPosition( long ); | ||
52 | |||
53 | signals: | ||
54 | void positionChanged( long, long ); | ||
55 | void playFinished(); | ||
56 | |||
57 | protected: | ||
58 | void timerEvent(QTimerEvent*); | ||
59 | |||
60 | private: | ||
61 | void startTimers(); | ||
62 | void killTimers(); | ||
63 | |||
64 | |||
65 | QTime playtime; | ||
66 | int timerid; | ||
67 | int audioSampleCounter; | ||
68 | long current_frame; | ||
69 | long total_video_frames; | ||
70 | long total_audio_samples; | ||
71 | |||
72 | float framerate; | ||
73 | int freq; | ||
74 | int stream; | ||
75 | int framecount; | ||
76 | int channels; | ||
77 | |||
78 | bool moreAudio; | ||
79 | bool moreVideo; | ||
80 | |||
81 | bool hasVideoChannel; | ||
82 | bool hasAudioChannel; | ||
83 | bool isMuted; | ||
84 | QString fileName; | ||
85 | }; | ||
86 | |||
87 | |||
88 | #endif | ||
89 | |||