author | llornkcor <llornkcor> | 2002-02-24 21:51:51 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-02-24 21:51:51 (UTC) |
commit | 36b768c465c6ecddceb57ff1d7a5087e9848c897 (patch) (unidiff) | |
tree | 4ddde589e2393ca136e24cda4fc456612149ae72 /core | |
parent | ade25ac278169f0e0c9ee0771e754adb46cf7ce2 (diff) | |
download | opie-36b768c465c6ecddceb57ff1d7a5087e9848c897.zip opie-36b768c465c6ecddceb57ff1d7a5087e9848c897.tar.gz opie-36b768c465c6ecddceb57ff1d7a5087e9848c897.tar.bz2 |
changed mediaplayerplugininterface.h location
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 | |||
@@ -137,4 +137,6 @@ REQUIRES= | |||
137 | main.o: main.cpp \ | 137 | main.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 \ |
@@ -147,9 +149,10 @@ main.o: main.cpp \ | |||
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 | ||
151 | loopcontrol.o: loopcontrol.cpp \ | 153 | loopcontrol.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 \ |
@@ -167,9 +170,11 @@ playlistselection.o: playlistselection.cpp \ | |||
167 | mediaplayerstate.o: mediaplayerstate.cpp \ | 170 | mediaplayerstate.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 \ |
@@ -179,5 +184,5 @@ mediaplayerstate.o: mediaplayerstate.cpp \ | |||
179 | videowidget.o: videowidget.cpp \ | 184 | videowidget.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 \ |
@@ -194,4 +199,9 @@ playlistwidget.o: playlistwidget.cpp \ | |||
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 \ |
@@ -204,4 +214,6 @@ playlistwidget.o: playlistwidget.cpp \ | |||
204 | mediaplayer.o: mediaplayer.cpp \ | 214 | mediaplayer.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 \ |
@@ -210,5 +222,5 @@ mediaplayer.o: mediaplayer.cpp \ | |||
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 \ |
@@ -220,7 +232,8 @@ mediaplayer.o: mediaplayer.cpp \ | |||
220 | audiodevice.o: audiodevice.cpp \ | 232 | audiodevice.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 | ||
226 | moc_loopcontrol.o: moc_loopcontrol.cpp \ | 239 | moc_loopcontrol.o: moc_loopcontrol.cpp \ |
@@ -249,5 +262,5 @@ moc_mediaplayer.o: moc_mediaplayer.cpp \ | |||
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 | ||
253 | moc_audiodevice.o: moc_audiodevice.cpp \ | 266 | moc_audiodevice.o: moc_audiodevice.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 | |||
@@ -18,5 +18,9 @@ | |||
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> |
@@ -113,8 +117,9 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume | |||
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; |
@@ -158,8 +163,10 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, | |||
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 |
@@ -186,43 +193,15 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
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 | ||
@@ -231,5 +210,5 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
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 | } |
@@ -241,11 +220,18 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
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 | ||
@@ -261,5 +247,4 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { | |||
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 | ||
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 | |||
@@ -18,4 +18,7 @@ | |||
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 |
@@ -23,4 +26,5 @@ | |||
23 | 26 | ||
24 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | #include <sys/soundcard.h> | ||
25 | 29 | ||
26 | 30 | ||
@@ -31,5 +35,5 @@ class AudioDevice : public QObject { | |||
31 | Q_OBJECT | 35 | Q_OBJECT |
32 | public: | 36 | public: |
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 | ||
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 | |||
@@ -62,5 +62,5 @@ AudioWidget::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" ) ); |
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 | |||
@@ -25,5 +25,6 @@ | |||
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 | ||
@@ -49,4 +50,5 @@ public: | |||
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; } |
52 | int 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 ); |
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 | |||
@@ -22,4 +22,5 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | //#include <qpe/mediaplayerplugininterface.h> | ||
24 | #include "../mediaplayerplugininterface.h" | 25 | #include "../mediaplayerplugininterface.h" |
25 | 26 | ||
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 | |||
@@ -209,5 +209,5 @@ extern "C" { | |||
209 | extern "C" { | 209 | extern "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 | ||
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 | |||
@@ -215,8 +215,10 @@ huffman.o: huffman.c \ | |||
215 | libmadplugin.o: libmadplugin.cpp \ | 215 | libmadplugin.o: libmadplugin.cpp \ |
216 | libmadplugin.h \ | 216 | libmadplugin.h \ |
217 | ../mediaplayerplugininterface.h \ | ||
217 | mad.h | 218 | mad.h |
218 | 219 | ||
219 | libmadpluginimpl.o: libmadpluginimpl.cpp \ | 220 | libmadpluginimpl.o: libmadpluginimpl.cpp \ |
220 | libmadplugin.h \ | 221 | libmadplugin.h \ |
222 | ../mediaplayerplugininterface.h \ | ||
221 | libmadpluginimpl.h | 223 | libmadpluginimpl.h |
222 | 224 | ||
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 | |||
@@ -9,4 +9,6 @@ DESTDIR = ../../plugins/codecs | |||
9 | INCLUDEPATH += $(OPIEDIR)/include .. | 9 | INCLUDEPATH += $(OPIEDIR)/include .. |
10 | DEPENDPATH += ../$(OPIEDIR)/include .. | 10 | DEPENDPATH += ../$(OPIEDIR)/include .. |
11 | TMAKE_CFLAGS += -DFPM_64BIT | ||
12 | TMAKE_CXXFLAGS += -DFPM_64BIT | ||
11 | LIBS += -lqpe -lm | 13 | LIBS += -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 | |||
@@ -23,5 +23,9 @@ | |||
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 | ||
@@ -51,10 +55,14 @@ public: | |||
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 | ||
@@ -92,4 +100,6 @@ public: | |||
92 | bool supportsScaling() { return FALSE; } | 100 | bool supportsScaling() { return FALSE; } |
93 | 101 | ||
102 | long getPlayTime() { return -1; } | ||
103 | |||
94 | private: | 104 | private: |
95 | LibMadPluginData *d; | 105 | LibMadPluginData *d; |
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 | |||
@@ -22,4 +22,5 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | //#include <qpe/mediaplayerplugininterface.h> | ||
24 | #include "../mediaplayerplugininterface.h" | 25 | #include "../mediaplayerplugininterface.h" |
25 | 26 | ||
@@ -43,5 +44,4 @@ public: | |||
43 | virtual MediaPlayerDecoder *decoder(); | 44 | virtual MediaPlayerDecoder *decoder(); |
44 | virtual MediaPlayerEncoder *encoder(); | 45 | virtual MediaPlayerEncoder *encoder(); |
45 | |||
46 | private: | 46 | private: |
47 | LibMadPlugin *libmadplugin; | 47 | LibMadPlugin *libmadplugin; |
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 | |||
@@ -177,5 +177,6 @@ libmpeg3plugin.o: libmpeg3plugin.cpp \ | |||
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 | ||
181 | libmpeg3pluginimpl.o: libmpeg3pluginimpl.cpp \ | 182 | libmpeg3pluginimpl.o: libmpeg3pluginimpl.cpp \ |
@@ -193,4 +194,5 @@ libmpeg3pluginimpl.o: libmpeg3pluginimpl.cpp \ | |||
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 | ||
@@ -415,5 +417,5 @@ audio/layer2.o: audio/layer2.c \ | |||
415 | 417 | ||
416 | audio/layer3.o: audio/layer3.c \ | 418 | audio/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 \ |
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 | |||
@@ -26,5 +26,9 @@ | |||
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 | ||
@@ -43,5 +47,5 @@ public: | |||
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 |
@@ -49,12 +53,16 @@ public: | |||
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 |
@@ -103,4 +111,6 @@ public: | |||
103 | bool supportsScaling() { return TRUE; } | 111 | bool supportsScaling() { return TRUE; } |
104 | 112 | ||
113 | long getPlayTime() { return -1; } | ||
114 | |||
105 | private: | 115 | private: |
106 | mpeg3_t *file; | 116 | mpeg3_t *file; |
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 | |||
@@ -22,4 +22,5 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | //#include <qpe/mediaplayerplugininterface.h> | ||
24 | #include "../mediaplayerplugininterface.h" | 25 | #include "../mediaplayerplugininterface.h" |
25 | 26 | ||
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 | |||
@@ -18,5 +18,8 @@ | |||
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> |
@@ -233,11 +236,12 @@ void LoopControl::startAudio() { | |||
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 ); |
@@ -374,21 +378,21 @@ bool LoopControl::init( const QString& filename ) { | |||
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(); |
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 | |||
@@ -18,4 +18,6 @@ | |||
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 |
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 | |||
@@ -27,4 +27,5 @@ | |||
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> |
@@ -37,5 +38,4 @@ | |||
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 | ||
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 | |||
@@ -49,5 +49,5 @@ int main(int argc, char **argv) { | |||
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 | ||
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 | |||
@@ -62,10 +62,5 @@ public: | |||
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 |
@@ -97,4 +92,7 @@ public: | |||
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 | ||
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 | |||
@@ -27,4 +27,6 @@ | |||
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 |
@@ -115,4 +117,8 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { | |||
115 | } | 117 | } |
116 | 118 | ||
119 | // ### hack to get true sample count | ||
120 | // MediaPlayerDecoder *MediaPlayerState::libWavDecoder() { | ||
121 | // return libwavdecoder; | ||
122 | // } | ||
117 | 123 | ||
118 | void MediaPlayerState::loadPlugins() { | 124 | void MediaPlayerState::loadPlugins() { |
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 | |||
@@ -107,4 +107,5 @@ private: | |||
107 | MediaPlayerDecoder *decoder; | 107 | MediaPlayerDecoder *decoder; |
108 | MediaPlayerDecoder *libmpeg3decoder; | 108 | MediaPlayerDecoder *libmpeg3decoder; |
109 | // MediaPlayerDecoder *libwavdecoder; | ||
109 | 110 | ||
110 | void loadPlugins(); | 111 | void loadPlugins(); |
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 | |||
@@ -21,4 +21,6 @@ | |||
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> |
@@ -35,4 +37,8 @@ | |||
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" |
@@ -42,16 +48,16 @@ | |||
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 | ||
45 | extern MediaPlayerState *mediaPlayerState; | 54 | extern MediaPlayerState *mediaPlayerState; |
46 | 55 | ||
56 | // class myFileSelector { | ||
47 | 57 | ||
58 | // }; | ||
48 | class PlayListWidgetPrivate { | 59 | class PlayListWidgetPrivate { |
49 | public: | 60 | public: |
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; |
@@ -93,8 +99,10 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
@@ -111,33 +119,62 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
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 ); |
@@ -145,41 +182,96 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
@@ -204,11 +296,12 @@ PlayListWidget::~PlayListWidget() { | |||
204 | 296 | ||
205 | void PlayListWidget::initializeStates() { | 297 | void 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 | ||
@@ -275,4 +368,14 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { | |||
275 | 368 | ||
276 | 369 | ||
370 | void 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 | |||
277 | void PlayListWidget::clearList() { | 380 | void PlayListWidget::clearList() { |
278 | while ( first() ) | 381 | while ( first() ) |
@@ -447,2 +550,144 @@ void PlayListWidget::setView( char view ) { | |||
447 | } | 550 | } |
448 | 551 | ||
552 | void 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 | |||
569 | void PlayListWidget::removeSelected() { | ||
570 | d->selectedFiles->removeSelected( ); | ||
571 | } | ||
572 | |||
573 | |||
574 | void 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 | |||
607 | void 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 | |||
641 | void 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 | |||
666 | void PlayListWidget::cancelMenuTimer() { | ||
667 | if( menuTimer->isActive() ) | ||
668 | menuTimer->stop(); | ||
669 | } | ||
670 | |||
671 | void PlayListWidget::showFileMenu() { | ||
672 | |||
673 | } | ||
674 | |||
675 | void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) | ||
676 | { | ||
677 | // QListView::contentsMousePressEvent( e ); | ||
678 | menuTimer->start( 750, TRUE ); | ||
679 | } | ||
680 | |||
681 | |||
682 | void 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 | |||
@@ -24,9 +24,15 @@ | |||
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 | ||
28 | class PlayListWidgetPrivate; | 30 | class PlayListWidgetPrivate; |
29 | class Config; | 31 | class Config; |
30 | 32 | class QListViewItem; | |
33 | class QListView; | ||
34 | class QPoint; | ||
35 | class QAction; | ||
36 | class QLabel; | ||
31 | 37 | ||
32 | class PlayListWidget : public QMainWindow { | 38 | class PlayListWidget : public QMainWindow { |
@@ -35,12 +41,20 @@ public: | |||
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 | ||
42 | public slots: | 54 | public 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 |
@@ -52,8 +66,17 @@ public slots: | |||
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(); */ | ||
78 | protected: | ||
79 | void contentsMousePressEvent( QMouseEvent * e ); | ||
80 | void contentsMouseReleaseEvent( QMouseEvent * e ); | ||
58 | 81 | ||
59 | private: | 82 | private: |
@@ -62,4 +85,10 @@ private: | |||
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 | |||
88 | protected slots: | ||
89 | void cancelMenuTimer(); | ||
90 | void showFileMenu(); | ||
91 | |||
92 | |||
64 | }; | 93 | }; |
65 | 94 | ||
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 | |||
@@ -19,4 +19,5 @@ | |||
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> |
@@ -25,5 +26,4 @@ | |||
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 | ||
@@ -67,5 +67,5 @@ static const int numButtons = (sizeof(videoButtons)/sizeof(MediaButton)); | |||
67 | VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : | 67 | VideoWidget::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" ) ); |
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 | |||
@@ -101,8 +101,10 @@ REQUIRES= | |||
101 | 101 | ||
102 | wavplugin.o: wavplugin.cpp \ | 102 | wavplugin.o: wavplugin.cpp \ |
103 | wavplugin.h | 103 | wavplugin.h \ |
104 | ../mediaplayerplugininterface.h | ||
104 | 105 | ||
105 | wavpluginimpl.o: wavpluginimpl.cpp \ | 106 | wavpluginimpl.o: wavpluginimpl.cpp \ |
106 | wavplugin.h \ | 107 | wavplugin.h \ |
108 | ../mediaplayerplugininterface.h \ | ||
107 | wavpluginimpl.h | 109 | wavpluginimpl.h |
108 | 110 | ||
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 | |||
@@ -18,4 +18,6 @@ | |||
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> |
@@ -48,5 +50,5 @@ struct ChunkData { | |||
48 | 50 | ||
49 | 51 | ||
50 | const int sound_buffer_size = 4096; | 52 | const int sound_buffer_size = 512; // 4096; // you got to be kidding right? |
51 | 53 | ||
52 | 54 | ||
@@ -74,4 +76,5 @@ public: | |||
74 | { | 76 | { |
75 | done = 0; | 77 | done = 0; |
78 | qApp->processEvents(); | ||
76 | 79 | ||
77 | if ( input == 0 ) { | 80 | if ( input == 0 ) { |
@@ -86,5 +89,5 @@ public: | |||
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; |
@@ -96,5 +99,4 @@ public: | |||
96 | } | 99 | } |
97 | } | 100 | } |
98 | |||
99 | return TRUE; | 101 | return TRUE; |
100 | } | 102 | } |
@@ -144,5 +146,5 @@ public: | |||
144 | } | 146 | } |
145 | } // while | 147 | } // while |
146 | 148 | qDebug("bits %d", chunkdata.wBitsPerSample); | |
147 | return TRUE; | 149 | return TRUE; |
148 | } | 150 | } |
@@ -206,5 +208,5 @@ WavPlugin::~WavPlugin() { | |||
206 | 208 | ||
207 | bool WavPlugin::isFileSupported( const QString& path ) { | 209 | bool 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(), '.' ); |
@@ -225,5 +227,5 @@ bool WavPlugin::isFileSupported( const QString& path ) { | |||
225 | 227 | ||
226 | bool WavPlugin::open( const QString& path ) { | 228 | bool 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; |
@@ -246,5 +248,5 @@ bool WavPlugin::open( const QString& path ) { | |||
246 | 248 | ||
247 | bool WavPlugin::close() { | 249 | bool WavPlugin::close() { |
248 | debugMsg( "WavPlugin::close" ); | 250 | // qDebug( "WavPlugin::close" ); |
249 | 251 | ||
250 | d->input->close(); | 252 | d->input->close(); |
@@ -256,5 +258,5 @@ bool WavPlugin::close() { | |||
256 | 258 | ||
257 | bool WavPlugin::isOpen() { | 259 | bool WavPlugin::isOpen() { |
258 | debugMsg( "WavPlugin::isOpen" ); | 260 | // qDebug( "WavPlugin::isOpen" ); |
259 | return ( d->input != 0 ); | 261 | return ( d->input != 0 ); |
260 | } | 262 | } |
@@ -262,5 +264,5 @@ bool WavPlugin::isOpen() { | |||
262 | 264 | ||
263 | int WavPlugin::audioStreams() { | 265 | int WavPlugin::audioStreams() { |
264 | debugMsg( "WavPlugin::audioStreams" ); | 266 | // qDebug( "WavPlugin::audioStreams" ); |
265 | return 1; | 267 | return 1; |
266 | } | 268 | } |
@@ -268,18 +270,18 @@ int WavPlugin::audioStreams() { | |||
268 | 270 | ||
269 | int WavPlugin::audioChannels( int ) { | 271 | int 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 | ||
275 | int WavPlugin::audioFrequency( int ) { | 277 | int 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 | ||
281 | int WavPlugin::audioSamples( int ) { | 283 | int 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 | } |
@@ -287,5 +289,5 @@ int WavPlugin::audioSamples( int ) { | |||
287 | 289 | ||
288 | bool WavPlugin::audioSetSample( long, int ) { | 290 | bool WavPlugin::audioSetSample( long, int ) { |
289 | debugMsg( "WavPlugin::audioSetSample" ); | 291 | // qDebug( "WavPlugin::audioSetSample" ); |
290 | return FALSE; | 292 | return FALSE; |
291 | } | 293 | } |
@@ -293,5 +295,5 @@ bool WavPlugin::audioSetSample( long, int ) { | |||
293 | 295 | ||
294 | long WavPlugin::audioGetSample( int ) { | 296 | long WavPlugin::audioGetSample( int ) { |
295 | debugMsg( "WavPlugin::audioGetSample" ); | 297 | // qDebug( "WavPlugin::audioGetSample" ); |
296 | return 0; | 298 | return 0; |
297 | } | 299 | } |
@@ -323,12 +325,17 @@ bool WavPlugin::audioReadStereoSamples( short *output, long samples, long& sampl | |||
323 | 325 | ||
324 | bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) { | 326 | bool 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 | ||
329 | double WavPlugin::getTime() { | 331 | double WavPlugin::getTime() { |
330 | debugMsg( "WavPlugin::getTime" ); | 332 | // qDebug( "WavPlugin::getTime" ); |
331 | return 0.0; | 333 | return 0.0; |
332 | } | 334 | } |
333 | 335 | ||
336 | int 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 | |||
@@ -18,4 +18,6 @@ | |||
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 |
@@ -24,5 +26,8 @@ | |||
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 | ||
@@ -44,6 +49,5 @@ public: | |||
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 |
@@ -51,12 +55,16 @@ public: | |||
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 |
@@ -88,4 +96,6 @@ public: | |||
88 | bool supportsScaling() { return FALSE; } | 96 | bool supportsScaling() { return FALSE; } |
89 | 97 | ||
98 | long getPlayTime() { return -1; } | ||
99 | |||
90 | private: | 100 | private: |
91 | WavPluginData *d; | 101 | WavPluginData *d; |