Diffstat (limited to 'core/multimedia/opieplayer/wavplugin') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/wavplugin/Makefile.in | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/wavplugin/wavplugin.cpp | 45 | ||||
-rw-r--r-- | core/multimedia/opieplayer/wavplugin/wavplugin.h | 24 |
3 files changed, 46 insertions, 27 deletions
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= | |||
102 | wavplugin.o: wavplugin.cpp \ | 102 | wavplugin.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 | ||
50 | const int sound_buffer_size = 4096; | 52 | const 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() { | |||
207 | bool WavPlugin::isFileSupported( const QString& path ) { | 209 | bool 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 ) { | |||
226 | bool WavPlugin::open( const QString& path ) { | 228 | bool 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 ) { | |||
247 | bool WavPlugin::close() { | 249 | bool WavPlugin::close() { |
248 | debugMsg( "WavPlugin::close" ); | 250 | // qDebug( "WavPlugin::close" ); |
249 | 251 | ||
@@ -257,3 +259,3 @@ bool WavPlugin::close() { | |||
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 ); |
@@ -263,3 +265,3 @@ bool WavPlugin::isOpen() { | |||
263 | int WavPlugin::audioStreams() { | 265 | int WavPlugin::audioStreams() { |
264 | debugMsg( "WavPlugin::audioStreams" ); | 266 | // qDebug( "WavPlugin::audioStreams" ); |
265 | return 1; | 267 | return 1; |
@@ -269,4 +271,4 @@ int WavPlugin::audioStreams() { | |||
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 | } |
@@ -275,4 +277,4 @@ int WavPlugin::audioChannels( int ) { | |||
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 | } |
@@ -281,4 +283,4 @@ int WavPlugin::audioFrequency( int ) { | |||
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 |
@@ -288,3 +290,3 @@ int WavPlugin::audioSamples( int ) { | |||
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; |
@@ -294,3 +296,3 @@ bool WavPlugin::audioSetSample( long, int ) { | |||
294 | long WavPlugin::audioGetSample( int ) { | 296 | long 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 | |||
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 ); |
@@ -329,3 +331,3 @@ bool WavPlugin::audioReadSamples( short *output, int channels, long samples, lon | |||
329 | double WavPlugin::getTime() { | 331 | double 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 | ||
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 | |||
@@ -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 | |||
90 | private: | 100 | private: |