summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/wavplugin/wavplugin.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/wavplugin/wavplugin.cpp45
1 files changed, 26 insertions, 19 deletions
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 @@
**********************************************************************/
+// L.J.Potter added changes Fri 02-15-2002
+
#include <stdio.h>
@@ -49,3 +51,3 @@ struct ChunkData {
-const int sound_buffer_size = 4096;
+const int sound_buffer_size = 512; // 4096; // you got to be kidding right?
@@ -75,2 +77,3 @@ public:
done = 0;
+ qApp->processEvents();
@@ -87,3 +90,3 @@ public:
}
- samples_due += 44100;
+ samples_due += chunkdata.samplesPerSec;
while ( count && (samples_due > chunkdata.samplesPerSec) ) {
@@ -97,3 +100,2 @@ public:
}
-
return TRUE;
@@ -145,3 +147,3 @@ public:
} // while
-
+ qDebug("bits %d", chunkdata.wBitsPerSample);
return TRUE;
@@ -207,3 +209,3 @@ WavPlugin::~WavPlugin() {
bool WavPlugin::isFileSupported( const QString& path ) {
- debugMsg( "WavPlugin::isFileSupported" );
+// qDebug( "WavPlugin::isFileSupported" );
@@ -226,3 +228,3 @@ bool WavPlugin::isFileSupported( const QString& path ) {
bool WavPlugin::open( const QString& path ) {
- debugMsg( "WavPlugin::open" );
+// qDebug( "WavPlugin::open" );
@@ -247,3 +249,3 @@ bool WavPlugin::open( const QString& path ) {
bool WavPlugin::close() {
- debugMsg( "WavPlugin::close" );
+// qDebug( "WavPlugin::close" );
@@ -257,3 +259,3 @@ bool WavPlugin::close() {
bool WavPlugin::isOpen() {
- debugMsg( "WavPlugin::isOpen" );
+// qDebug( "WavPlugin::isOpen" );
return ( d->input != 0 );
@@ -263,3 +265,3 @@ bool WavPlugin::isOpen() {
int WavPlugin::audioStreams() {
- debugMsg( "WavPlugin::audioStreams" );
+// qDebug( "WavPlugin::audioStreams" );
return 1;
@@ -269,4 +271,4 @@ int WavPlugin::audioStreams() {
int WavPlugin::audioChannels( int ) {
- debugMsg( "WavPlugin::audioChannels" );
- return 2; // ### Always scale audio to stereo samples
+// qDebug( "WavPlugin::audioChannels" );
+ return d->chunkdata.channels;// 2; // ### Always scale audio to stereo samples
}
@@ -275,4 +277,4 @@ int WavPlugin::audioChannels( int ) {
int WavPlugin::audioFrequency( int ) {
- debugMsg( "WavPlugin::audioFrequency" );
- return 44100; // ### Always scale to frequency of 44100
+// qDebug( "WavPlugin::audioFrequency %d", d->chunkdata.samplesPerSec );
+ return d->chunkdata.samplesPerSec; //44100; // ### Always scale to frequency of 44100
}
@@ -281,4 +283,4 @@ int WavPlugin::audioFrequency( int ) {
int WavPlugin::audioSamples( int ) {
- debugMsg( "WavPlugin::audioSamples" );
- return d->samples * 2 / d->chunkdata.channels; // ### Scaled samples will be made stereo,
+// qDebug( "WavPlugin::audioSamples" );
+ return d->samples / d->chunkdata.channels/2; // ### Scaled samples will be made stereo,
// Therefore if source is mono we will double the number of samples
@@ -288,3 +290,3 @@ int WavPlugin::audioSamples( int ) {
bool WavPlugin::audioSetSample( long, int ) {
- debugMsg( "WavPlugin::audioSetSample" );
+// qDebug( "WavPlugin::audioSetSample" );
return FALSE;
@@ -294,3 +296,3 @@ bool WavPlugin::audioSetSample( long, int ) {
long WavPlugin::audioGetSample( int ) {
- debugMsg( "WavPlugin::audioGetSample" );
+// qDebug( "WavPlugin::audioGetSample" );
return 0;
@@ -324,3 +326,3 @@ bool WavPlugin::audioReadStereoSamples( short *output, long samples, long& sampl
bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) {
- debugMsg( "WavPlugin::audioReadSamples" );
+// qDebug( "WavPlugin::audioReadSamples" );
return d->add( output, samples, samplesMade, channels != 1 );
@@ -329,3 +331,3 @@ bool WavPlugin::audioReadSamples( short *output, int channels, long samples, lon
double WavPlugin::getTime() {
- debugMsg( "WavPlugin::getTime" );
+// qDebug( "WavPlugin::getTime" );
return 0.0;
@@ -333,2 +335,7 @@ double WavPlugin::getTime() {
+int WavPlugin::audioBitsPerSample( int ) {
+// qDebug( "WavPlugin::audioFormat %d", d->chunkdata.wBitsPerSample );
+ return d->chunkdata.wBitsPerSample; //
+}
+