summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/wavplugin/wavplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/wavplugin/wavplugin.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
index 4e82900..7f3a0a8 100644
--- a/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
+++ b/core/multimedia/opieplayer/wavplugin/wavplugin.cpp
@@ -21,2 +21,12 @@
21 21
22
23#include "wavplugin.h"
24
25/* OPIE */
26#include <opie2/odebug.h>
27
28/* QT */
29#include <qfile.h>
30
31/* STD */
22#include <stdio.h> 32#include <stdio.h>
@@ -26,4 +36,2 @@
26#include <unistd.h> 36#include <unistd.h>
27#include <qfile.h>
28#include "wavplugin.h"
29 37
@@ -78,3 +86,3 @@ public:
78 if ( input == 0 ) { 86 if ( input == 0 ) {
79 qDebug("no input"); 87 odebug << "no input" << oendl;
80 return FALSE; 88 return FALSE;
@@ -85,3 +93,3 @@ public:
85 if ( getSample(l, r) == FALSE ) { 93 if ( getSample(l, r) == FALSE ) {
86 qDebug("didn't get sample"); 94 odebug << "didn't get sample" << oendl;
87 return FALSE; 95 return FALSE;
@@ -137,3 +145,3 @@ public:
137 if ( chunkdata.formatTag != WAVE_FORMAT_PCM ) { 145 if ( chunkdata.formatTag != WAVE_FORMAT_PCM ) {
138 qDebug("WAV file: UNSUPPORTED FORMAT %d",chunkdata.formatTag); 146 odebug << "WAV file: UNSUPPORTED FORMAT " << chunkdata.formatTag << "" << oendl;
139 return FALSE; 147 return FALSE;
@@ -147,3 +155,3 @@ public:
147 } // while 155 } // while
148 qDebug("bits %d", chunkdata.wBitsPerSample); 156 odebug << "bits " << chunkdata.wBitsPerSample << "" << oendl;
149 return TRUE; 157 return TRUE;
@@ -209,3 +217,3 @@ WavPlugin::~WavPlugin() {
209bool WavPlugin::isFileSupported( const QString& path ) { 217bool WavPlugin::isFileSupported( const QString& path ) {
210// qDebug( "WavPlugin::isFileSupported" ); 218// odebug << "WavPlugin::isFileSupported" << oendl;
211 219
@@ -228,3 +236,3 @@ bool WavPlugin::isFileSupported( const QString& path ) {
228bool WavPlugin::open( const QString& path ) { 236bool WavPlugin::open( const QString& path ) {
229// qDebug( "WavPlugin::open" ); 237// odebug << "WavPlugin::open" << oendl;
230 238
@@ -236,3 +244,3 @@ bool WavPlugin::open( const QString& path ) {
236 if ( d->input->open(IO_ReadOnly) == FALSE ) { 244 if ( d->input->open(IO_ReadOnly) == FALSE ) {
237 qDebug("couldn't open file"); 245 odebug << "couldn't open file" << oendl;
238 delete d->input; 246 delete d->input;
@@ -250,3 +258,3 @@ bool WavPlugin::open( const QString& path ) {
250bool WavPlugin::close() { 258bool WavPlugin::close() {
251// qDebug( "WavPlugin::close" ); 259// odebug << "WavPlugin::close" << oendl;
252 260
@@ -260,3 +268,3 @@ bool WavPlugin::close() {
260bool WavPlugin::isOpen() { 268bool WavPlugin::isOpen() {
261// qDebug( "WavPlugin::isOpen" ); 269// odebug << "WavPlugin::isOpen" << oendl;
262 return ( d->input != 0 ); 270 return ( d->input != 0 );
@@ -266,3 +274,3 @@ bool WavPlugin::isOpen() {
266int WavPlugin::audioStreams() { 274int WavPlugin::audioStreams() {
267// qDebug( "WavPlugin::audioStreams" ); 275// odebug << "WavPlugin::audioStreams" << oendl;
268 return 1; 276 return 1;
@@ -272,3 +280,3 @@ int WavPlugin::audioStreams() {
272int WavPlugin::audioChannels( int ) { 280int WavPlugin::audioChannels( int ) {
273// qDebug( "WavPlugin::audioChannels" ); 281// odebug << "WavPlugin::audioChannels" << oendl;
274 return d->chunkdata.channels;// 2; // ### Always scale audio to stereo samples 282 return d->chunkdata.channels;// 2; // ### Always scale audio to stereo samples
@@ -278,3 +286,3 @@ int WavPlugin::audioChannels( int ) {
278int WavPlugin::audioFrequency( int ) { 286int WavPlugin::audioFrequency( int ) {
279// qDebug( "WavPlugin::audioFrequency %d", d->chunkdata.samplesPerSec ); 287// odebug << "WavPlugin::audioFrequency " << d->chunkdata.samplesPerSec << "" << oendl;
280 return d->chunkdata.samplesPerSec; //44100; // ### Always scale to frequency of 44100 288 return d->chunkdata.samplesPerSec; //44100; // ### Always scale to frequency of 44100
@@ -284,3 +292,3 @@ int WavPlugin::audioFrequency( int ) {
284int WavPlugin::audioSamples( int ) { 292int WavPlugin::audioSamples( int ) {
285// qDebug( "WavPlugin::audioSamples" ); 293// odebug << "WavPlugin::audioSamples" << oendl;
286 return d->samples / d->chunkdata.channels/2; // ### Scaled samples will be made stereo, 294 return d->samples / d->chunkdata.channels/2; // ### Scaled samples will be made stereo,
@@ -291,3 +299,3 @@ int WavPlugin::audioSamples( int ) {
291bool WavPlugin::audioSetSample( long, int ) { 299bool WavPlugin::audioSetSample( long, int ) {
292// qDebug( "WavPlugin::audioSetSample" ); 300// odebug << "WavPlugin::audioSetSample" << oendl;
293 return FALSE; 301 return FALSE;
@@ -297,3 +305,3 @@ bool WavPlugin::audioSetSample( long, int ) {
297long WavPlugin::audioGetSample( int ) { 305long WavPlugin::audioGetSample( int ) {
298// qDebug( "WavPlugin::audioGetSample" ); 306// odebug << "WavPlugin::audioGetSample" << oendl;
299 return 0; 307 return 0;
@@ -327,3 +335,3 @@ bool WavPlugin::audioReadStereoSamples( short *output, long samples, long& sampl
327bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) { 335bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) {
328// qDebug( "WavPlugin::audioReadSamples" ); 336// odebug << "WavPlugin::audioReadSamples" << oendl;
329 return d->add( output, samples, samplesMade, channels != 1 ); 337 return d->add( output, samples, samplesMade, channels != 1 );
@@ -332,3 +340,3 @@ bool WavPlugin::audioReadSamples( short *output, int channels, long samples, lon
332double WavPlugin::getTime() { 340double WavPlugin::getTime() {
333// qDebug( "WavPlugin::getTime" ); //this is a stupid hack here!! 341// odebug << "WavPlugin::getTime" << oendl; //this is a stupid hack here!!
334 return d->chunkdata.wBitsPerSample; /*0.0*/; 342 return d->chunkdata.wBitsPerSample; /*0.0*/;
@@ -337,4 +345,4 @@ double WavPlugin::getTime() {
337// int WavPlugin::audioBitsPerSample( int ) { 345// int WavPlugin::audioBitsPerSample( int ) {
338// // qDebug( "WavPlugin::audioFormat %d", d->chunkdata.wBitsPerSample ); 346// // odebug << "WavPlugin::audioFormat " << d->chunkdata.wBitsPerSample << "" << oendl;
339// return d->chunkdata.wBitsPerSample; // 347// return d->chunkdata.wBitsPerSample; //
340// } 348// }