summaryrefslogtreecommitdiff
path: root/core/multimedia
authorllornkcor <llornkcor>2002-02-24 21:51:51 (UTC)
committer llornkcor <llornkcor>2002-02-24 21:51:51 (UTC)
commit36b768c465c6ecddceb57ff1d7a5087e9848c897 (patch) (unidiff)
tree4ddde589e2393ca136e24cda4fc456612149ae72 /core/multimedia
parentade25ac278169f0e0c9ee0771e754adb46cf7ce2 (diff)
downloadopie-36b768c465c6ecddceb57ff1d7a5087e9848c897.zip
opie-36b768c465c6ecddceb57ff1d7a5087e9848c897.tar.gz
opie-36b768c465c6ecddceb57ff1d7a5087e9848c897.tar.bz2
changed mediaplayerplugininterface.h location
Diffstat (limited to 'core/multimedia') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/Makefile.in29
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp75
-rw-r--r--core/multimedia/opieplayer/audiodevice.h6
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp2
-rw-r--r--core/multimedia/opieplayer/libflash/libflashplugin.h4
-rw-r--r--core/multimedia/opieplayer/libflash/libflashpluginimpl.h1
-rw-r--r--core/multimedia/opieplayer/libflash/swf.h2
-rw-r--r--core/multimedia/opieplayer/libmad/Makefile.in2
-rw-r--r--core/multimedia/opieplayer/libmad/libmad.pro2
-rw-r--r--core/multimedia/opieplayer/libmad/libmadplugin.h20
-rw-r--r--core/multimedia/opieplayer/libmad/libmadpluginimpl.h2
-rw-r--r--core/multimedia/opieplayer/libmad/version.c0
-rw-r--r--core/multimedia/opieplayer/libmpeg3/Makefile.in6
-rw-r--r--core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h22
-rw-r--r--core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h1
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp28
-rw-r--r--core/multimedia/opieplayer/loopcontrol.h2
-rw-r--r--core/multimedia/opieplayer/loopcontrol_threaded.cpp2
-rw-r--r--core/multimedia/opieplayer/main.cpp2
-rw-r--r--core/multimedia/opieplayer/mediaplayerplugininterface.h8
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp6
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.h1
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp0
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp347
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h33
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp4
-rw-r--r--core/multimedia/opieplayer/wavplugin/Makefile.in4
-rw-r--r--core/multimedia/opieplayer/wavplugin/wavplugin.cpp45
-rw-r--r--core/multimedia/opieplayer/wavplugin/wavplugin.h24
29 files changed, 508 insertions, 172 deletions
diff --git a/core/multimedia/opieplayer/Makefile.in b/core/multimedia/opieplayer/Makefile.in
index 1b0307a..8d33fb4 100644
--- a/core/multimedia/opieplayer/Makefile.in
+++ b/core/multimedia/opieplayer/Makefile.in
@@ -133,27 +133,30 @@ REQUIRES=
133 133
134 134
135####### Compile 135####### Compile
136 136
137main.o: main.cpp \ 137main.o: main.cpp \
138 $(OPIEDIR)/include/qpe/qpeapplication.h \ 138 $(OPIEDIR)/include/qpe/qpeapplication.h \
139 $(OPIEDIR)/include/qpedecoration_qws.h \
140 $(OPIEDIR)/include/timestring.h \
139 mediaplayerstate.h \ 141 mediaplayerstate.h \
140 playlistwidget.h \ 142 playlistwidget.h \
141 $(OPIEDIR)/include/qpe/applnk.h \ 143 $(OPIEDIR)/include/qpe/applnk.h \
142 audiowidget.h \ 144 audiowidget.h \
143 videowidget.h \ 145 videowidget.h \
144 loopcontrol.h \ 146 loopcontrol.h \
145 mediaplayer.h \ 147 mediaplayer.h \
146 $(OPIEDIR)/include/qpe/qlibrary.h \ 148 $(OPIEDIR)/include/qpe/qlibrary.h \
147 $(OPIEDIR)/include/qpe/qcom.h \ 149 $(OPIEDIR)/include/qpe/qcom.h \
148 $(OPIEDIR)/include/qpe/quuid.h \ 150 $(OPIEDIR)/include/qpe/quuid.h \
149 $(OPIEDIR)/include/qpe/mediaplayerplugininterface.h 151 mediaplayerplugininterface.h
150 152
151loopcontrol.o: loopcontrol.cpp \ 153loopcontrol.o: loopcontrol.cpp \
152 $(OPIEDIR)/include/qpe/qpeapplication.h \ 154 $(OPIEDIR)/include/qpe/qpeapplication.h \
153 $(OPIEDIR)/include/qpe/qcopenvelope_qws.h \ 155 $(OPIEDIR)/include/qpedecoration_qws.h \
156 $(OPIEDIR)/include/timestring.h \
154 loopcontrol.h \ 157 loopcontrol.h \
155 videowidget.h \ 158 videowidget.h \
156 audiodevice.h \ 159 audiodevice.h \
157 mediaplayerplugininterface.h \ 160 mediaplayerplugininterface.h \
158 $(OPIEDIR)/include/qpe/qcom.h \ 161 $(OPIEDIR)/include/qpe/qcom.h \
159 $(OPIEDIR)/include/qpe/quuid.h \ 162 $(OPIEDIR)/include/qpe/quuid.h \
@@ -163,25 +166,27 @@ playlistselection.o: playlistselection.cpp \
163 $(OPIEDIR)/include/qpe/applnk.h \ 166 $(OPIEDIR)/include/qpe/applnk.h \
164 $(OPIEDIR)/include/qpe/resource.h \ 167 $(OPIEDIR)/include/qpe/resource.h \
165 playlistselection.h 168 playlistselection.h
166 169
167mediaplayerstate.o: mediaplayerstate.cpp \ 170mediaplayerstate.o: mediaplayerstate.cpp \
168 $(OPIEDIR)/include/qpe/qpeapplication.h \ 171 $(OPIEDIR)/include/qpe/qpeapplication.h \
172 $(OPIEDIR)/include/qpedecoration_qws.h \
173 $(OPIEDIR)/include/timestring.h \
169 $(OPIEDIR)/include/qpe/qlibrary.h \ 174 $(OPIEDIR)/include/qpe/qlibrary.h \
170 $(OPIEDIR)/include/qpe/qcom.h \ 175 $(OPIEDIR)/include/qpe/qcom.h \
171 $(OPIEDIR)/include/qpe/quuid.h \ 176 $(OPIEDIR)/include/qpe/quuid.h \
172 $(OPIEDIR)/include/qpe/mediaplayerplugininterface.h \
173 $(OPIEDIR)/include/qpe/config.h \ 177 $(OPIEDIR)/include/qpe/config.h \
178 mediaplayerplugininterface.h \
174 mediaplayerstate.h \ 179 mediaplayerstate.h \
175 libmad/libmadpluginimpl.h \ 180 libmad/libmadpluginimpl.h \
176 libmpeg3/libmpeg3pluginimpl.h \ 181 libmpeg3/libmpeg3pluginimpl.h \
177 wavplugin/wavpluginimpl.h 182 wavplugin/wavpluginimpl.h
178 183
179videowidget.o: videowidget.cpp \ 184videowidget.o: videowidget.cpp \
180 $(OPIEDIR)/include/qpe/resource.h \ 185 $(OPIEDIR)/include/qpe/resource.h \
181 $(OPIEDIR)/include/qpe/mediaplayerplugininterface.h \ 186 mediaplayerplugininterface.h \
182 $(OPIEDIR)/include/qpe/qcom.h \ 187 $(OPIEDIR)/include/qpe/qcom.h \
183 $(OPIEDIR)/include/qpe/quuid.h \ 188 $(OPIEDIR)/include/qpe/quuid.h \
184 videowidget.h \ 189 videowidget.h \
185 mediaplayerstate.h 190 mediaplayerstate.h
186 191
187audiowidget.o: audiowidget.cpp \ 192audiowidget.o: audiowidget.cpp \
@@ -190,41 +195,49 @@ audiowidget.o: audiowidget.cpp \
190 mediaplayerstate.h 195 mediaplayerstate.h
191 196
192playlistwidget.o: playlistwidget.cpp \ 197playlistwidget.o: playlistwidget.cpp \
193 $(OPIEDIR)/include/qpe/qpemenubar.h \ 198 $(OPIEDIR)/include/qpe/qpemenubar.h \
194 $(OPIEDIR)/include/qpe/qpetoolbar.h \ 199 $(OPIEDIR)/include/qpe/qpetoolbar.h \
195 $(OPIEDIR)/include/qpe/fileselector.h \ 200 $(OPIEDIR)/include/qpe/fileselector.h \
201 $(OPIEDIR)/include/filemanager.h \
202 $(OPIEDIR)/include/applnk.h \
203 $(OPIEDIR)/include/qpe/qpeapplication.h \
204 $(OPIEDIR)/include/qpedecoration_qws.h \
205 $(OPIEDIR)/include/timestring.h \
196 $(OPIEDIR)/include/qpe/applnk.h \ 206 $(OPIEDIR)/include/qpe/applnk.h \
197 $(OPIEDIR)/include/qpe/config.h \ 207 $(OPIEDIR)/include/qpe/config.h \
198 $(OPIEDIR)/include/qpe/global.h \ 208 $(OPIEDIR)/include/qpe/global.h \
199 $(OPIEDIR)/include/qpe/resource.h \ 209 $(OPIEDIR)/include/qpe/resource.h \
200 playlistselection.h \ 210 playlistselection.h \
201 playlistwidget.h \ 211 playlistwidget.h \
202 mediaplayerstate.h 212 mediaplayerstate.h
203 213
204mediaplayer.o: mediaplayer.cpp \ 214mediaplayer.o: mediaplayer.cpp \
205 $(OPIEDIR)/include/qpe/qpeapplication.h \ 215 $(OPIEDIR)/include/qpe/qpeapplication.h \
216 $(OPIEDIR)/include/qpedecoration_qws.h \
217 $(OPIEDIR)/include/timestring.h \
206 $(OPIEDIR)/include/qpe/qlibrary.h \ 218 $(OPIEDIR)/include/qpe/qlibrary.h \
207 $(OPIEDIR)/include/qpe/qcom.h \ 219 $(OPIEDIR)/include/qpe/qcom.h \
208 $(OPIEDIR)/include/qpe/quuid.h \ 220 $(OPIEDIR)/include/qpe/quuid.h \
209 $(OPIEDIR)/include/qpe/resource.h \ 221 $(OPIEDIR)/include/qpe/resource.h \
210 $(OPIEDIR)/include/qpe/config.h \ 222 $(OPIEDIR)/include/qpe/config.h \
211 mediaplayer.h \ 223 mediaplayer.h \
212 $(OPIEDIR)/include/qpe/mediaplayerplugininterface.h \ 224 mediaplayerplugininterface.h \
213 playlistwidget.h \ 225 playlistwidget.h \
214 $(OPIEDIR)/include/qpe/applnk.h \ 226 $(OPIEDIR)/include/qpe/applnk.h \
215 audiowidget.h \ 227 audiowidget.h \
216 loopcontrol.h \ 228 loopcontrol.h \
217 audiodevice.h \ 229 audiodevice.h \
218 mediaplayerstate.h 230 mediaplayerstate.h
219 231
220audiodevice.o: audiodevice.cpp \ 232audiodevice.o: audiodevice.cpp \
221 $(OPIEDIR)/include/qpe/qpeapplication.h \ 233 $(OPIEDIR)/include/qpe/qpeapplication.h \
234 $(OPIEDIR)/include/qpedecoration_qws.h \
235 $(OPIEDIR)/include/timestring.h \
222 $(OPIEDIR)/include/qpe/config.h \ 236 $(OPIEDIR)/include/qpe/config.h \
223 audiodevice.h \ 237 audiodevice.h
224 $(OPIEDIR)/include/qpe/qcopenvelope_qws.h
225 238
226moc_loopcontrol.o: moc_loopcontrol.cpp \ 239moc_loopcontrol.o: moc_loopcontrol.cpp \
227 loopcontrol.h 240 loopcontrol.h
228 241
229moc_playlistselection.o: moc_playlistselection.cpp \ 242moc_playlistselection.o: moc_playlistselection.cpp \
230 playlistselection.h \ 243 playlistselection.h \
@@ -245,13 +258,13 @@ moc_playlistwidget.o: moc_playlistwidget.cpp \
245 258
246moc_mediaplayer.o: moc_mediaplayer.cpp \ 259moc_mediaplayer.o: moc_mediaplayer.cpp \
247 mediaplayer.h \ 260 mediaplayer.h \
248 $(OPIEDIR)/include/qpe/qlibrary.h \ 261 $(OPIEDIR)/include/qpe/qlibrary.h \
249 $(OPIEDIR)/include/qpe/qcom.h \ 262 $(OPIEDIR)/include/qpe/qcom.h \
250 $(OPIEDIR)/include/qpe/quuid.h \ 263 $(OPIEDIR)/include/qpe/quuid.h \
251 $(OPIEDIR)/include/qpe/mediaplayerplugininterface.h 264 mediaplayerplugininterface.h
252 265
253moc_audiodevice.o: moc_audiodevice.cpp \ 266moc_audiodevice.o: moc_audiodevice.cpp \
254 audiodevice.h 267 audiodevice.h
255 268
256moc_loopcontrol.cpp: loopcontrol.h 269moc_loopcontrol.cpp: loopcontrol.h
257 $(MOC) loopcontrol.h -o moc_loopcontrol.cpp 270 $(MOC) loopcontrol.h -o moc_loopcontrol.cpp
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp
index 8861015..59136af 100644
--- a/core/multimedia/opieplayer/audiodevice.cpp
+++ b/core/multimedia/opieplayer/audiodevice.cpp
@@ -14,13 +14,17 @@
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// L.J.Potter added better error code Fri 02-15-2002 14:37:47
21
22
20#include <stdlib.h> 23#include <stdlib.h>
24#include <stdio.h>
21#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
22#include <qpe/config.h> 26#include <qpe/config.h>
23#include "audiodevice.h" 27#include "audiodevice.h"
24 28
25#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 29#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
26#include "qpe/qcopenvelope_qws.h" 30#include "qpe/qcopenvelope_qws.h"
@@ -109,16 +113,17 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume
109 waveOutClose( handle ); 113 waveOutClose( handle );
110 leftVolume = volume & 0xFFFF; 114 leftVolume = volume & 0xFFFF;
111 rightVolume = volume >> 16; 115 rightVolume = volume >> 16;
112#else 116#else
113 int mixerHandle = open( "/dev/mixer", O_RDWR ); 117 int mixerHandle = open( "/dev/mixer", O_RDWR );
114 if ( mixerHandle >= 0 ) { 118 if ( mixerHandle >= 0 ) {
115 ioctl( mixerHandle, MIXER_READ(0), &volume ); 119 if(ioctl( mixerHandle, MIXER_READ(0), &volume )==-1)
120 perror("ioctl(\"MIXER_READ\")");
116 close( mixerHandle ); 121 close( mixerHandle );
117 } else 122 } else
118 qDebug( "get volume of audio device failed" ); 123 perror("open(\"/dev/mixer\")");
119 leftVolume = ((volume & 0x00FF) << 16) / 101; 124 leftVolume = ((volume & 0x00FF) << 16) / 101;
120 rightVolume = ((volume & 0xFF00) << 8) / 101; 125 rightVolume = ((volume & 0xFF00) << 8) / 101;
121#endif 126#endif
122} 127}
123 128
124 129
@@ -154,16 +159,18 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
154 159
155# if 0 160# if 0
156 unsigned int lV = (leftVolume * 101) >> 16; 161 unsigned int lV = (leftVolume * 101) >> 16;
157 unsigned int volume = ((rV << 8) & 0xFF00) | (lV & 0x00FF); 162 unsigned int volume = ((rV << 8) & 0xFF00) | (lV & 0x00FF);
158 int mixerHandle = 0; 163 int mixerHandle = 0;
159 if ( ( mixerHandle = open( "/dev/mixer", O_RDWR ) ) >= 0 ) { 164 if ( ( mixerHandle = open( "/dev/mixer", O_RDWR ) ) >= 0 ) {
160 ioctl( mixerHandle, MIXER_WRITE(0), &volume ); 165 if(ioctl( mixerHandle, MIXER_WRITE(0), &volume ) ==-1)
166 perror("ioctl(\"MIXER_WRITE\")");
161 close( mixerHandle ); 167 close( mixerHandle );
162 } else 168 } else
163 qDebug( "set volume of audio device failed" ); 169 perror("open(\"/dev/mixer\")");
170
164# else 171# else
165 // This is the way this has to be done now I guess, doesn't allow for 172 // This is the way this has to be done now I guess, doesn't allow for
166 // independant right and left channel setting, or setting for different outputs 173 // independant right and left channel setting, or setting for different outputs
167 Config cfg("Sound"); 174 Config cfg("Sound");
168 cfg.setGroup("System"); 175 cfg.setGroup("System");
169 cfg.writeEntry("Volume",(int)rV); 176 cfg.writeEntry("Volume",(int)rV);
@@ -182,74 +189,53 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
182 189
183AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { 190AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
184 d = new AudioDevicePrivate; 191 d = new AudioDevicePrivate;
185 d->frequency = f; 192 d->frequency = f;
186 d->channels = chs; 193 d->channels = chs;
187 d->bytesPerSample = bps; 194 d->bytesPerSample = bps;
195 qDebug("%d",bps);
196 int format=0;
197 if( bps == 8) format = AFMT_U8;
198 else if( bps <= 0) format = AFMT_S16_LE;
199 else format = AFMT_S16_LE;
188 200
201 qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format);
189 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); 202 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
190 203
191#ifdef Q_OS_WIN32
192 UINT result;
193 WAVEFORMATEX formatData;
194 formatData.cbSize = sizeof(WAVEFORMATEX);
195/*
196 // Other possible formats windows supports
197 formatData.wFormatTag = WAVE_FORMAT_MPEG;
198 formatData.wFormatTag = WAVE_FORMAT_MPEGLAYER3;
199 formatData.wFormatTag = WAVE_FORMAT_ADPCM;
200*/
201 formatData.wFormatTag = WAVE_FORMAT_PCM;
202 formatData.nAvgBytesPerSec = bps * chs * f;
203 formatData.nBlockAlign = bps * chs;
204 formatData.nChannels = chs;
205 formatData.nSamplesPerSec = f;
206 formatData.wBitsPerSample = bps * 8;
207 // Open a waveform device for output
208 if (result = waveOutOpen((LPHWAVEOUT)&d->handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL)) {
209 QString errorMsg = "error opening audio device.\nReason: %i - ";
210 switch (result) {
211 case MMSYSERR_ALLOCATED:errorMsg += "Specified resource is already allocated."; break;
212 case MMSYSERR_BADDEVICEID:errorMsg += "Specified device identifier is out of range."; break;
213 case MMSYSERR_NODRIVER:errorMsg += "No device driver is present."; break;
214 case MMSYSERR_NOMEM:errorMsg += "Unable to allocate or lock memory."; break;
215 case WAVERR_BADFORMAT:errorMsg += "Attempted to open with an unsupported waveform-audio format."; break;
216 case WAVERR_SYNC: errorMsg += "The device is synchronous but waveOutOpen was called without using the WAVE_ALLOWSYNC flag."; break;
217 default: errorMsg += "Undefined error"; break;
218 }
219 qDebug( errorMsg, result );
220 }
221
222 d->bufferSize = sound_fragment_bytes;
223#else
224 204
225 int fragments = 0x10000 * 8 + sound_fragment_shift; 205 int fragments = 0x10000 * 8 + sound_fragment_shift;
226 int format = AFMT_S16_LE;
227 int capabilities = 0; 206 int capabilities = 0;
228 207
229#ifdef KEEP_DEVICE_OPEN 208#ifdef KEEP_DEVICE_OPEN
230 if ( AudioDevicePrivate::dspFd == 0 ) { 209 if ( AudioDevicePrivate::dspFd == 0 ) {
231#endif 210#endif
232 if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { 211 if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) {
233 qDebug( "error opening audio device /dev/dsp, sending data to /dev/null instead" ); 212 perror("open(\"/dev/dsp\") sending to /dev/null instead");
234 d->handle = ::open( "/dev/null", O_WRONLY ); 213 d->handle = ::open( "/dev/null", O_WRONLY );
235 } 214 }
236#ifdef KEEP_DEVICE_OPEN 215#ifdef KEEP_DEVICE_OPEN
237 AudioDevicePrivate::dspFd = d->handle; 216 AudioDevicePrivate::dspFd = d->handle;
238 } else { 217 } else {
239 d->handle = AudioDevicePrivate::dspFd; 218 d->handle = AudioDevicePrivate::dspFd;
240 } 219 }
241#endif 220#endif
242 221
243 ioctl( d->handle, SNDCTL_DSP_GETCAPS, &capabilities ); 222 if(ioctl( d->handle, SNDCTL_DSP_GETCAPS, &capabilities )==-1)
244 ioctl( d->handle, SNDCTL_DSP_SETFRAGMENT, &fragments ); 223 perror("ioctl(\"SNDCTL_DSP_GETCAPS\")");
245 ioctl( d->handle, SNDCTL_DSP_SETFMT, &format ); 224 if(ioctl( d->handle, SNDCTL_DSP_SETFRAGMENT, &fragments )==-1)
246 ioctl( d->handle, SNDCTL_DSP_SPEED, &d->frequency ); 225 perror("ioctl(\"SNDCTL_DSP_SETFRAGMENT\")");
226 if(ioctl( d->handle, SNDCTL_DSP_SETFMT, & format )==-1)
227 perror("ioctl(\"SNDCTL_DSP_SETFMT\")");
228 qDebug("freq %d", d->frequency);
229 if(ioctl( d->handle, SNDCTL_DSP_SPEED, &d->frequency )==-1)
230 perror("ioctl(\"SNDCTL_DSP_SPEED\")");
231 qDebug("channels %d",d->channels);
247 if ( ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ) == -1 ) { 232 if ( ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ) == -1 ) {
248 d->channels = ( d->channels == 1 ) ? 2 : d->channels; 233 d->channels = ( d->channels == 1 ) ? 2 : d->channels;
249 ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ); 234 if(ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels )==-1)
235 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")");
250 } 236 }
251 237
252 d->bufferSize = sound_fragment_bytes; 238 d->bufferSize = sound_fragment_bytes;
253 d->unwrittenBuffer = new char[d->bufferSize]; 239 d->unwrittenBuffer = new char[d->bufferSize];
254 d->unwritten = 0; 240 d->unwritten = 0;
255 d->can_GETOSPACE = TRUE; // until we find otherwise 241 d->can_GETOSPACE = TRUE; // until we find otherwise
@@ -257,13 +243,12 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
257 //if ( chs != d->channels ) qDebug( "Wanted %d, got %d channels", chs, d->channels ); 243 //if ( chs != d->channels ) qDebug( "Wanted %d, got %d channels", chs, d->channels );
258 //if ( f != d->frequency ) qDebug( "wanted %dHz, got %dHz", f, d->frequency ); 244 //if ( f != d->frequency ) qDebug( "wanted %dHz, got %dHz", f, d->frequency );
259 //if ( capabilities & DSP_CAP_BATCH ) qDebug( "Sound card has local buffer" ); 245 //if ( capabilities & DSP_CAP_BATCH ) qDebug( "Sound card has local buffer" );
260 //if ( capabilities & DSP_CAP_REALTIME )qDebug( "Sound card has realtime sync" ); 246 //if ( capabilities & DSP_CAP_REALTIME )qDebug( "Sound card has realtime sync" );
261 //if ( capabilities & DSP_CAP_TRIGGER ) qDebug( "Sound card has precise trigger" ); 247 //if ( capabilities & DSP_CAP_TRIGGER ) qDebug( "Sound card has precise trigger" );
262 //if ( capabilities & DSP_CAP_MMAP ) qDebug( "Sound card can mmap" ); 248 //if ( capabilities & DSP_CAP_MMAP ) qDebug( "Sound card can mmap" );
263#endif
264} 249}
265 250
266 251
267AudioDevice::~AudioDevice() { 252AudioDevice::~AudioDevice() {
268#ifdef Q_OS_WIN32 253#ifdef Q_OS_WIN32
269 waveOutClose( (HWAVEOUT)d->handle ); 254 waveOutClose( (HWAVEOUT)d->handle );
diff --git a/core/multimedia/opieplayer/audiodevice.h b/core/multimedia/opieplayer/audiodevice.h
index 928f134..dcd79fe 100644
--- a/core/multimedia/opieplayer/audiodevice.h
+++ b/core/multimedia/opieplayer/audiodevice.h
@@ -14,26 +14,30 @@
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// L.J.Potter added changes Fri 02-15-2002
21
22
20#ifndef AUDIODEVICE_H 23#ifndef AUDIODEVICE_H
21#define AUDIODEVICE_H 24#define AUDIODEVICE_H
22 25
23 26
24#include <qobject.h> 27#include <qobject.h>
28#include <sys/soundcard.h>
25 29
26 30
27class AudioDevicePrivate; 31class AudioDevicePrivate;
28 32
29 33
30class AudioDevice : public QObject { 34class AudioDevice : public QObject {
31 Q_OBJECT 35 Q_OBJECT
32public: 36public:
33 AudioDevice( unsigned int freq = 44000, unsigned int channels = 2, unsigned int bytesPerSample = 2 ); 37 AudioDevice( unsigned int freq = 44000, unsigned int channels = 2, unsigned int bytesPerSample = AFMT_S16_LE );
34 ~AudioDevice(); 38 ~AudioDevice();
35 39
36 unsigned int canWrite() const; 40 unsigned int canWrite() const;
37 void write( char *buffer, unsigned int length ); 41 void write( char *buffer, unsigned int length );
38 int bytesWritten(); 42 int bytesWritten();
39 43
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index 243c58c..0d88591 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -58,13 +58,13 @@ MediaButton audioButtons[] = {
58static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton)); 58static const int numButtons = (sizeof(audioButtons)/sizeof(MediaButton));
59 59
60 60
61AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : 61AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
62 QWidget( parent, name, f ) 62 QWidget( parent, name, f )
63{ 63{
64 setCaption( tr("MediaPlayer") ); 64 setCaption( tr("OpiePlayer") );
65 setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/metalFinish" ) ); 65 setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/metalFinish" ) );
66 pixmaps[0] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaButtonsAll" ) ); 66 pixmaps[0] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaButtonsAll" ) );
67 pixmaps[1] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaButtonsBig" ) ); 67 pixmaps[1] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaButtonsBig" ) );
68 pixmaps[2] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaControls" ) ); 68 pixmaps[2] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaControls" ) );
69 pixmaps[3] = new QPixmap( Resource::loadPixmap( "mpegplayer/animatedButton" ) ); 69 pixmaps[3] = new QPixmap( Resource::loadPixmap( "mpegplayer/animatedButton" ) );
70 70
diff --git a/core/multimedia/opieplayer/libflash/libflashplugin.h b/core/multimedia/opieplayer/libflash/libflashplugin.h
index 532bca2..a2f1c42 100644
--- a/core/multimedia/opieplayer/libflash/libflashplugin.h
+++ b/core/multimedia/opieplayer/libflash/libflashplugin.h
@@ -21,13 +21,14 @@
21#define LIBFLASH_PLUGIN_H 21#define LIBFLASH_PLUGIN_H
22 22
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qapplication.h> 25#include <qapplication.h>
26#include "flash.h" 26#include "flash.h"
27#include "mediaplayerplugininterface.h" 27//#include <qpe/mediaplayerplugininterface.h>
28#include "../mediaplayerplugininterface.h"
28 29
29 30
30class LibFlashPlugin : public MediaPlayerDecoder { 31class LibFlashPlugin : public MediaPlayerDecoder {
31 32
32public: 33public:
33 LibFlashPlugin(); 34 LibFlashPlugin();
@@ -45,12 +46,13 @@ public:
45 46
46 // If decoder doesn't support audio then return 0 here 47 // If decoder doesn't support audio then return 0 here
47 int audioStreams() { return 1; } 48 int audioStreams() { return 1; }
48 int audioChannels( int /*stream*/ ) { return 2; } 49 int audioChannels( int /*stream*/ ) { return 2; }
49 int audioFrequency( int /*stream*/ ) { return 44100; } 50 int audioFrequency( int /*stream*/ ) { return 44100; }
50 int audioSamples( int /*stream*/ ) { return 1000000; } 51 int audioSamples( int /*stream*/ ) { return 1000000; }
52int audioBitsPerSample(int) { return 0;}
51 bool audioSetSample( long sample, int stream ); 53 bool audioSetSample( long sample, int stream );
52 long audioGetSample( int stream ); 54 long audioGetSample( int stream );
53 //bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); 55 //bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
54 //bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); 56 //bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
55 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); 57 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
56 //bool audioReadSamples( short *output, int channel, long samples, int stream ); 58 //bool audioReadSamples( short *output, int channel, long samples, int stream );
diff --git a/core/multimedia/opieplayer/libflash/libflashpluginimpl.h b/core/multimedia/opieplayer/libflash/libflashpluginimpl.h
index b5cc869..cb8d959 100644
--- a/core/multimedia/opieplayer/libflash/libflashpluginimpl.h
+++ b/core/multimedia/opieplayer/libflash/libflashpluginimpl.h
@@ -18,12 +18,13 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef LIBFLASH_PLUGIN_IMPL_H 20#ifndef LIBFLASH_PLUGIN_IMPL_H
21#define LIBFLASH_PLUGIN_IMPL_H 21#define LIBFLASH_PLUGIN_IMPL_H
22 22
23 23
24//#include <qpe/mediaplayerplugininterface.h>
24#include "../mediaplayerplugininterface.h" 25#include "../mediaplayerplugininterface.h"
25 26
26 27
27class LibFlashPlugin; 28class LibFlashPlugin;
28 29
29 30
diff --git a/core/multimedia/opieplayer/libflash/swf.h b/core/multimedia/opieplayer/libflash/swf.h
index 5f5e4f7..48986cc 100644
--- a/core/multimedia/opieplayer/libflash/swf.h
+++ b/core/multimedia/opieplayer/libflash/swf.h
@@ -205,13 +205,13 @@ struct FlashMovie;
205 205
206extern "C" { 206extern "C" {
207#include "jpeglib.h" 207#include "jpeglib.h"
208}; 208};
209extern "C" { 209extern "C" {
210//#include "zlib.h" 210//#include "zlib.h"
211#include "../src/3rdparty/zlib/zlib.h" 211#include "/opt/qt-2.3.2-embedded/src/3rdparty/zlib/zlib.h"
212}; 212};
213 213
214#include "graphic.h" 214#include "graphic.h"
215#include "character.h" 215#include "character.h"
216#include "bitmap.h" 216#include "bitmap.h"
217#include "shape.h" 217#include "shape.h"
diff --git a/core/multimedia/opieplayer/libmad/Makefile.in b/core/multimedia/opieplayer/libmad/Makefile.in
index e9f74e7..552043c 100644
--- a/core/multimedia/opieplayer/libmad/Makefile.in
+++ b/core/multimedia/opieplayer/libmad/Makefile.in
@@ -211,13 +211,15 @@ layer3.o: layer3.c \
211huffman.o: huffman.c \ 211huffman.o: huffman.c \
212 libmad_global.h \ 212 libmad_global.h \
213 huffman.h 213 huffman.h
214 214
215libmadplugin.o: libmadplugin.cpp \ 215libmadplugin.o: libmadplugin.cpp \
216 libmadplugin.h \ 216 libmadplugin.h \
217 ../mediaplayerplugininterface.h \
217 mad.h 218 mad.h
218 219
219libmadpluginimpl.o: libmadpluginimpl.cpp \ 220libmadpluginimpl.o: libmadpluginimpl.cpp \
220 libmadplugin.h \ 221 libmadplugin.h \
222 ../mediaplayerplugininterface.h \
221 libmadpluginimpl.h 223 libmadpluginimpl.h
222 224
223 225
diff --git a/core/multimedia/opieplayer/libmad/libmad.pro b/core/multimedia/opieplayer/libmad/libmad.pro
index 6c40a15..b54ca6b 100644
--- a/core/multimedia/opieplayer/libmad/libmad.pro
+++ b/core/multimedia/opieplayer/libmad/libmad.pro
@@ -5,8 +5,10 @@ HEADERS = libmad_version.h fixed.h bit.h timer.h stream.h frame.h synth.h dec
5 SOURCES = version.c fixed.c bit.c timer.c stream.c frame.c synth.c decoder.c \ 5 SOURCES = version.c fixed.c bit.c timer.c stream.c frame.c synth.c decoder.c \
6 layer12.c layer3.c huffman.c libmadplugin.cpp libmadpluginimpl.cpp 6 layer12.c layer3.c huffman.c libmadplugin.cpp libmadpluginimpl.cpp
7 TARGET = madplugin 7 TARGET = madplugin
8 DESTDIR = ../../plugins/codecs 8 DESTDIR = ../../plugins/codecs
9INCLUDEPATH += $(OPIEDIR)/include .. 9INCLUDEPATH += $(OPIEDIR)/include ..
10DEPENDPATH += ../$(OPIEDIR)/include .. 10DEPENDPATH += ../$(OPIEDIR)/include ..
11TMAKE_CFLAGS += -DFPM_64BIT
12TMAKE_CXXFLAGS += -DFPM_64BIT
11LIBS += -lqpe -lm 13LIBS += -lqpe -lm
12 VERSION = 1.0.0 14 VERSION = 1.0.0
diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.h b/core/multimedia/opieplayer/libmad/libmadplugin.h
index 88647ae..ff84c27 100644
--- a/core/multimedia/opieplayer/libmad/libmadplugin.h
+++ b/core/multimedia/opieplayer/libmad/libmadplugin.h
@@ -19,13 +19,17 @@
19**********************************************************************/ 19**********************************************************************/
20#ifndef LIBMAD_PLUGIN_H 20#ifndef LIBMAD_PLUGIN_H
21#define LIBMAD_PLUGIN_H 21#define LIBMAD_PLUGIN_H
22 22
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include "mediaplayerplugininterface.h" 25//#include <qpe/mediaplayerplugininterface.h>
26#include "../mediaplayerplugininterface.h"
27
28
29// #define OLD_MEDIAPLAYER_API
26 30
27 31
28class LibMadPluginData; 32class LibMadPluginData;
29 33
30 34
31class LibMadPlugin : public MediaPlayerDecoder { 35class LibMadPlugin : public MediaPlayerDecoder {
@@ -47,18 +51,22 @@ public:
47 // If decoder doesn't support audio then return 0 here 51 // If decoder doesn't support audio then return 0 here
48 int audioStreams(); 52 int audioStreams();
49 int audioChannels( int stream ); 53 int audioChannels( int stream );
50 int audioFrequency( int stream ); 54 int audioFrequency( int stream );
51 int audioSamples( int stream ); 55 int audioSamples( int stream );
52 bool audioSetSample( long sample, int stream ); 56 bool audioSetSample( long sample, int stream );
57 int audioBitsPerSample(int) {return 0;}
53 long audioGetSample( int stream ); 58 long audioGetSample( int stream );
54// bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); 59#ifdef OLD_MEDIAPLAYER_API
55// bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); 60 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
61 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
62 bool audioReadSamples( short *output, int channel, long samples, int stream );
63 bool audioReReadSamples( short *output, int channel, long samples, int stream );
64#else
56 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); 65 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
57// bool audioReadSamples( short *output, int channel, long samples, int stream ); 66#endif
58// bool audioReReadSamples( short *output, int channel, long samples, int stream );
59 67
60 68
61 bool read(); 69 bool read();
62 bool decode( short *output, long samples, long& samplesRead ); 70 bool decode( short *output, long samples, long& samplesRead );
63 void printID3Tags(); 71 void printID3Tags();
64 72
@@ -88,12 +96,14 @@ public:
88 bool supportsYUV() { return FALSE; } 96 bool supportsYUV() { return FALSE; }
89 bool supportsMMX() { return TRUE; } 97 bool supportsMMX() { return TRUE; }
90 bool supportsSMP() { return FALSE; } 98 bool supportsSMP() { return FALSE; }
91 bool supportsStereo() { return TRUE; } 99 bool supportsStereo() { return TRUE; }
92 bool supportsScaling() { return FALSE; } 100 bool supportsScaling() { return FALSE; }
93 101
102 long getPlayTime() { return -1; }
103
94private: 104private:
95 LibMadPluginData *d; 105 LibMadPluginData *d;
96 QString info; 106 QString info;
97 107
98}; 108};
99 109
diff --git a/core/multimedia/opieplayer/libmad/libmadpluginimpl.h b/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
index a26b421..8ad4956 100644
--- a/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
+++ b/core/multimedia/opieplayer/libmad/libmadpluginimpl.h
@@ -18,12 +18,13 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef LIBMAD_PLUGIN_IMPL_H 20#ifndef LIBMAD_PLUGIN_IMPL_H
21#define LIBMAD_PLUGIN_IMPL_H 21#define LIBMAD_PLUGIN_IMPL_H
22 22
23 23
24//#include <qpe/mediaplayerplugininterface.h>
24#include "../mediaplayerplugininterface.h" 25#include "../mediaplayerplugininterface.h"
25 26
26 27
27class LibMadPlugin; 28class LibMadPlugin;
28 29
29 30
@@ -39,13 +40,12 @@ public:
39 Q_REFCOUNT 40 Q_REFCOUNT
40 41
41#endif 42#endif
42 43
43 virtual MediaPlayerDecoder *decoder(); 44 virtual MediaPlayerDecoder *decoder();
44 virtual MediaPlayerEncoder *encoder(); 45 virtual MediaPlayerEncoder *encoder();
45
46private: 46private:
47 LibMadPlugin *libmadplugin; 47 LibMadPlugin *libmadplugin;
48 ulong ref; 48 ulong ref;
49}; 49};
50 50
51 51
diff --git a/core/multimedia/opieplayer/libmad/version.c b/core/multimedia/opieplayer/libmad/version.c
index 413d54b..1baba26 100644
--- a/core/multimedia/opieplayer/libmad/version.c
+++ b/core/multimedia/opieplayer/libmad/version.c
diff --git a/core/multimedia/opieplayer/libmpeg3/Makefile.in b/core/multimedia/opieplayer/libmpeg3/Makefile.in
index 154f85d..d255e4f 100644
--- a/core/multimedia/opieplayer/libmpeg3/Makefile.in
+++ b/core/multimedia/opieplayer/libmpeg3/Makefile.in
@@ -173,13 +173,14 @@ libmpeg3plugin.o: libmpeg3plugin.cpp \
173 mpeg3io.h \ 173 mpeg3io.h \
174 mpeg3css.h \ 174 mpeg3css.h \
175 mpeg3private.inc \ 175 mpeg3private.inc \
176 audio/mpeg3audio.h \ 176 audio/mpeg3audio.h \
177 mpeg3vtrack.h \ 177 mpeg3vtrack.h \
178 video/mpeg3video.h \ 178 video/mpeg3video.h \
179 mpeg3protos.h 179 mpeg3protos.h \
180 ../mediaplayerplugininterface.h
180 181
181libmpeg3pluginimpl.o: libmpeg3pluginimpl.cpp \ 182libmpeg3pluginimpl.o: libmpeg3pluginimpl.cpp \
182 libmpeg3plugin.h \ 183 libmpeg3plugin.h \
183 libmpeg3.h \ 184 libmpeg3.h \
184 mpeg3private.h \ 185 mpeg3private.h \
185 mpeg3atrack.h \ 186 mpeg3atrack.h \
@@ -189,12 +190,13 @@ libmpeg3pluginimpl.o: libmpeg3pluginimpl.cpp \
189 mpeg3css.h \ 190 mpeg3css.h \
190 mpeg3private.inc \ 191 mpeg3private.inc \
191 audio/mpeg3audio.h \ 192 audio/mpeg3audio.h \
192 mpeg3vtrack.h \ 193 mpeg3vtrack.h \
193 video/mpeg3video.h \ 194 video/mpeg3video.h \
194 mpeg3protos.h \ 195 mpeg3protos.h \
196 ../mediaplayerplugininterface.h \
195 libmpeg3pluginimpl.h 197 libmpeg3pluginimpl.h
196 198
197bitstream.o: bitstream.c \ 199bitstream.o: bitstream.c \
198 mpeg3private.h \ 200 mpeg3private.h \
199 mpeg3atrack.h \ 201 mpeg3atrack.h \
200 mpeg3demux.h \ 202 mpeg3demux.h \
@@ -411,13 +413,13 @@ audio/layer2.o: audio/layer2.c \
411 mpeg3vtrack.h \ 413 mpeg3vtrack.h \
412 video/mpeg3video.h \ 414 video/mpeg3video.h \
413 audio/../mpeg3protos.h \ 415 audio/../mpeg3protos.h \
414 audio/tables.h 416 audio/tables.h
415 417
416audio/layer3.o: audio/layer3.c \ 418audio/layer3.o: audio/layer3.c \
417 audio/huffman.h \ 419 huffman.h \
418 audio/mpeg3audio.h \ 420 audio/mpeg3audio.h \
419 audio/ac3.h \ 421 audio/ac3.h \
420 audio/mpeg3real.h \ 422 audio/mpeg3real.h \
421 audio/../bitstream.h \ 423 audio/../bitstream.h \
422 mpeg3demux.h \ 424 mpeg3demux.h \
423 mpeg3title.h \ 425 mpeg3title.h \
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
index 0a06264..54f259b 100644
--- a/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
+++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3plugin.h
@@ -22,13 +22,17 @@
22 22
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qapplication.h> 25#include <qapplication.h>
26#include "libmpeg3.h" 26#include "libmpeg3.h"
27#include "mpeg3protos.h" 27#include "mpeg3protos.h"
28#include "mediaplayerplugininterface.h" 28//#include <qpe/mediaplayerplugininterface.h>
29#include "../mediaplayerplugininterface.h"
30
31
32// #define OLD_MEDIAPLAYER_API
29 33
30 34
31class LibMpeg3Plugin : public MediaPlayerDecoder { 35class LibMpeg3Plugin : public MediaPlayerDecoder {
32 36
33public: 37public:
34 LibMpeg3Plugin() { file = NULL; } 38 LibMpeg3Plugin() { file = NULL; }
@@ -39,26 +43,30 @@ public:
39 double pluginVersion() { return 1.0; } 43 double pluginVersion() { return 1.0; }
40 44
41 bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; } 45 bool isFileSupported( const QString& fileName ) { return mpeg3_check_sig( (char *)fileName.latin1() ) == 1; }
42 bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; } 46 bool open( const QString& fileName ) { file = mpeg3_open( (char *)fileName.latin1() ); return file != NULL; }
43 bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; } 47 bool close() { if ( file ) { int r = mpeg3_close( file ); file = NULL; return r == 1; } return FALSE; }
44 bool isOpen() { return file != NULL; } 48 bool isOpen() { return file != NULL; }
45 const QString &fileInfo() { return strInfo = QString( "" ); } 49 const QString &fileInfo() { return strInfo = ""; }
46 50
47 // If decoder doesn't support audio then return 0 here 51 // If decoder doesn't support audio then return 0 here
48 int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; } 52 int audioStreams() { return file ? mpeg3_total_astreams( file ) : 0; }
49 int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; } 53 int audioChannels( int stream ) { return file ? mpeg3_audio_channels( file, stream ) : 0; }
50 int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; } 54 int audioFrequency( int stream ) { return file ? mpeg3_sample_rate( file, stream ) : 0; }
55 int audioBitsPerSample(int) { return 0;}
51 int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; } 56 int audioSamples( int stream ) { return file ? mpeg3_audio_samples( file, stream ) : 0; }
52 bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; } 57 bool audioSetSample( long sample, int stream ) { return file ? mpeg3_set_sample( file, sample, stream) == 1 : FALSE; }
53 long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; } 58 long audioGetSample( int stream ) { return file ? mpeg3_get_sample( file, stream ) : 0; }
54// bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); 59#ifdef OLD_MEDIAPLAYER_API
55// bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); 60 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
61 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
62 bool audioReadSamples( short *output, int channel, long samples, int stream );
63 bool audioReReadSamples( short *output, int channel, long samples, int stream );
64#else
56 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); 65 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
57// bool audioReadSamples( short *output, int channel, long samples, int stream ); 66#endif
58// bool audioReReadSamples( short *output, int channel, long samples, int stream );
59 67
60 // If decoder doesn't support video then return 0 here 68 // If decoder doesn't support video then return 0 here
61 int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; } 69 int videoStreams() { return file ? mpeg3_total_vstreams( file ) : 0; }
62 int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; } 70 int videoWidth( int stream ) { return file ? mpeg3_video_width( file, stream ) : 0; }
63 int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; } 71 int videoHeight( int stream ) { return file ? mpeg3_video_height( file, stream ) : 0; }
64 double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; } 72 double videoFrameRate( int stream ) { return file ? mpeg3_frame_rate( file, stream ) : 0.0; }
@@ -99,12 +107,14 @@ public:
99 bool supportsYUV() { return TRUE; } 107 bool supportsYUV() { return TRUE; }
100 bool supportsMMX() { return TRUE; } 108 bool supportsMMX() { return TRUE; }
101 bool supportsSMP() { return TRUE; } 109 bool supportsSMP() { return TRUE; }
102 bool supportsStereo() { return TRUE; } 110 bool supportsStereo() { return TRUE; }
103 bool supportsScaling() { return TRUE; } 111 bool supportsScaling() { return TRUE; }
104 112
113 long getPlayTime() { return -1; }
114
105private: 115private:
106 mpeg3_t *file; 116 mpeg3_t *file;
107 QString strInfo; 117 QString strInfo;
108 118
109}; 119};
110 120
diff --git a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h
index 29ec6ba..89abf97 100644
--- a/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h
+++ b/core/multimedia/opieplayer/libmpeg3/libmpeg3pluginimpl.h
@@ -18,12 +18,13 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef LIBMPEG3_PLUGIN_IMPL_H 20#ifndef LIBMPEG3_PLUGIN_IMPL_H
21#define LIBMPEG3_PLUGIN_IMPL_H 21#define LIBMPEG3_PLUGIN_IMPL_H
22 22
23 23
24//#include <qpe/mediaplayerplugininterface.h>
24#include "../mediaplayerplugininterface.h" 25#include "../mediaplayerplugininterface.h"
25 26
26 27
27class LibMpeg3Plugin; 28class LibMpeg3Plugin;
28 29
29 30
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp
index 6dfd057..859a67a 100644
--- a/core/multimedia/opieplayer/loopcontrol.cpp
+++ b/core/multimedia/opieplayer/loopcontrol.cpp
@@ -14,13 +14,16 @@
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// L.J.Potter added changes Fri 02-15-2002
21
20#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
23
21#ifdef Q_WS_QWS 24#ifdef Q_WS_QWS
22#include <qpe/qcopenvelope_qws.h> 25#include <qpe/qcopenvelope_qws.h>
23#endif 26#endif
24#include <stdio.h> 27#include <stdio.h>
25#include <stdlib.h> 28#include <stdlib.h>
26#include <string.h> 29#include <string.h>
@@ -229,19 +232,20 @@ void LoopControl::startAudio() {
229 232
230 long samplesRead = 0; 233 long samplesRead = 0;
231 bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream ); 234 bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream );
232 long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000; 235 long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000;
233 long sampleWaitTime = currentSample - sampleWeShouldBeAt; 236 long sampleWaitTime = currentSample - sampleWeShouldBeAt;
234 237
235 if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { 238// if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 5000 ) ) {
236 usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); 239// usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) );
237 } else if ( sampleWaitTime <= -5000 ) { 240// }
238 qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); 241// else if ( sampleWaitTime <= -5000 ) {
239 //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); 242// qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt );
240 currentSample = sampleWeShouldBeAt; 243// //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream );
241 } 244// currentSample = sampleWeShouldBeAt;
245// }
242 246
243 audioDevice->write( audioBuffer, samplesRead * 2 * channels ); 247 audioDevice->write( audioBuffer, samplesRead * 2 * channels );
244 audioSampleCounter = currentSample + samplesRead - 1; 248 audioSampleCounter = currentSample + samplesRead - 1;
245 249
246 moreAudio = readOk && (audioSampleCounter <= total_audio_samples); 250 moreAudio = readOk && (audioSampleCounter <= total_audio_samples);
247 251
@@ -370,29 +374,29 @@ bool LoopControl::init( const QString& filename ) {
370 hasVideoChannel = mediaPlayerState->curDecoder()->videoStreams() > 0; 374 hasVideoChannel = mediaPlayerState->curDecoder()->videoStreams() > 0;
371 375
372 if ( hasAudioChannel ) { 376 if ( hasAudioChannel ) {
373 int astream = 0; 377 int astream = 0;
374 378
375 channels = mediaPlayerState->curDecoder()->audioChannels( astream ); 379 channels = mediaPlayerState->curDecoder()->audioChannels( astream );
376 DecodeLoopDebug(( "channels = %d\n", channels )); 380 qDebug( "LC- channels = %d", channels );
377 381
378 if ( !total_audio_samples ) 382 if ( !total_audio_samples )
379 total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream ); 383 total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream );
380 384
381 total_audio_samples += 1000; 385// total_audio_samples += 1000;
382 386
383 mediaPlayerState->setLength( total_audio_samples ); 387 mediaPlayerState->setLength( total_audio_samples );
384 388
385 freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); 389 freq = mediaPlayerState->curDecoder()->audioFrequency( astream );
386 DecodeLoopDebug(( "frequency = %d\n", freq )); 390 qDebug( "LC- frequency = %d", freq );
387 391
388 audioSampleCounter = 0; 392 audioSampleCounter = 0;
389 393
390 static const int bytes_per_sample = 2; //16 bit 394 int bits_per_sample = mediaPlayerState->curDecoder()->audioBitsPerSample( astream);
391 395
392 audioDevice = new AudioDevice( freq, channels, bytes_per_sample ); 396 audioDevice = new AudioDevice( freq, channels, bits_per_sample);
393 audioBuffer = new char[ audioDevice->bufferSize() ]; 397 audioBuffer = new char[ audioDevice->bufferSize() ];
394 channels = audioDevice->channels(); 398 channels = audioDevice->channels();
395 399
396 //### must check which frequency is actually used. 400 //### must check which frequency is actually used.
397 static const int size = 1; 401 static const int size = 1;
398 short int buf[size]; 402 short int buf[size];
diff --git a/core/multimedia/opieplayer/loopcontrol.h b/core/multimedia/opieplayer/loopcontrol.h
index 967ee25..fc7d316 100644
--- a/core/multimedia/opieplayer/loopcontrol.h
+++ b/core/multimedia/opieplayer/loopcontrol.h
@@ -14,12 +14,14 @@
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// L.J.Potter added changes Fri 02-15-2002
21
20#ifndef MPEGVIEW_H 22#ifndef MPEGVIEW_H
21#define MPEGVIEW_H 23#define MPEGVIEW_H
22 24
23 25
24#include <qwidget.h> 26#include <qwidget.h>
25#include <qdatetime.h> 27#include <qdatetime.h>
diff --git a/core/multimedia/opieplayer/loopcontrol_threaded.cpp b/core/multimedia/opieplayer/loopcontrol_threaded.cpp
index 2ec4a48..2e49bb7 100644
--- a/core/multimedia/opieplayer/loopcontrol_threaded.cpp
+++ b/core/multimedia/opieplayer/loopcontrol_threaded.cpp
@@ -23,23 +23,23 @@
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qimage.h> 24#include <qimage.h>
25#include <qpainter.h> 25#include <qpainter.h>
26#ifdef Q_WS_QWS 26#ifdef Q_WS_QWS
27#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
28#endif 28#endif
29#include "mediaplayerplugininterface.h"
29#include <stdio.h> 30#include <stdio.h>
30#include <stdlib.h> 31#include <stdlib.h>
31#include <string.h> 32#include <string.h>
32#include <time.h> 33#include <time.h>
33#include <unistd.h> 34#include <unistd.h>
34#include <pthread.h> 35#include <pthread.h>
35#include "loopcontrol.h" 36#include "loopcontrol.h"
36#include "audiodevice.h" 37#include "audiodevice.h"
37#include "videowidget.h" 38#include "videowidget.h"
38#include "audiowidget.h" 39#include "audiowidget.h"
39#include "mediaplayerplugininterface.h"
40#include "mediaplayerstate.h" 40#include "mediaplayerstate.h"
41 41
42 42
43#if defined(QT_QWS_CUSTOM) || defined(QT_QWS_IPAQ) 43#if defined(QT_QWS_CUSTOM) || defined(QT_QWS_IPAQ)
44#define USE_REALTIME_AUDIO_THREAD 44#define USE_REALTIME_AUDIO_THREAD
45#endif 45#endif
diff --git a/core/multimedia/opieplayer/main.cpp b/core/multimedia/opieplayer/main.cpp
index 5246e40..9f7ef73 100644
--- a/core/multimedia/opieplayer/main.cpp
+++ b/core/multimedia/opieplayer/main.cpp
@@ -45,13 +45,13 @@ int main(int argc, char **argv) {
45 VideoWidget vw( 0, "videoUI" ); 45 VideoWidget vw( 0, "videoUI" );
46 videoUI = &vw; 46 videoUI = &vw;
47 LoopControl lc( 0, "loopControl" ); 47 LoopControl lc( 0, "loopControl" );
48 loopControl = &lc; 48 loopControl = &lc;
49 MediaPlayer mp( 0, "mediaPlayer" ); 49 MediaPlayer mp( 0, "mediaPlayer" );
50 50
51 pl.setCaption( MediaPlayer::tr("Media Player") ); 51 pl.setCaption( MediaPlayer::tr("Opie Player") );
52 a.showMainDocumentWidget(&pl); 52 a.showMainDocumentWidget(&pl);
53 53
54 return a.exec(); 54 return a.exec();
55} 55}
56 56
57 57
diff --git a/core/multimedia/opieplayer/mediaplayerplugininterface.h b/core/multimedia/opieplayer/mediaplayerplugininterface.h
index 24d5a80..339b2e4 100644
--- a/core/multimedia/opieplayer/mediaplayerplugininterface.h
+++ b/core/multimedia/opieplayer/mediaplayerplugininterface.h
@@ -58,18 +58,13 @@ public:
58 virtual int audioStreams() = 0; 58 virtual int audioStreams() = 0;
59 virtual int audioChannels( int stream ) = 0; 59 virtual int audioChannels( int stream ) = 0;
60 virtual int audioFrequency( int stream ) = 0; 60 virtual int audioFrequency( int stream ) = 0;
61 virtual int audioSamples( int stream ) = 0; 61 virtual int audioSamples( int stream ) = 0;
62 virtual bool audioSetSample( long sample, int stream ) = 0; 62 virtual bool audioSetSample( long sample, int stream ) = 0;
63 virtual long audioGetSample( int stream ) = 0; 63 virtual long audioGetSample( int stream ) = 0;
64// virtual bool audioReadMonoSamples( short *samples, long samples, long& samplesRead, int stream ) = 0;
65// virtual bool audioReadStereoSamples( short *samples, long samples, long& samplesRead, int stream ) = 0;
66 virtual bool audioReadSamples( short *samples, int channels, long samples, long& samplesRead, int stream ) = 0; 64 virtual bool audioReadSamples( short *samples, int channels, long samples, long& samplesRead, int stream ) = 0;
67 // Libmpeg3 functions, perhaps good for reading an audio file with 5 channels or something!
68// virtual bool audioReadSamples( short *samples, int channel, long samples, int stream ) = 0;
69// virtual bool audioReReadSamples( short *samples, int channel, long samples, int stream ) = 0;
70 65
71 // If decoder doesn't support video then return 0 here 66 // If decoder doesn't support video then return 0 here
72 virtual int videoStreams() = 0; 67 virtual int videoStreams() = 0;
73 virtual int videoWidth( int stream ) = 0; 68 virtual int videoWidth( int stream ) = 0;
74 virtual int videoHeight( int stream ) = 0; 69 virtual int videoHeight( int stream ) = 0;
75 virtual double videoFrameRate( int stream ) = 0; // frames per second (this may change to frames/1000secs) 70 virtual double videoFrameRate( int stream ) = 0; // frames per second (this may change to frames/1000secs)
@@ -93,12 +88,15 @@ public:
93 virtual bool supportsYUV() = 0; 88 virtual bool supportsYUV() = 0;
94 virtual bool supportsMMX() = 0; 89 virtual bool supportsMMX() = 0;
95 virtual bool supportsSMP() = 0; 90 virtual bool supportsSMP() = 0;
96 virtual bool supportsStereo() = 0; 91 virtual bool supportsStereo() = 0;
97 virtual bool supportsScaling() = 0; 92 virtual bool supportsScaling() = 0;
98 93
94 // File Properies
95 virtual long getPlayTime() { return -1; }
96 virtual int audioBitsPerSample( int stream ) = 0;
99}; 97};
100 98
101 99
102class MediaPlayerEncoder; 100class MediaPlayerEncoder;
103 101
104 102
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp
index 9b9d133..2a6bca3 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.cpp
+++ b/core/multimedia/opieplayer/mediaplayerstate.cpp
@@ -23,12 +23,14 @@
23#include <qvaluelist.h> 23#include <qvaluelist.h>
24#include <qobject.h> 24#include <qobject.h>
25#include <qdir.h> 25#include <qdir.h>
26#include "mediaplayerplugininterface.h" 26#include "mediaplayerplugininterface.h"
27#include "mediaplayerstate.h" 27#include "mediaplayerstate.h"
28 28
29
30
29#ifdef QT_NO_COMPONENT 31#ifdef QT_NO_COMPONENT
30// Plugins which are compiled in when no plugin architecture available 32// Plugins which are compiled in when no plugin architecture available
31#include "libmad/libmadpluginimpl.h" 33#include "libmad/libmadpluginimpl.h"
32#include "libmpeg3/libmpeg3pluginimpl.h" 34#include "libmpeg3/libmpeg3pluginimpl.h"
33#include "wavplugin/wavpluginimpl.h" 35#include "wavplugin/wavpluginimpl.h"
34#endif 36#endif
@@ -111,12 +113,16 @@ MediaPlayerDecoder *MediaPlayerState::curDecoder() {
111 113
112// ### hack to get true sample count 114// ### hack to get true sample count
113MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { 115MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() {
114 return libmpeg3decoder; 116 return libmpeg3decoder;
115} 117}
116 118
119// ### hack to get true sample count
120// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() {
121// return libwavdecoder;
122// }
117 123
118void MediaPlayerState::loadPlugins() { 124void MediaPlayerState::loadPlugins() {
119 125
120#ifndef QT_NO_COMPONENT 126#ifndef QT_NO_COMPONENT
121 QValueList<MediaPlayerPlugin>::Iterator mit; 127 QValueList<MediaPlayerPlugin>::Iterator mit;
122 for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { 128 for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) {
diff --git a/core/multimedia/opieplayer/mediaplayerstate.h b/core/multimedia/opieplayer/mediaplayerstate.h
index 5d95b92..1a23742 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.h
+++ b/core/multimedia/opieplayer/mediaplayerstate.h
@@ -103,12 +103,13 @@ private:
103 long curPosition; 103 long curPosition;
104 long curLength; 104 long curLength;
105 char curView; 105 char curView;
106 106
107 MediaPlayerDecoder *decoder; 107 MediaPlayerDecoder *decoder;
108 MediaPlayerDecoder *libmpeg3decoder; 108 MediaPlayerDecoder *libmpeg3decoder;
109// MediaPlayerDecoder *libwavdecoder;
109 110
110 void loadPlugins(); 111 void loadPlugins();
111 void readConfig( Config& cfg ); 112 void readConfig( Config& cfg );
112 void writeConfig( Config& cfg ) const; 113 void writeConfig( Config& cfg ) const;
113}; 114};
114 115
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp
index fbfb946..f17ab6f 100644
--- a/core/multimedia/opieplayer/playlistselection.cpp
+++ b/core/multimedia/opieplayer/playlistselection.cpp
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 969fc4b..4e1543e 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -17,12 +17,14 @@
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include <qpe/qpemenubar.h> 20#include <qpe/qpemenubar.h>
21#include <qpe/qpetoolbar.h> 21#include <qpe/qpetoolbar.h>
22#include <qpe/fileselector.h> 22#include <qpe/fileselector.h>
23#include <qpe/qpeapplication.h>
24
23#include <qpe/applnk.h> 25#include <qpe/applnk.h>
24#include <qpe/config.h> 26#include <qpe/config.h>
25#include <qpe/global.h> 27#include <qpe/global.h>
26#include <qpe/resource.h> 28#include <qpe/resource.h>
27#include <qaction.h> 29#include <qaction.h>
28#include <qimage.h> 30#include <qimage.h>
@@ -31,31 +33,35 @@
31#include <qlabel.h> 33#include <qlabel.h>
32#include <qlist.h> 34#include <qlist.h>
33#include <qlistbox.h> 35#include <qlistbox.h>
34#include <qmainwindow.h> 36#include <qmainwindow.h>
35#include <qmessagebox.h> 37#include <qmessagebox.h>
36#include <qtoolbutton.h> 38#include <qtoolbutton.h>
39#include <qtabwidget.h>
40#include <qlistview.h>
41#include <qpoint.h>
42#include <qtimer.h>
37 43
38#include "playlistselection.h" 44#include "playlistselection.h"
39#include "playlistwidget.h" 45#include "playlistwidget.h"
40#include "mediaplayerstate.h" 46#include "mediaplayerstate.h"
41 47
42#include <stdlib.h> 48#include <stdlib.h>
43 49
50#define BUTTONS_ON_TOOLBAR
51#define SIDE_BUTTONS
52#define CAN_SAVE_LOAD_PLAYLISTS
44 53
45extern MediaPlayerState *mediaPlayerState; 54extern MediaPlayerState *mediaPlayerState;
46 55
56// class myFileSelector {
47 57
58// };
48class PlayListWidgetPrivate { 59class PlayListWidgetPrivate {
49public: 60public:
50 QToolButton *tbPlay; 61 QToolButton *tbPlay, *tbFull, *tbLoop, *tbScale, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove;
51 QToolButton *tbFull;
52 QToolButton *tbLoop;
53 QToolButton *tbScale;
54 QToolButton *tbShuffle;
55
56 QFrame *playListFrame; 62 QFrame *playListFrame;
57 FileSelector *files; 63 FileSelector *files;
58 PlayListSelection *selectedFiles; 64 PlayListSelection *selectedFiles;
59 bool setDocumentUsed; 65 bool setDocumentUsed;
60 DocLnk *current; 66 DocLnk *current;
61}; 67};
@@ -89,16 +95,18 @@ public:
89PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) 95PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
90 : QMainWindow( parent, name, fl ) { 96 : QMainWindow( parent, name, fl ) {
91 97
92 d = new PlayListWidgetPrivate; 98 d = new PlayListWidgetPrivate;
93 d->setDocumentUsed = FALSE; 99 d->setDocumentUsed = FALSE;
94 d->current = NULL; 100 d->current = NULL;
101 menuTimer = new QTimer( this ,"menu timer"),
102 connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) );
95 103
96 setBackgroundMode( PaletteButton ); 104 setBackgroundMode( PaletteButton );
97 105
98 setCaption( tr("MediaPlayer") ); 106 setCaption( tr("OpiePlayer") );
99 setIcon( Resource::loadPixmap( "MPEGPlayer" ) ); 107 setIcon( Resource::loadPixmap( "MPEGPlayer" ) );
100 108
101 setToolBarsMovable( FALSE ); 109 setToolBarsMovable( FALSE );
102 110
103 // Create Toolbar 111 // Create Toolbar
104 QPEToolBar *toolbar = new QPEToolBar( this ); 112 QPEToolBar *toolbar = new QPEToolBar( this );
@@ -107,83 +115,167 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
107 // Create Menubar 115 // Create Menubar
108 QPEMenuBar *menu = new QPEMenuBar( toolbar ); 116 QPEMenuBar *menu = new QPEMenuBar( toolbar );
109 menu->setMargin( 0 ); 117 menu->setMargin( 0 );
110 118
111 QPEToolBar *bar = new QPEToolBar( this ); 119 QPEToolBar *bar = new QPEToolBar( this );
112 bar->setLabel( tr( "Play Operations" ) ); 120 bar->setLabel( tr( "Play Operations" ) );
113#ifdef BUTTONS_ON_TOOLBAR 121 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "mpegplayer/add_to_playlist",
114 d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play", mediaPlayerState, SLOT(setPlaying(bool)), TRUE ); 122 this , SLOT(addSelected()) );
115 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ), "mpegplayer/shuffle", mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); 123 d->tbRemoveFromList = new ToolButton( bar, tr( "Remove from Playlist" ), "mpegplayer/remove_from_playlist",
116#endif 124 this , SLOT(removeSelected()) );
117 d->tbLoop = new ToolButton( bar, tr( "Loop" ), "mpegplayer/loop", mediaPlayerState, SLOT(setLooping(bool)), TRUE ); 125 d->tbPlay = new ToolButton( bar, tr( "Play" ), "mpegplayer/play",
118 d->tbFull = new ToolButton( bar, tr( "Fullscreen" ), "fullscreen", mediaPlayerState, SLOT(setFullscreen(bool)), TRUE ); 126 mediaPlayerState, SLOT(setPlaying(bool)), TRUE );
119 d->tbScale = new ToolButton( bar, tr( "Scale" ), "mpegplayer/scale", mediaPlayerState, SLOT(setScaled(bool)), TRUE ); 127
128 d->tbShuffle = new ToolButton( bar, tr( "Randomize" ), "mpegplayer/shuffle",
129 mediaPlayerState, SLOT(setShuffled(bool)), TRUE );
130 d->tbLoop = new ToolButton( bar, tr( "Loop" ), "mpegplayer/loop",
131 mediaPlayerState, SLOT(setLooping(bool)), TRUE );
132
133// d->tbFull = new ToolButton( bar, tr( "Fullscreen" ), "fullscreen", mediaPlayerState, SLOT(setFullscreen(bool)), TRUE );
134// d->tbScale = new ToolButton( bar, tr( "Scale" ), "mpegplayer/scale", mediaPlayerState, SLOT(setScaled(bool)), TRUE );
120 135
121 QPopupMenu *pmPlayList = new QPopupMenu( this ); 136 QPopupMenu *pmPlayList = new QPopupMenu( this );
122 menu->insertItem( tr( "PlayList" ), pmPlayList ); 137 menu->insertItem( tr( "File" ), pmPlayList );
123 new MenuItem( pmPlayList, tr( "Toggle PlayList" ), mediaPlayerState, SLOT( togglePlaylist() ) );
124 new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) ); 138 new MenuItem( pmPlayList, tr( "Clear List" ), this, SLOT( clearList() ) );
125 new MenuItem( pmPlayList, tr( "Add all music files" ), this, SLOT( addAllMusicToList() ) ); 139 new MenuItem( pmPlayList, tr( "Add all audio files" ), this, SLOT( addAllMusicToList() ) );
126 new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) ); 140 new MenuItem( pmPlayList, tr( "Add all video files" ), this, SLOT( addAllVideoToList() ) );
127 new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) ); 141 new MenuItem( pmPlayList, tr( "Add all files" ), this, SLOT( addAllToList() ) );
128#ifdef CAN_SAVE_LOAD_PLAYLISTS
129 new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) ); 142 new MenuItem( pmPlayList, tr( "Save PlayList" ), this, SLOT( saveList() ) );
130 new MenuItem( pmPlayList, tr( "Load PlayList" ), this, SLOT( loadList() ) ); 143 new MenuItem( pmPlayList, tr( "Load PlayList" ), this, SLOT( loadList() ) );
131#endif 144
145 QPopupMenu *pmView = new QPopupMenu( this );
146 menu->insertItem( tr( "View" ), pmView );
147
148 fullScreenButton = new QAction(tr("Full Screen"), Resource::loadPixmap("fullscreen"), QString::null, 0, this, 0);
149 connect( fullScreenButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleFullscreen()) );
150 fullScreenButton->addTo(pmView);
151 scaleButton = new QAction(tr("Scale"), Resource::loadPixmap("mpegplayer/scale"), QString::null, 0, this, 0);
152 connect( scaleButton, SIGNAL(activated()), mediaPlayerState, SLOT(toggleScaled()) );
153 scaleButton->addTo(pmView);
132 154
133 QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton ); 155 QVBox *vbox5 = new QVBox( this ); vbox5->setBackgroundMode( PaletteButton );
156 QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton );
157// vbox4->setMargin(4);
158// libString = new QLabel( tr(" Media Library"), vbox4 );
159// libString->setBackgroundMode( QButton::PaletteButton );
160// libString->setFont( QFont( "Helvetica", 8, QFont::Bold ) );
161
162 QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton );
163
164 tabWidget = new QTabWidget( hbox6, "tabWidget" );
165 tabWidget->setTabShape(QTabWidget::Triangular);
166
167
168 QWidget *pTab;
169 pTab = new QWidget( tabWidget, "pTab" );
170 playlistView = new QListView( pTab, "Videoview" );
171 playlistView->setMinimumSize(236,260);
172 tabWidget->insertTab( pTab,"Playlist");
134 173
135 // Add the playlist area 174 // Add the playlist area
136 QVBox *vbox3 = new QVBox( vbox5 ); vbox3->setBackgroundMode( PaletteButton );
137 d->playListFrame = vbox3;
138 175
139 QLabel *plString = new QLabel( tr(" PlayList"), vbox3 ); 176 QVBox *vbox3 = new QVBox( pTab ); vbox3->setBackgroundMode( PaletteButton );
140 plString->setBackgroundMode( QButton::PaletteButton ); 177 d->playListFrame = vbox3;
141 plString->setFont( QFont( "Helvetica", 8, QFont::Bold ) ); 178 d->playListFrame ->setMinimumSize(235,260);
142 179
143 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton ); 180 QHBox *hbox2 = new QHBox( vbox3 ); hbox2->setBackgroundMode( PaletteButton );
144 d->selectedFiles = new PlayListSelection( hbox2 ); 181 d->selectedFiles = new PlayListSelection( hbox2 );
145 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton ); 182 QVBox *vbox1 = new QVBox( hbox2 ); vbox1->setBackgroundMode( PaletteButton );
146 183
147#ifndef BUTTONS_ON_TOOLBAR
148 d->tbPlay = new ToolButton( vbox1, tr( "Play" ), "mpegplayer/play", mediaPlayerState, SLOT(setPlaying(bool)), TRUE );
149 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch 184 QVBox *stretch1 = new QVBox( vbox1 ); stretch1->setBackgroundMode( PaletteButton ); // add stretch
150#endif
151 new ToolButton( vbox1, tr( "Move Up" ), "mpegplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) ); 185 new ToolButton( vbox1, tr( "Move Up" ), "mpegplayer/up", d->selectedFiles, SLOT(moveSelectedUp()) );
152 new ToolButton( vbox1, tr( "Remove" ), "mpegplayer/cut", d->selectedFiles, SLOT(removeSelected()) ); 186 new ToolButton( vbox1, tr( "Remove" ), "mpegplayer/cut", d->selectedFiles, SLOT(removeSelected()) );
153 new ToolButton( vbox1, tr( "Move Down" ), "mpegplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) ); 187 new ToolButton( vbox1, tr( "Move Down" ), "mpegplayer/down", d->selectedFiles, SLOT(moveSelectedDown()) );
154 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch 188 QVBox *stretch2 = new QVBox( vbox1 ); stretch2->setBackgroundMode( PaletteButton ); // add stretch
155#ifndef BUTTONS_ON_TOOLBAR 189
156 d->tbShuffle = new ToolButton( vbox1, tr( "Randomize" ), "mpegplayer/shuffle", mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); 190 QWidget *aTab;
157#endif 191 aTab = new QWidget( tabWidget, "aTab" );
192 audioView = new QListView( aTab, "Audioview" );
193 audioView->setMinimumSize(233,260);
194 audioView->addColumn( "Title",150);
195 audioView->addColumn("Size", 45);
196 audioView->addColumn("Media",35);
197 audioView->setColumnAlignment(1, Qt::AlignRight);
198 audioView->setColumnAlignment(2, Qt::AlignRight);
199 tabWidget->insertTab(aTab,"Audio");
200// audioView
201 Global::findDocuments(&files, "audio/*");
202 QListIterator<DocLnk> dit( files.children() );
203 QString storage;
204 for ( ; dit.current(); ++dit ) {
205 QListViewItem * newItem;
206 if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF";
207 else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD";
208 else storage="RAM";
209
210 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage);
211 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" ));
212 }
213// videowidget
214
215 QWidget *vTab;
216 vTab = new QWidget( tabWidget, "vTab" );
217 videoView = new QListView( vTab, "Videoview" );
218 videoView->setMinimumSize(233,260);
219
220 videoView->addColumn("Title",150);
221 videoView->addColumn("Size",45);
222 videoView->addColumn("Media",35);
223 videoView->setColumnAlignment(1, Qt::AlignRight);
224 videoView->setColumnAlignment(2, Qt::AlignRight);
225
226 tabWidget->insertTab( vTab,"Video");
227
228 Global::findDocuments(&vFiles, "video/*");
229 QListIterator<DocLnk> Vdit( vFiles.children() );
230 for ( ; Vdit.current(); ++Vdit ) {
231 if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF";
232 else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD";
233 else storage="RAM";
234 QListViewItem * newItem;
235 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage);
236 newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" ));
237 }
238
239
240// d->tbPlay = new ToolButton( vbox1, tr( "Play" ), "mpegplayer/play", mediaPlayerState, SLOT(setPlaying(bool)), TRUE );
241// d->tbShuffle = new ToolButton( vbox1, tr( "Randomize" ), "mpegplayer/shuffle", mediaPlayerState, SLOT(setShuffled(bool)), TRUE );
158 242
159 // add the library area 243 // add the library area
160 QVBox *vbox4 = new QVBox( vbox5 ); vbox4->setBackgroundMode( PaletteButton );
161 244
162 QLabel *libString = new QLabel( tr(" Media Library"), vbox4 ); 245// d->files->setBackgroundMode( PaletteButton );
163 libString->setBackgroundMode( QButton::PaletteButton ); 246// QVBox *vbox7 = new QVBox( hbox6 ); vbox7->setBackgroundMode( PaletteButton );
164 libString->setFont( QFont( "Helvetica", 8, QFont::Bold ) );
165 247
166 QHBox *hbox6 = new QHBox( vbox4 ); hbox6->setBackgroundMode( PaletteButton ); 248// #ifdef SIDE_BUTTONS
167 d->files = new FileSelector( "video/*;audio/*", hbox6, "Find Media Files", FALSE, FALSE ); 249// QVBox *stretch3 = new QVBox( vbox1 ); stretch3->setBackgroundMode( PaletteButton ); // add stretch
168 d->files->setBackgroundMode( PaletteButton ); 250// #endif
169 QVBox *vbox7 = new QVBox( hbox6 ); vbox7->setBackgroundMode( PaletteButton ); 251 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
252
253// connect( audioView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) );
254// connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) );
170 255
171#ifdef SIDE_BUTTONS 256 connect( audioView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) );
172 new ToolButton( vbox7, tr( "Add to Playlist" ), "mpegplayer/add_to_playlist", d->selectedFiles, SLOT(addSelected()) ); 257 connect( videoView, SIGNAL( clicked( QListViewItem *) ), this, SLOT( addToSelection( QListViewItem *) ) );
173 new ToolButton( vbox7, tr( "Remove from Playlist" ), "mpegplayer/remove_from_playlist", d->selectedFiles, SLOT(removeSelected()) );
174 QVBox *stretch3 = new QVBox( vbox1 ); stretch3->setBackgroundMode( PaletteButton ); // add stretch
175#endif
176 258
177 connect( d->files, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) ); 259 connect( audioView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint&, int ) ),
260 this, SLOT( addToSelection( QListViewItem *, const QPoint&, int )) );
261 connect( videoView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint&, int ) ),
262 this, SLOT( addToSelection( QListViewItem *, const QPoint&, int )) );
263
264 connect( playlistView, SIGNAL( pressed( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) );
265 connect( tabWidget, SIGNAL (currentChanged(QWidget*)),this,SLOT(tabChanged(QWidget*)));
266 // connect( d->files, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) );
267 // connect( d->files, SIGNAL( fileSelected( const DocLnk & ) ), this, SLOT( addToSelection( const DocLnk & ) ) );
178 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) ); 268 connect( mediaPlayerState, SIGNAL( playingToggled( bool ) ), d->tbPlay, SLOT( setOn( bool ) ) );
179 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) ); 269 connect( mediaPlayerState, SIGNAL( loopingToggled( bool ) ), d->tbLoop, SLOT( setOn( bool ) ) );
180 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); 270 connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) );
181 connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), d->tbFull, SLOT( setOn( bool ) ) ); 271
182 connect( mediaPlayerState, SIGNAL( scaledToggled( bool ) ), d->tbScale, SLOT( setOn( bool ) ) ); 272// connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), fullScreenButton, SLOT( setOn( bool ) ) );
183 connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), d->tbScale, SLOT( setEnabled( bool ) ) ); 273// connect( mediaPlayerState, SIGNAL( scaledToggled( bool ) ), scaleButton, SLOT( setEnabled( bool ) ) );
274// connect( mediaPlayerState, SIGNAL( fullscreenToggled( bool ) ), fullScreenButton, SLOT( setEnabled( bool ) ) );
275
184 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); 276 connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) );
185 277
186 setCentralWidget( vbox5 ); 278 setCentralWidget( vbox5 );
187 279
188 Config cfg( "MediaPlayer" ); 280 Config cfg( "MediaPlayer" );
189 readConfig( cfg ); 281 readConfig( cfg );
@@ -200,19 +292,20 @@ PlayListWidget::~PlayListWidget() {
200 delete d->current; 292 delete d->current;
201 delete d; 293 delete d;
202} 294}
203 295
204 296
205void PlayListWidget::initializeStates() { 297void PlayListWidget::initializeStates() {
298
206 d->tbPlay->setOn( mediaPlayerState->playing() ); 299 d->tbPlay->setOn( mediaPlayerState->playing() );
207 d->tbLoop->setOn( mediaPlayerState->looping() ); 300 d->tbLoop->setOn( mediaPlayerState->looping() );
208 d->tbShuffle->setOn( mediaPlayerState->shuffled() ); 301 d->tbShuffle->setOn( mediaPlayerState->shuffled() );
209 d->tbFull->setOn( mediaPlayerState->fullscreen() ); 302// d->tbFull->setOn( mediaPlayerState->fullscreen() );
210 d->tbScale->setOn( mediaPlayerState->scaled() ); 303// d->tbScale->setOn( mediaPlayerState->scaled() );
211 d->tbScale->setEnabled( mediaPlayerState->fullscreen() ); 304// d->tbScale->setEnabled( mediaPlayerState->fullscreen() );
212 setPlaylist( mediaPlayerState->playlist() ); 305// setPlaylist( mediaPlayerState->playlist() );
213} 306}
214 307
215 308
216void PlayListWidget::readConfig( Config& cfg ) { 309void PlayListWidget::readConfig( Config& cfg ) {
217 cfg.setGroup("PlayList"); 310 cfg.setGroup("PlayList");
218 311
@@ -271,12 +364,22 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) {
271 d->selectedFiles->addToSelection( lnk ); 364 d->selectedFiles->addToSelection( lnk );
272 else 365 else
273 mediaPlayerState->setPlaying( TRUE ); 366 mediaPlayerState->setPlaying( TRUE );
274} 367}
275 368
276 369
370void PlayListWidget::addToSelection( QListViewItem *it ,const QPoint & p, int index) {
371 qDebug("add");
372// d->selectedFiles->addToSelection( lnk );
373 // }
374// else
375// mediaPlayerState->setPlaying( TRUE );
376//
377}
378
379
277void PlayListWidget::clearList() { 380void PlayListWidget::clearList() {
278 while ( first() ) 381 while ( first() )
279 d->selectedFiles->removeSelected(); 382 d->selectedFiles->removeSelected();
280} 383}
281 384
282 385
@@ -443,6 +546,148 @@ void PlayListWidget::setView( char view ) {
443 if ( view == 'l' ) 546 if ( view == 'l' )
444 showMaximized(); 547 showMaximized();
445 else 548 else
446 hide(); 549 hide();
447} 550}
448 551
552void PlayListWidget::addSelected() {
553// QMessageBox::message("Note","Bozo the clown thinks\nthere's something actually here");
554 int tabPage=tabWidget->currentPageIndex();
555 switch (tabPage) {
556 case 0: //playlist
557 break;
558 case 1: { //audio
559 addToSelection( audioView->selectedItem() );
560 }
561 break;
562 case 2: { // video
563 addToSelection( videoView->selectedItem() );
564 }
565 break;
566 };
567}
568
569void PlayListWidget::removeSelected() {
570 d->selectedFiles->removeSelected( );
571}
572
573
574void PlayListWidget::playIt( QListViewItem *it) {
575 d->setDocumentUsed = FALSE;
576
577 if(it) {
578 qDebug("playit");
579 int tabPage=tabWidget->currentPageIndex();
580 switch (tabPage) {
581 case 1: {
582 DocLnkSet files;
583 QListIterator<DocLnk> dit( files.children() );
584 for ( ; dit.current(); ++dit ) {
585 if( dit.current()->name() == it->text(0)) {
586 setDocument( dit.current()->name());
587 }
588 }
589 }
590 break;
591 case 2: {
592 DocLnkSet vFiles;
593 QListIterator<DocLnk> dit( vFiles.children() );
594 for ( ; dit.current(); ++dit ) {
595 qDebug(dit.current()->name());
596 if( dit.current()->name() == it->text(0)) {
597 qDebug(it->text(0));
598 setDocument( dit.current()->name());
599 }
600 }
601 }
602 break;
603 };
604 }
605}
606
607void PlayListWidget::addToSelection( QListViewItem *it) {
608 d->setDocumentUsed = FALSE;
609
610 if(it) {
611 qDebug("add to selection");
612 int tabPage=tabWidget->currentPageIndex();
613 switch (tabPage) {
614 case 1: {
615 QListIterator<DocLnk> dit( files.children() );
616 for ( ; dit.current(); ++dit ) {
617 if( dit.current()->name() == it->text(0)) {
618 d->selectedFiles->addToSelection( **dit );
619 }
620 }
621 }
622 break;
623 case 2: {
624 QListIterator<DocLnk> dit( vFiles.children() );
625 for ( ; dit.current(); ++dit ) {
626 qDebug(dit.current()->name());
627 if( dit.current()->name() == it->text(0)) {
628 d->selectedFiles->addToSelection( **dit );
629 }
630 }
631 }
632 break;
633 case 0:
634 break;
635 };
636 tabWidget->setCurrentPage(0);
637// mediaPlayerState->setPlaying( TRUE );
638 }
639}
640
641void PlayListWidget::tabChanged(QWidget *widg) {
642
643 int tabPage=tabWidget->currentPageIndex();
644 switch (tabPage) {
645 case 0:
646 {
647 d->tbRemoveFromList->setEnabled(TRUE);
648 d->tbAddToList->setEnabled(FALSE);
649 }
650 break;
651 case 1:
652 {
653 d->tbRemoveFromList->setEnabled(FALSE);
654 d->tbAddToList->setEnabled(TRUE);
655 }
656 break;
657 case 2:
658 {
659 d->tbRemoveFromList->setEnabled(FALSE);
660 d->tbAddToList->setEnabled(TRUE);
661 }
662 break;
663 };
664}
665
666void PlayListWidget::cancelMenuTimer() {
667 if( menuTimer->isActive() )
668 menuTimer->stop();
669}
670
671void PlayListWidget::showFileMenu() {
672
673}
674
675void PlayListWidget::contentsMousePressEvent( QMouseEvent * e )
676{
677// QListView::contentsMousePressEvent( e );
678 menuTimer->start( 750, TRUE );
679}
680
681
682void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e )
683{
684// QListView::contentsMouseReleaseEvent( e );
685 menuTimer->stop();
686}
687// void PlayListWidget::setFullScreen() {
688// mediaPlayerState->toggleFullscreen( );
689// }
690
691// void PlayListWidget::setScaled() {
692// mediaPlayerState->toggleScaled();
693// }
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h
index 6976641..3a52dd5 100644
--- a/core/multimedia/opieplayer/playlistwidget.h
+++ b/core/multimedia/opieplayer/playlistwidget.h
@@ -20,49 +20,78 @@
20#ifndef PLAY_LIST_WIDGET_H 20#ifndef PLAY_LIST_WIDGET_H
21#define PLAY_LIST_WIDGET_H 21#define PLAY_LIST_WIDGET_H
22 22
23 23
24#include <qmainwindow.h> 24#include <qmainwindow.h>
25#include <qpe/applnk.h> 25#include <qpe/applnk.h>
26#include <qtabwidget.h>
27#include <qtimer.h>
26 28
27 29
28class PlayListWidgetPrivate; 30class PlayListWidgetPrivate;
29class Config; 31class Config;
30 32class QListViewItem;
33class QListView;
34class QPoint;
35class QAction;
36class QLabel;
31 37
32class PlayListWidget : public QMainWindow { 38class PlayListWidget : public QMainWindow {
33 Q_OBJECT 39 Q_OBJECT
34public: 40public:
35 PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 ); 41 PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 );
36 ~PlayListWidget(); 42 ~PlayListWidget();
37 43 QTabWidget * tabWidget;
44 QAction *fullScreenButton, *scaleButton;
45 DocLnkSet files;
46 DocLnkSet vFiles;
47 QListView *audioView, *videoView, *playlistView;
48 QLabel *libString;
38 // retrieve the current playlist entry (media file link) 49 // retrieve the current playlist entry (media file link)
39 const DocLnk *current(); 50 const DocLnk *current();
40 void useSelectedDocument(); 51 void useSelectedDocument();
52 QTimer * menuTimer;
41 53
42public slots: 54public slots:
43 void setDocument( const QString& fileref ); 55 void setDocument( const QString& fileref );
44 void addToSelection( const DocLnk& ); // Add a media file to the playlist 56 void addToSelection( const DocLnk& ); // Add a media file to the playlist
57 void addToSelection( QListViewItem* ); // Add a media file to the playlist
58 void addToSelection( QListViewItem*, const QPoint&,int ); // Add a media file to the playlist
45 void setActiveWindow(); // need to handle this to show the right view 59 void setActiveWindow(); // need to handle this to show the right view
46 void setPlaylist( bool ); // Show/Hide the playlist 60 void setPlaylist( bool ); // Show/Hide the playlist
47 void setView( char ); 61 void setView( char );
48 void clearList(); 62 void clearList();
49 void addAllToList(); 63 void addAllToList();
50 void addAllMusicToList(); 64 void addAllMusicToList();
51 void addAllVideoToList(); 65 void addAllVideoToList();
52 void saveList(); // Save the playlist 66 void saveList(); // Save the playlist
53 void loadList(); // Load a playlist 67 void loadList(); // Load a playlist
68 void playIt( QListViewItem *);
54 bool first(); 69 bool first();
55 bool last(); 70 bool last();
56 bool next(); 71 bool next();
57 bool prev(); 72 bool prev();
73 void addSelected();
74 void removeSelected();
75 void tabChanged(QWidget*);
76/* void setFullScreen(); */
77/* void setScaled(); */
78protected:
79 void contentsMousePressEvent( QMouseEvent * e );
80 void contentsMouseReleaseEvent( QMouseEvent * e );
58 81
59private: 82private:
60 void initializeStates(); 83 void initializeStates();
61 void readConfig( Config& cfg ); 84 void readConfig( Config& cfg );
62 void writeConfig( Config& cfg ) const; 85 void writeConfig( Config& cfg ) const;
63 PlayListWidgetPrivate *d; // Private implementation data 86 PlayListWidgetPrivate *d; // Private implementation data
87
88protected slots:
89 void cancelMenuTimer();
90 void showFileMenu();
91
92
64}; 93};
65 94
66 95
67#endif // PLAY_LIST_WIDGET_H 96#endif // PLAY_LIST_WIDGET_H
68 97
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp
index f3974a0..1f128a4 100644
--- a/core/multimedia/opieplayer/videowidget.cpp
+++ b/core/multimedia/opieplayer/videowidget.cpp
@@ -15,19 +15,19 @@
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#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include "mediaplayerplugininterface.h"
21#include <qwidget.h> 22#include <qwidget.h>
22#include <qpainter.h> 23#include <qpainter.h>
23#include <qpixmap.h> 24#include <qpixmap.h>
24#include <qslider.h> 25#include <qslider.h>
25#include <qdrawutil.h> 26#include <qdrawutil.h>
26#include "videowidget.h" 27#include "videowidget.h"
27#include "mediaplayerplugininterface.h"
28#include "mediaplayerstate.h" 28#include "mediaplayerstate.h"
29 29
30 30
31#ifdef Q_WS_QWS 31#ifdef Q_WS_QWS
32# define USE_DIRECT_PAINTER 32# define USE_DIRECT_PAINTER
33# include <qdirectpainter_qws.h> 33# include <qdirectpainter_qws.h>
@@ -63,13 +63,13 @@ MediaButton videoButtons[] = {
63 63
64static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton)); 64static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton));
65 65
66 66
67VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : 67VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
68 QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) { 68 QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 ) {
69 setCaption( tr("MediaPlayer") ); 69 setCaption( tr("OpiePlayer") );
70 setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/metalFinish" ) ); 70 setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/metalFinish" ) );
71 pixmaps[0] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaButton0a" ) ); 71 pixmaps[0] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaButton0a" ) );
72 pixmaps[1] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaButton0b" ) ); 72 pixmaps[1] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaButton0b" ) );
73 pixmaps[2] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaControls0" ) ); 73 pixmaps[2] = new QPixmap( Resource::loadPixmap( "mpegplayer/mediaControls0" ) );
74 currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 ); 74 currentFrame = new QImage( 220 + 2, 160, (QPixmap::defaultDepth() == 16) ? 16 : 32 );
75 75
diff --git a/core/multimedia/opieplayer/wavplugin/Makefile.in b/core/multimedia/opieplayer/wavplugin/Makefile.in
index bcbe7f2..a46b925 100644
--- a/core/multimedia/opieplayer/wavplugin/Makefile.in
+++ b/core/multimedia/opieplayer/wavplugin/Makefile.in
@@ -97,13 +97,15 @@ REQUIRES=
97 97
98 98
99 99
100####### Compile 100####### Compile
101 101
102wavplugin.o: wavplugin.cpp \ 102wavplugin.o: wavplugin.cpp \
103 wavplugin.h 103 wavplugin.h \
104 ../mediaplayerplugininterface.h
104 105
105wavpluginimpl.o: wavpluginimpl.cpp \ 106wavpluginimpl.o: wavpluginimpl.cpp \
106 wavplugin.h \ 107 wavplugin.h \
108 ../mediaplayerplugininterface.h \
107 wavpluginimpl.h 109 wavpluginimpl.h
108 110
109 111
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
index a6bd974..7f63b3b 100644
--- a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
+++ b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
@@ -14,12 +14,14 @@
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// L.J.Potter added changes Fri 02-15-2002
21
20#include <stdio.h> 22#include <stdio.h>
21#include <stdarg.h> 23#include <stdarg.h>
22#include <stdlib.h> 24#include <stdlib.h>
23#include <errno.h> 25#include <errno.h>
24#include <unistd.h> 26#include <unistd.h>
25#include <qfile.h> 27#include <qfile.h>
@@ -44,13 +46,13 @@ struct ChunkData {
44 Q_INT32 avgBytesPerSec; 46 Q_INT32 avgBytesPerSec;
45 Q_INT16 blockAlign; 47 Q_INT16 blockAlign;
46 Q_INT16 wBitsPerSample; 48 Q_INT16 wBitsPerSample;
47}; 49};
48 50
49 51
50const int sound_buffer_size = 4096; 52const int sound_buffer_size = 512; // 4096; // you got to be kidding right?
51 53
52 54
53class WavPluginData { 55class WavPluginData {
54public: 56public:
55 QFile *input; 57 QFile *input;
56 58
@@ -70,35 +72,35 @@ public:
70 } 72 }
71 73
72 // expands out samples to the frequency of 44kHz 74 // expands out samples to the frequency of 44kHz
73 bool add( short *output, long count, long& done, bool stereo ) 75 bool add( short *output, long count, long& done, bool stereo )
74 { 76 {
75 done = 0; 77 done = 0;
78 qApp->processEvents();
76 79
77 if ( input == 0 ) { 80 if ( input == 0 ) {
78 qDebug("no input"); 81 qDebug("no input");
79 return FALSE; 82 return FALSE;
80 } 83 }
81 84
82 while ( count ) { 85 while ( count ) {
83 int l,r; 86 int l,r;
84 if ( getSample(l, r) == FALSE ) { 87 if ( getSample(l, r) == FALSE ) {
85 qDebug("didn't get sample"); 88 qDebug("didn't get sample");
86 return FALSE; 89 return FALSE;
87 } 90 }
88 samples_due += 44100; 91 samples_due += chunkdata.samplesPerSec;
89 while ( count && (samples_due > chunkdata.samplesPerSec) ) { 92 while ( count && (samples_due > chunkdata.samplesPerSec) ) {
90 *output++ = l; 93 *output++ = l;
91 if ( stereo ) 94 if ( stereo )
92 *output++ = r; 95 *output++ = r;
93 samples_due -= chunkdata.samplesPerSec; 96 samples_due -= chunkdata.samplesPerSec;
94 count--; 97 count--;
95 done++; 98 done++;
96 } 99 }
97 } 100 }
98
99 return TRUE; 101 return TRUE;
100 } 102 }
101 103
102 bool initialise() { 104 bool initialise() {
103 if ( input == 0 ) 105 if ( input == 0 )
104 return FALSE; 106 return FALSE;
@@ -140,13 +142,13 @@ public:
140 // ignored chunk 142 // ignored chunk
141 if ( chunk.size > 1000000000 || !input->at(input->at()+chunk.size) ) { 143 if ( chunk.size > 1000000000 || !input->at(input->at()+chunk.size) ) {
142 return FALSE; 144 return FALSE;
143 } 145 }
144 } 146 }
145 } // while 147 } // while
146 148 qDebug("bits %d", chunkdata.wBitsPerSample);
147 return TRUE; 149 return TRUE;
148 } 150 }
149 151
150 152
151 // gets a sample from the file 153 // gets a sample from the file
152 bool getSample(int& l, int& r) 154 bool getSample(int& l, int& r)
@@ -202,13 +204,13 @@ WavPlugin::~WavPlugin() {
202 close(); 204 close();
203 delete d; 205 delete d;
204} 206}
205 207
206 208
207bool WavPlugin::isFileSupported( const QString& path ) { 209bool WavPlugin::isFileSupported( const QString& path ) {
208 debugMsg( "WavPlugin::isFileSupported" ); 210// qDebug( "WavPlugin::isFileSupported" );
209 211
210 char *ext = strrchr( path.latin1(), '.' ); 212 char *ext = strrchr( path.latin1(), '.' );
211 213
212 // Test file extension 214 // Test file extension
213 if ( ext ) { 215 if ( ext ) {
214 if ( strncasecmp(ext, ".raw", 4) == 0 ) 216 if ( strncasecmp(ext, ".raw", 4) == 0 )
@@ -221,13 +223,13 @@ bool WavPlugin::isFileSupported( const QString& path ) {
221 223
222 return FALSE; 224 return FALSE;
223} 225}
224 226
225 227
226bool WavPlugin::open( const QString& path ) { 228bool WavPlugin::open( const QString& path ) {
227 debugMsg( "WavPlugin::open" ); 229// qDebug( "WavPlugin::open" );
228 230
229 d->max = d->out = sound_buffer_size; 231 d->max = d->out = sound_buffer_size;
230 d->wavedata_remaining = 0; 232 d->wavedata_remaining = 0;
231 d->samples_due = 0; 233 d->samples_due = 0;
232 234
233 d->input = new QFile( path ); 235 d->input = new QFile( path );
@@ -242,60 +244,60 @@ bool WavPlugin::open( const QString& path ) {
242 244
243 return TRUE; 245 return TRUE;
244} 246}
245 247
246 248
247bool WavPlugin::close() { 249bool WavPlugin::close() {
248 debugMsg( "WavPlugin::close" ); 250// qDebug( "WavPlugin::close" );
249 251
250 d->input->close(); 252 d->input->close();
251 delete d->input; 253 delete d->input;
252 d->input = 0; 254 d->input = 0;
253 return TRUE; 255 return TRUE;
254} 256}
255 257
256 258
257bool WavPlugin::isOpen() { 259bool WavPlugin::isOpen() {
258 debugMsg( "WavPlugin::isOpen" ); 260// qDebug( "WavPlugin::isOpen" );
259 return ( d->input != 0 ); 261 return ( d->input != 0 );
260} 262}
261 263
262 264
263int WavPlugin::audioStreams() { 265int WavPlugin::audioStreams() {
264 debugMsg( "WavPlugin::audioStreams" ); 266// qDebug( "WavPlugin::audioStreams" );
265 return 1; 267 return 1;
266} 268}
267 269
268 270
269int WavPlugin::audioChannels( int ) { 271int WavPlugin::audioChannels( int ) {
270 debugMsg( "WavPlugin::audioChannels" ); 272// qDebug( "WavPlugin::audioChannels" );
271 return 2; // ### Always scale audio to stereo samples 273 return d->chunkdata.channels;// 2; // ### Always scale audio to stereo samples
272} 274}
273 275
274 276
275int WavPlugin::audioFrequency( int ) { 277int WavPlugin::audioFrequency( int ) {
276 debugMsg( "WavPlugin::audioFrequency" ); 278// qDebug( "WavPlugin::audioFrequency %d", d->chunkdata.samplesPerSec );
277 return 44100; // ### Always scale to frequency of 44100 279 return d->chunkdata.samplesPerSec; //44100; // ### Always scale to frequency of 44100
278} 280}
279 281
280 282
281int WavPlugin::audioSamples( int ) { 283int WavPlugin::audioSamples( int ) {
282 debugMsg( "WavPlugin::audioSamples" ); 284// qDebug( "WavPlugin::audioSamples" );
283 return d->samples * 2 / d->chunkdata.channels; // ### Scaled samples will be made stereo, 285 return d->samples / d->chunkdata.channels/2; // ### Scaled samples will be made stereo,
284 // Therefore if source is mono we will double the number of samples 286 // Therefore if source is mono we will double the number of samples
285} 287}
286 288
287 289
288bool WavPlugin::audioSetSample( long, int ) { 290bool WavPlugin::audioSetSample( long, int ) {
289 debugMsg( "WavPlugin::audioSetSample" ); 291// qDebug( "WavPlugin::audioSetSample" );
290 return FALSE; 292 return FALSE;
291} 293}
292 294
293 295
294long WavPlugin::audioGetSample( int ) { 296long WavPlugin::audioGetSample( int ) {
295 debugMsg( "WavPlugin::audioGetSample" ); 297// qDebug( "WavPlugin::audioGetSample" );
296 return 0; 298 return 0;
297} 299}
298 300
299/* 301/*
300bool WavPlugin::audioReadSamples( short *, int, long, int ) { 302bool WavPlugin::audioReadSamples( short *, int, long, int ) {
301 debugMsg( "WavPlugin::audioReadSamples" ); 303 debugMsg( "WavPlugin::audioReadSamples" );
@@ -319,16 +321,21 @@ bool WavPlugin::audioReadStereoSamples( short *output, long samples, long& sampl
319 debugMsg( "WavPlugin::audioReadStereoSamples" ); 321 debugMsg( "WavPlugin::audioReadStereoSamples" );
320 return !d->add( output, samples, samplesMade, TRUE ); 322 return !d->add( output, samples, samplesMade, TRUE );
321} 323}
322*/ 324*/
323 325
324bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) { 326bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) {
325 debugMsg( "WavPlugin::audioReadSamples" ); 327// qDebug( "WavPlugin::audioReadSamples" );
326 return d->add( output, samples, samplesMade, channels != 1 ); 328 return d->add( output, samples, samplesMade, channels != 1 );
327} 329}
328 330
329double WavPlugin::getTime() { 331double WavPlugin::getTime() {
330 debugMsg( "WavPlugin::getTime" ); 332// qDebug( "WavPlugin::getTime" );
331 return 0.0; 333 return 0.0;
332} 334}
333 335
336int WavPlugin::audioBitsPerSample( int ) {
337// qDebug( "WavPlugin::audioFormat %d", d->chunkdata.wBitsPerSample );
338 return d->chunkdata.wBitsPerSample; //
339}
340
334 341
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.h b/core/multimedia/opieplayer/wavplugin/wavplugin.h
index 64635ca..6afd67e 100644
--- a/core/multimedia/opieplayer/wavplugin/wavplugin.h
+++ b/core/multimedia/opieplayer/wavplugin/wavplugin.h
@@ -14,19 +14,24 @@
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// L.J.Potter added changes Fri 02-15-2002
21
20#ifndef WAV_PLUGIN_H 22#ifndef WAV_PLUGIN_H
21#define WAV_PLUGIN_H 23#define WAV_PLUGIN_H
22 24
23 25
24#include <qstring.h> 26#include <qstring.h>
25#include <qapplication.h> 27#include <qapplication.h>
26#include "mediaplayerplugininterface.h" 28#include "../mediaplayerplugininterface.h"
29
30
31// #define OLD_MEDIAPLAYER_API
27 32
28 33
29class WavPluginData; 34class WavPluginData;
30 35
31 36
32class WavPlugin : public MediaPlayerDecoder { 37class WavPlugin : public MediaPlayerDecoder {
@@ -40,27 +45,30 @@ public:
40 double pluginVersion() { return 1.0; } 45 double pluginVersion() { return 1.0; }
41 46
42 bool isFileSupported( const QString& ); 47 bool isFileSupported( const QString& );
43 bool open( const QString& ); 48 bool open( const QString& );
44 bool close(); 49 bool close();
45 bool isOpen(); 50 bool isOpen();
46 //const QString &fileInfo() { return strInfo = qApp->translate( "MediaPlayer", "No Information Available", "media plugin text" ); } 51 const QString &fileInfo() { return strInfo = ""; }
47 const QString &fileInfo() { return strInfo = QString(""); }
48 52
49 // If decoder doesn't support audio then return 0 here 53 // If decoder doesn't support audio then return 0 here
50 int audioStreams(); 54 int audioStreams();
51 int audioChannels( int stream ); 55 int audioChannels( int stream );
52 int audioFrequency( int stream ); 56 int audioFrequency( int stream );
57 int audioBitsPerSample( int stream );
53 int audioSamples( int stream ); 58 int audioSamples( int stream );
54 bool audioSetSample( long sample, int stream ); 59 bool audioSetSample( long sample, int stream );
55 long audioGetSample( int stream ); 60 long audioGetSample( int stream );
56 //bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream ); 61#ifdef OLD_MEDIAPLAYER_API
57 //bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream ); 62 bool audioReadMonoSamples( short *output, long samples, long& samplesRead, int stream );
63 bool audioReadStereoSamples( short *output, long samples, long& samplesRead, int stream );
64 bool audioReadSamples( short *output, int channel, long samples, int stream );
65 bool audioReReadSamples( short *output, int channel, long samples, int stream );
66#else
58 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream ); 67 bool audioReadSamples( short *output, int channels, long samples, long& samplesRead, int stream );
59 //bool audioReadSamples( short *output, int channel, long samples, int stream ); 68#endif
60 //bool audioReReadSamples( short *output, int channel, long samples, int stream );
61 69
62 // If decoder doesn't support video then return 0 here 70 // If decoder doesn't support video then return 0 here
63 int videoStreams() { return 0; } 71 int videoStreams() { return 0; }
64 int videoWidth( int ) { return 0; } 72 int videoWidth( int ) { return 0; }
65 int videoHeight( int ) { return 0; } 73 int videoHeight( int ) { return 0; }
66 double videoFrameRate( int ) { return 0.0; } 74 double videoFrameRate( int ) { return 0.0; }
@@ -84,12 +92,14 @@ public:
84 bool supportsYUV() { return FALSE; } 92 bool supportsYUV() { return FALSE; }
85 bool supportsMMX() { return TRUE; } 93 bool supportsMMX() { return TRUE; }
86 bool supportsSMP() { return FALSE; } 94 bool supportsSMP() { return FALSE; }
87 bool supportsStereo() { return TRUE; } 95 bool supportsStereo() { return TRUE; }
88 bool supportsScaling() { return FALSE; } 96 bool supportsScaling() { return FALSE; }
89 97
98 long getPlayTime() { return -1; }
99
90private: 100private:
91 WavPluginData *d; 101 WavPluginData *d;
92 QString strInfo; 102 QString strInfo;
93 103
94}; 104};
95 105