summaryrefslogtreecommitdiff
path: root/core/multimedia
Unidiff
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
@@ -138,2 +138,4 @@ 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 \
@@ -148,3 +150,3 @@ main.o: main.cpp \
148 $(OPIEDIR)/include/qpe/quuid.h \ 150 $(OPIEDIR)/include/qpe/quuid.h \
149 $(OPIEDIR)/include/qpe/mediaplayerplugininterface.h 151 mediaplayerplugininterface.h
150 152
@@ -152,3 +154,4 @@ 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 \
@@ -168,2 +171,4 @@ 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 \
@@ -171,4 +176,4 @@ mediaplayerstate.o: mediaplayerstate.cpp \
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 \
@@ -180,3 +185,3 @@ 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 \
@@ -195,2 +200,7 @@ playlistwidget.o: playlistwidget.cpp \
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 \
@@ -205,2 +215,4 @@ 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 \
@@ -211,3 +223,3 @@ mediaplayer.o: mediaplayer.cpp \
211 mediaplayer.h \ 223 mediaplayer.h \
212 $(OPIEDIR)/include/qpe/mediaplayerplugininterface.h \ 224 mediaplayerplugininterface.h \
213 playlistwidget.h \ 225 playlistwidget.h \
@@ -221,5 +233,6 @@ 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
@@ -250,3 +263,3 @@ moc_mediaplayer.o: moc_mediaplayer.cpp \
250 $(OPIEDIR)/include/qpe/quuid.h \ 263 $(OPIEDIR)/include/qpe/quuid.h \
251 $(OPIEDIR)/include/qpe/mediaplayerplugininterface.h 264 mediaplayerplugininterface.h
252 265
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
@@ -19,3 +19,7 @@
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>
@@ -114,6 +118,7 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume
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;
@@ -159,6 +164,8 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
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
@@ -187,41 +194,13 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
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;
@@ -232,3 +211,3 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
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 );
@@ -242,9 +221,16 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
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 }
@@ -262,3 +248,2 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
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}
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
@@ -19,2 +19,5 @@
19**********************************************************************/ 19**********************************************************************/
20// L.J.Potter added changes Fri 02-15-2002
21
22
20#ifndef AUDIODEVICE_H 23#ifndef AUDIODEVICE_H
@@ -24,2 +27,3 @@
24#include <qobject.h> 27#include <qobject.h>
28#include <sys/soundcard.h>
25 29
@@ -32,3 +36,3 @@ class AudioDevice : public QObject {
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();
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
@@ -63,3 +63,3 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
63{ 63{
64 setCaption( tr("MediaPlayer") ); 64 setCaption( tr("OpiePlayer") );
65 setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/metalFinish" ) ); 65 setBackgroundPixmap( Resource::loadPixmap( "mpegplayer/metalFinish" ) );
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
@@ -26,3 +26,4 @@
26#include "flash.h" 26#include "flash.h"
27#include "mediaplayerplugininterface.h" 27//#include <qpe/mediaplayerplugininterface.h>
28#include "../mediaplayerplugininterface.h"
28 29
@@ -50,2 +51,3 @@ public:
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 );
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
@@ -23,2 +23,3 @@
23 23
24//#include <qpe/mediaplayerplugininterface.h>
24#include "../mediaplayerplugininterface.h" 25#include "../mediaplayerplugininterface.h"
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
@@ -210,3 +210,3 @@ 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};
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
@@ -216,2 +216,3 @@ libmadplugin.o: libmadplugin.cpp \
216 libmadplugin.h \ 216 libmadplugin.h \
217 ../mediaplayerplugininterface.h \
217 mad.h 218 mad.h
@@ -220,2 +221,3 @@ libmadpluginimpl.o: libmadpluginimpl.cpp \
220 libmadplugin.h \ 221 libmadplugin.h \
222 ../mediaplayerplugininterface.h \
221 libmadpluginimpl.h 223 libmadpluginimpl.h
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
@@ -10,2 +10,4 @@ INCLUDEPATH += $(OPIEDIR)/include ..
10DEPENDPATH += ../$(OPIEDIR)/include .. 10DEPENDPATH += ../$(OPIEDIR)/include ..
11TMAKE_CFLAGS += -DFPM_64BIT
12TMAKE_CXXFLAGS += -DFPM_64BIT
11LIBS += -lqpe -lm 13LIBS += -lqpe -lm
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
@@ -24,3 +24,7 @@
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
@@ -52,8 +56,12 @@ public:
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
@@ -93,2 +101,4 @@ public:
93 101
102 long getPlayTime() { return -1; }
103
94private: 104private:
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
@@ -23,2 +23,3 @@
23 23
24//#include <qpe/mediaplayerplugininterface.h>
24#include "../mediaplayerplugininterface.h" 25#include "../mediaplayerplugininterface.h"
@@ -44,3 +45,2 @@ public:
44 virtual MediaPlayerEncoder *encoder(); 45 virtual MediaPlayerEncoder *encoder();
45
46private: 46private:
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
@@ -178,3 +178,4 @@ libmpeg3plugin.o: libmpeg3plugin.cpp \
178 video/mpeg3video.h \ 178 video/mpeg3video.h \
179 mpeg3protos.h 179 mpeg3protos.h \
180 ../mediaplayerplugininterface.h
180 181
@@ -194,2 +195,3 @@ libmpeg3pluginimpl.o: libmpeg3pluginimpl.cpp \
194 mpeg3protos.h \ 195 mpeg3protos.h \
196 ../mediaplayerplugininterface.h \
195 libmpeg3pluginimpl.h 197 libmpeg3pluginimpl.h
@@ -416,3 +418,3 @@ audio/layer2.o: audio/layer2.c \
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 \
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
@@ -27,3 +27,7 @@
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
@@ -44,3 +48,3 @@ public:
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
@@ -50,2 +54,3 @@ public:
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; }
@@ -53,7 +58,10 @@ public:
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
@@ -104,2 +112,4 @@ public:
104 112
113 long getPlayTime() { return -1; }
114
105private: 115private:
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
@@ -23,2 +23,3 @@
23 23
24//#include <qpe/mediaplayerplugininterface.h>
24#include "../mediaplayerplugininterface.h" 25#include "../mediaplayerplugininterface.h"
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
@@ -19,3 +19,6 @@
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
@@ -234,9 +237,10 @@ void LoopControl::startAudio() {
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
@@ -375,3 +379,3 @@ bool LoopControl::init( const QString& filename ) {
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
@@ -380,3 +384,3 @@ bool LoopControl::init( const QString& filename ) {
380 384
381 total_audio_samples += 1000; 385// total_audio_samples += 1000;
382 386
@@ -385,3 +389,3 @@ bool LoopControl::init( const QString& filename ) {
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
@@ -389,5 +393,5 @@ bool LoopControl::init( const QString& filename ) {
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() ];
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
@@ -19,2 +19,4 @@
19**********************************************************************/ 19**********************************************************************/
20// L.J.Potter added changes Fri 02-15-2002
21
20#ifndef MPEGVIEW_H 22#ifndef 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
@@ -28,2 +28,3 @@
28#endif 28#endif
29#include "mediaplayerplugininterface.h"
29#include <stdio.h> 30#include <stdio.h>
@@ -38,3 +39,2 @@
38#include "audiowidget.h" 39#include "audiowidget.h"
39#include "mediaplayerplugininterface.h"
40#include "mediaplayerstate.h" 40#include "mediaplayerstate.h"
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
@@ -50,3 +50,3 @@ int main(int argc, char **argv) {
50 50
51 pl.setCaption( MediaPlayer::tr("Media Player") ); 51 pl.setCaption( MediaPlayer::tr("Opie Player") );
52 a.showMainDocumentWidget(&pl); 52 a.showMainDocumentWidget(&pl);
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
@@ -63,8 +63,3 @@ public:
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
@@ -98,2 +93,5 @@ public:
98 93
94 // File Properies
95 virtual long getPlayTime() { return -1; }
96 virtual int audioBitsPerSample( int stream ) = 0;
99}; 97};
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
@@ -28,2 +28,4 @@
28 28
29
30
29#ifdef QT_NO_COMPONENT 31#ifdef QT_NO_COMPONENT
@@ -116,2 +118,6 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() {
116 118
119// ### hack to get true sample count
120// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() {
121// return libwavdecoder;
122// }
117 123
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
@@ -108,2 +108,3 @@ private:
108 MediaPlayerDecoder *libmpeg3decoder; 108 MediaPlayerDecoder *libmpeg3decoder;
109// MediaPlayerDecoder *libwavdecoder;
109 110
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
@@ -22,2 +22,4 @@
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>
@@ -36,2 +38,6 @@
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
@@ -43,2 +49,5 @@
43 49
50#define BUTTONS_ON_TOOLBAR
51#define SIDE_BUTTONS
52#define CAN_SAVE_LOAD_PLAYLISTS
44 53
@@ -46,11 +55,8 @@ extern 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;
@@ -94,2 +100,4 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
94 d->current = NULL; 100 d->current = NULL;
101 menuTimer = new QTimer( this ,"menu timer"),
102 connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) );
95 103
@@ -97,3 +105,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
97 105
98 setCaption( tr("MediaPlayer") ); 106 setCaption( tr("OpiePlayer") );
99 setIcon( Resource::loadPixmap( "MPEGPlayer" ) ); 107 setIcon( Resource::loadPixmap( "MPEGPlayer" ) );
@@ -112,31 +120,60 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
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
@@ -146,6 +183,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
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()) );
@@ -154,25 +188,81 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
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 ) ) );
@@ -180,5 +270,7 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
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 ) ) );
@@ -205,2 +297,3 @@ PlayListWidget::~PlayListWidget() {
205void PlayListWidget::initializeStates() { 297void PlayListWidget::initializeStates() {
298
206 d->tbPlay->setOn( mediaPlayerState->playing() ); 299 d->tbPlay->setOn( mediaPlayerState->playing() );
@@ -208,6 +301,6 @@ void PlayListWidget::initializeStates() {
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}
@@ -276,2 +369,12 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) {
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() {
@@ -448 +551,143 @@ void PlayListWidget::setView( char view ) {
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
@@ -25,2 +25,4 @@
25#include <qpe/applnk.h> 25#include <qpe/applnk.h>
26#include <qtabwidget.h>
27#include <qtimer.h>
26 28
@@ -29,3 +31,7 @@ class PlayListWidgetPrivate;
29class Config; 31class Config;
30 32class QListViewItem;
33class QListView;
34class QPoint;
35class QAction;
36class QLabel;
31 37
@@ -36,3 +42,8 @@ public:
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)
@@ -40,2 +51,3 @@ public:
40 void useSelectedDocument(); 51 void useSelectedDocument();
52 QTimer * menuTimer;
41 53
@@ -44,2 +56,4 @@ public slots:
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
@@ -53,2 +67,3 @@ public slots:
53 void loadList(); // Load a playlist 67 void loadList(); // Load a playlist
68 void playIt( QListViewItem *);
54 bool first(); 69 bool first();
@@ -57,2 +72,10 @@ public slots:
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
@@ -63,2 +86,8 @@ private:
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};
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
@@ -20,2 +20,3 @@
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include "mediaplayerplugininterface.h"
21#include <qwidget.h> 22#include <qwidget.h>
@@ -26,3 +27,2 @@
26#include "videowidget.h" 27#include "videowidget.h"
27#include "mediaplayerplugininterface.h"
28#include "mediaplayerstate.h" 28#include "mediaplayerstate.h"
@@ -68,3 +68,3 @@ 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" ) );
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
@@ -102,3 +102,4 @@ REQUIRES=
102wavplugin.o: wavplugin.cpp \ 102wavplugin.o: wavplugin.cpp \
103 wavplugin.h 103 wavplugin.h \
104 ../mediaplayerplugininterface.h
104 105
@@ -106,2 +107,3 @@ wavpluginimpl.o: wavpluginimpl.cpp \
106 wavplugin.h \ 107 wavplugin.h \
108 ../mediaplayerplugininterface.h \
107 wavpluginimpl.h 109 wavpluginimpl.h
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
@@ -19,2 +19,4 @@
19**********************************************************************/ 19**********************************************************************/
20// L.J.Potter added changes Fri 02-15-2002
21
20#include <stdio.h> 22#include <stdio.h>
@@ -49,3 +51,3 @@ struct ChunkData {
49 51
50const int sound_buffer_size = 4096; 52const int sound_buffer_size = 512; // 4096; // you got to be kidding right?
51 53
@@ -75,2 +77,3 @@ public:
75 done = 0; 77 done = 0;
78 qApp->processEvents();
76 79
@@ -87,3 +90,3 @@ public:
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) ) {
@@ -97,3 +100,2 @@ public:
97 } 100 }
98
99 return TRUE; 101 return TRUE;
@@ -145,3 +147,3 @@ public:
145 } // while 147 } // while
146 148 qDebug("bits %d", chunkdata.wBitsPerSample);
147 return TRUE; 149 return TRUE;
@@ -207,3 +209,3 @@ WavPlugin::~WavPlugin() {
207bool WavPlugin::isFileSupported( const QString& path ) { 209bool WavPlugin::isFileSupported( const QString& path ) {
208 debugMsg( "WavPlugin::isFileSupported" ); 210// qDebug( "WavPlugin::isFileSupported" );
209 211
@@ -226,3 +228,3 @@ bool WavPlugin::isFileSupported( const QString& path ) {
226bool WavPlugin::open( const QString& path ) { 228bool WavPlugin::open( const QString& path ) {
227 debugMsg( "WavPlugin::open" ); 229// qDebug( "WavPlugin::open" );
228 230
@@ -247,3 +249,3 @@ bool WavPlugin::open( const QString& path ) {
247bool WavPlugin::close() { 249bool WavPlugin::close() {
248 debugMsg( "WavPlugin::close" ); 250// qDebug( "WavPlugin::close" );
249 251
@@ -257,3 +259,3 @@ bool WavPlugin::close() {
257bool WavPlugin::isOpen() { 259bool WavPlugin::isOpen() {
258 debugMsg( "WavPlugin::isOpen" ); 260// qDebug( "WavPlugin::isOpen" );
259 return ( d->input != 0 ); 261 return ( d->input != 0 );
@@ -263,3 +265,3 @@ bool WavPlugin::isOpen() {
263int WavPlugin::audioStreams() { 265int WavPlugin::audioStreams() {
264 debugMsg( "WavPlugin::audioStreams" ); 266// qDebug( "WavPlugin::audioStreams" );
265 return 1; 267 return 1;
@@ -269,4 +271,4 @@ int WavPlugin::audioStreams() {
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}
@@ -275,4 +277,4 @@ int WavPlugin::audioChannels( int ) {
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}
@@ -281,4 +283,4 @@ int WavPlugin::audioFrequency( int ) {
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
@@ -288,3 +290,3 @@ int WavPlugin::audioSamples( int ) {
288bool WavPlugin::audioSetSample( long, int ) { 290bool WavPlugin::audioSetSample( long, int ) {
289 debugMsg( "WavPlugin::audioSetSample" ); 291// qDebug( "WavPlugin::audioSetSample" );
290 return FALSE; 292 return FALSE;
@@ -294,3 +296,3 @@ bool WavPlugin::audioSetSample( long, int ) {
294long WavPlugin::audioGetSample( int ) { 296long WavPlugin::audioGetSample( int ) {
295 debugMsg( "WavPlugin::audioGetSample" ); 297// qDebug( "WavPlugin::audioGetSample" );
296 return 0; 298 return 0;
@@ -324,3 +326,3 @@ bool WavPlugin::audioReadStereoSamples( short *output, long samples, long& sampl
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 );
@@ -329,3 +331,3 @@ bool WavPlugin::audioReadSamples( short *output, int channels, long samples, lon
329double WavPlugin::getTime() { 331double WavPlugin::getTime() {
330 debugMsg( "WavPlugin::getTime" ); 332// qDebug( "WavPlugin::getTime" );
331 return 0.0; 333 return 0.0;
@@ -333,2 +335,7 @@ double WavPlugin::getTime() {
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
@@ -19,2 +19,4 @@
19**********************************************************************/ 19**********************************************************************/
20// L.J.Potter added changes Fri 02-15-2002
21
20#ifndef WAV_PLUGIN_H 22#ifndef WAV_PLUGIN_H
@@ -25,3 +27,6 @@
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
@@ -45,4 +50,3 @@ public:
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
@@ -52,2 +56,3 @@ public:
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 );
@@ -55,7 +60,10 @@ public:
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
@@ -89,2 +97,4 @@ public:
89 97
98 long getPlayTime() { return -1; }
99
90private: 100private: