-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 50 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 25 | ||||
-rw-r--r-- | core/multimedia/opieplayer/libmad/libmadplugin.cpp | 68 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 42 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol_threaded.cpp | 54 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayer.cpp | 18 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.cpp | 26 | ||||
-rw-r--r-- | core/multimedia/opieplayer/modplug/memfile.cpp | 6 | ||||
-rw-r--r-- | core/multimedia/opieplayer/om3u.cpp | 18 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 19 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 90 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 25 | ||||
-rw-r--r-- | core/multimedia/opieplayer/vorbis/libtremorplugin.cpp | 31 | ||||
-rw-r--r-- | core/multimedia/opieplayer/wavplugin/wavplugin.cpp | 48 |
14 files changed, 292 insertions, 228 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 355062b..9b64e07 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp @@ -21,14 +21,10 @@ -#include <stdlib.h> -#include <stdio.h> -#include <qpe/qpeapplication.h> -#include <qpe/config.h> -#include <qmessagebox.h> - #include "audiodevice.h" - -#include <errno.h> +/* OPIE */ +#include <qpe/qpeapplication.h> +#include <qpe/config.h> +#include <opie2/odebug.h> #if !defined(QT_NO_COP) @@ -36,4 +32,12 @@ #endif +/* QT */ +#include <qmessagebox.h> + +/* STD */ +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> + #if defined(Q_WS_X11) || defined(Q_WS_QWS) #include <fcntl.h> @@ -146,5 +150,5 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, //#endif -// qDebug( "setting volume to: 0x%x", volume ); +// odebug << "setting volume to: 0x" << volume << "" << oendl; #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) // Send notification that the volume has changed @@ -156,5 +160,5 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { - // qDebug("creating new audio device"); + // odebug << "creating new audio device" << oendl; // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; d = new AudioDevicePrivate; @@ -162,10 +166,10 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { d->channels = chs; d->bytesPerSample = bps; - // qDebug("%d",bps); + // odebug << "" << bps << "" << oendl; int format=0; if( bps == 8) format = AFMT_U8; else if( bps <= 0) format = AFMT_S16_LE; else format = AFMT_S16_LE; - // qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); + // odebug << "AD- freq " << f << ", channels " << chs << ", b/sample " << bps << ", bitrate " << format << "" << oendl; connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); @@ -201,8 +205,8 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { if(ioctl( d->handle, SNDCTL_DSP_SETFMT, & format )==-1) perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); - // qDebug("freq %d", d->frequency); + // odebug << "freq " << d->frequency << "" << oendl; if(ioctl( d->handle, SNDCTL_DSP_SPEED, &d->frequency )==-1) perror("ioctl(\"SNDCTL_DSP_SPEED\")"); - // qDebug("channels %d",d->channels); + // odebug << "channels " << d->channels << "" << oendl; if ( ioctl( d->handle, SNDCTL_DSP_CHANNELS, &d->channels ) == -1 ) { d->channels = ( d->channels == 1 ) ? 2 : d->channels; @@ -217,10 +221,10 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { d->can_GETOSPACE = TRUE; // until we find otherwise - //if ( chs != d->channels ) qDebug( "Wanted %d, got %d channels", chs, d->channels ); - //if ( f != d->frequency ) qDebug( "wanted %dHz, got %dHz", f, d->frequency ); - //if ( capabilities & DSP_CAP_BATCH ) qDebug( "Sound card has local buffer" ); - //if ( capabilities & DSP_CAP_REALTIME )qDebug( "Sound card has realtime sync" ); - //if ( capabilities & DSP_CAP_TRIGGER ) qDebug( "Sound card has precise trigger" ); - //if ( capabilities & DSP_CAP_MMAP ) qDebug( "Sound card can mmap" ); + //if ( chs != d->channels ) odebug << "Wanted " << chs << ", got " << d->channels << " channels" << oendl; + //if ( f != d->frequency ) odebug << "wanted " << f << "Hz, got " << d->frequency << "Hz" << oendl; + //if ( capabilities & DSP_CAP_BATCH ) odebug << "Sound card has local buffer" << oendl; + //if ( capabilities & DSP_CAP_REALTIME )odebug << "Sound card has realtime sync" << oendl; + //if ( capabilities & DSP_CAP_TRIGGER ) odebug << "Sound card has precise trigger" << oendl; + //if ( capabilities & DSP_CAP_MMAP ) odebug << "Sound card can mmap" << oendl; } @@ -228,5 +232,5 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { AudioDevice::~AudioDevice() { - // qDebug("destryo audiodevice"); + // odebug << "destryo audiodevice" << oendl; // QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; @@ -252,5 +256,5 @@ void AudioDevice::write( char *buffer, unsigned int length ) if ( t<0 ) t = 0; if ( t != (int)length) { - // qDebug("Ahhh!! memcpys 1"); + // odebug << "Ahhh!! memcpys 1" << oendl; memcpy(d->unwrittenBuffer,buffer+t,length-t); d->unwritten = length-t; @@ -315,5 +319,5 @@ int AudioDevice::bytesWritten() { int buffered = 0; if ( ioctl( d->handle, SNDCTL_DSP_GETODELAY, &buffered ) ) { - // qDebug( "failed to get audio device position" ); + // odebug << "failed to get audio device position" << oendl; return -1; } diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 7da2d54..376f8d3 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp @@ -18,12 +18,17 @@ ** **********************************************************************/ +#include "audiowidget.h" +#include "mediaplayerstate.h" + +/* OPIE */ #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/config.h> +#include <opie2/odebug.h> +/* QT */ #include <qdir.h> -#include "audiowidget.h" -#include "mediaplayerstate.h" +/* STD */ #include <stdlib.h> #include <stdio.h> @@ -72,5 +77,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : { setCaption( tr("OpiePlayer") ); - // qDebug("<<<<<audioWidget"); + // odebug << "<<<<<audioWidget" << oendl; Config cfg("OpiePlayer"); @@ -86,5 +91,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : skinPath = "opieplayer2/skins/default"; - // qDebug("skin path " + skinPath); + // odebug << "skin path " + skinPath << oendl; pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); @@ -122,5 +127,5 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : if( (width != pixBg->width() ) || (height != pixBg->height() ) ) { -// qDebug("<<<<<<<< scale image >>>>>>>>>>>>"); +// odebug << "<<<<<<<< scale image >>>>>>>>>>>>" << oendl; QImage img; img = pixBg->convertToImage(); @@ -254,5 +259,5 @@ void AudioWidget::sliderReleased() { void AudioWidget::setPosition( long i ) { -// qDebug("set position %d",i); +// odebug << "set position " << i << "" << oendl; long length = mediaPlayerState->length(); updateSlider( i, length ); @@ -368,5 +373,5 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { // if ( isOnButton && i == AudioVolumeUp ) -// qDebug("on up"); +// odebug << "on up" << oendl; if ( isOnButton && !audioButtons[i].isHeld ) { @@ -375,9 +380,9 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { switch (i) { case AudioVolumeUp: - // qDebug("more clicked"); + // odebug << "more clicked" << oendl; emit moreClicked(); return; case AudioVolumeDown: - // qDebug("less clicked"); + // odebug << "less clicked" << oendl; emit lessClicked(); return; @@ -471,5 +476,5 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) case Key_F9: //activity hide(); -// qDebug("Audio F9"); +// odebug << "Audio F9" << oendl; break; case Key_F10: //contacts diff --git a/core/multimedia/opieplayer/libmad/libmadplugin.cpp b/core/multimedia/opieplayer/libmad/libmadplugin.cpp index 1989b4a..428fc28 100644 --- a/core/multimedia/opieplayer/libmad/libmadplugin.cpp +++ b/core/multimedia/opieplayer/libmad/libmadplugin.cpp @@ -20,4 +20,16 @@ // largly modified by Maximilian Reiss <max.reiss@gmx.de> +#include "libmadplugin.h" + +/* OPIE */ +#include <qpe/config.h> +#include <opie2/odebug.h> + +/* QT */ +#include <qapplication.h> +#include <qmessagebox.h> +#include <qregexp.h> + +/* STD */ #include <stdio.h> #include <stdarg.h> @@ -35,10 +47,4 @@ #include <assert.h> -#include <qapplication.h> -#include <qmessagebox.h> -#include <qregexp.h> - -#include <qpe/config.h> - // for network handling #include <netinet/in.h> @@ -55,5 +61,4 @@ # include <sys/mman.h> #endif -#include "libmadplugin.h" @@ -383,5 +388,5 @@ int LibMadPlugin::http_open(const QString& path ) { if (len == -1) { - // qDebug( "http_open: "+ QString(strerror(errno)) +"\n"); + // odebug << "http_open: "+ QString(strerror(errno)) +"\n" << oendl; return 0; } @@ -397,5 +402,5 @@ int LibMadPlugin::http_open(const QString& path ) { /* This is shoutcast/icecast streaming */ if (strncmp(http_request + 4, "200 ", 4)) { - // qDebug("http_open: " + QString(http_request) + "\n"); + // odebug << "http_open: " + QString(http_request) + "\n" << oendl; return 0; } @@ -418,5 +423,5 @@ int LibMadPlugin::http_open(const QString& path ) { info = QString(name + genre + url + bitrate + message).replace( QRegExp("\n"), " : " ); - // qDebug("Stream info: " + info); + // odebug << "Stream info: " + info << oendl; return (tcp_sock); @@ -430,10 +435,10 @@ bool LibMadPlugin::open( const QString& path ) { cfg.setGroup("Options"); bufferSize = cfg.readNumEntry("MPeg_BufferSize",MPEG_BUFFER_SIZE); - // qDebug("buffer size is %d", bufferSize); + // odebug << "buffer size is " << bufferSize << "" << oendl; d->bad_last_frame = 0; d->flush = TRUE; info = QString( "" ); - //qDebug( "Opening %s", path.latin1() ); + //odebug << "Opening " << path << "" << oendl; if (path.left( 4 ) == "http" ) { @@ -451,5 +456,5 @@ bool LibMadPlugin::open( const QString& path ) { } if (d->input.fd == -1) { - // qDebug("error opening %s", d->input.path ); + // odebug << "error opening " << d->input.path << "" << oendl; return FALSE; } @@ -457,5 +462,5 @@ bool LibMadPlugin::open( const QString& path ) { struct stat stat; if (fstat(d->input.fd, &stat) == -1) { - // qDebug("error calling fstat"); return FALSE; + // odebug << "error calling fstat" << oendl; return FALSE; } if (S_ISREG(stat.st_mode) && stat.st_size > 0) @@ -469,5 +474,5 @@ bool LibMadPlugin::open( const QString& path ) { d->input.fdm = map_file(d->input.fd, &d->input.length); if (d->input.fdm == 0) { - // qDebug("error mmapping file"); return FALSE; + // odebug << "error mmapping file" << oendl; return FALSE; } d->input.data = (unsigned char *)d->input.fdm; @@ -478,5 +483,5 @@ bool LibMadPlugin::open( const QString& path ) { d->input.data = (unsigned char *)malloc( bufferSize /*MPEG_BUFFER_SIZE*/); if (d->input.data == 0) { - // qDebug("error allocating input buffer"); + // odebug << "error allocating input buffer" << oendl; return FALSE; } @@ -506,5 +511,5 @@ bool LibMadPlugin::close() { if (d->input.fdm) { if (unmap_file(d->input.fdm, d->input.length) == -1) { - // qDebug("error munmapping file"); + // odebug << "error munmapping file" << oendl; result = FALSE; } @@ -520,5 +525,5 @@ bool LibMadPlugin::close() { if (::close(d->input.fd) == -1) { - // qDebug("error closing file %s", d->input.path); + // odebug << "error closing file " << d->input.path << "" << oendl; result = FALSE; } @@ -546,5 +551,5 @@ int LibMadPlugin::audioChannels( int ) { /* long t; short t1[5]; audioReadSamples( t1, 2, 1, t, 0 ); - qDebug( "LibMadPlugin::audioChannels: %i", d->frame.header.mode > 0 ? 2 : 1 ); + odebug << "LibMadPlugin::audioChannels: " << d->frame.header.mode > 0 ? 2 : 1 << "" << oendl; return d->frame.header.mode > 0 ? 2 : 1; */ @@ -556,5 +561,5 @@ int LibMadPlugin::audioFrequency( int ) { debugMsg( "LibMadPlugin::audioFrequency" ); long t; short t1[5]; audioReadSamples( t1, 2, 1, t, 0 ); - // qDebug( "LibMadPlugin::audioFrequency: %i", d->frame.header.samplerate ); + // odebug << "LibMadPlugin::audioFrequency: " << d->frame.header.samplerate << "" << oendl; return d->frame.header.samplerate; } @@ -567,6 +572,5 @@ int LibMadPlugin::audioSamples( int ) { mad_header_decode( (struct mad_header *)&d->frame.header, &d->stream ); /* - qDebug( "LibMadPlugin::audioSamples: %i*%i", d->frame.header.duration.seconds, - d->frame.header.samplerate ); + odebug << "LibMadPlugin::audioSamples: " << d->frame.header.duration.seconds << "*" << d->frame.header.samplerate << oendl; return d->frame.header.duration.seconds * d->frame.header.samplerate; */ @@ -577,5 +581,5 @@ int LibMadPlugin::audioSamples( int ) { // qDebug( "LibMadPlugin::audioSamples: %i * %i * 8 / %i", (int)d->input.fileLength, // (int)d->frame.header.samplerate, (int)d->frame.header.bitrate ); - // qDebug( "LibMadPlugin::audioSamples: %i", samples ); + // odebug << "LibMadPlugin::audioSamples: " << samples << "" << oendl; return samples; @@ -593,5 +597,5 @@ bool LibMadPlugin::audioSetSample( long, int ) { // // Seek to requested position -// qDebug( "seek pos: %i", (int)((double)pos * d->input.fileLength / totalSamples) ); +// odebug << "seek pos: " << (int)((double)pos * d->input.fileLength / totalSamples) << "" << oendl; // ::lseek( d->input.fd, (long)((double)pos * d->input.fileLength / totalSamples), SEEK_SET ); // mad_stream_sync(&d->stream); @@ -681,5 +685,5 @@ bool LibMadPlugin::read() { if (len == -1) { - // qDebug("error reading audio"); + // odebug << "error reading audio" << oendl; return FALSE; } @@ -759,5 +763,5 @@ bool LibMadPlugin::decode( short *output, long samples, long& samplesMade ) { if ( d->stream.error == MAD_ERROR_BADCRC ) { mad_frame_mute(&d->frame); - // qDebug( "error decoding, bad crc" ); + // odebug << "error decoding, bad crc" << oendl; } } @@ -822,15 +826,15 @@ double LibMadPlugin::getTime() { void LibMadPlugin::printID3Tags() { - // qDebug( "LibMadPlugin::printID3Tags" ); + // odebug << "LibMadPlugin::printID3Tags" << oendl; char id3v1[128 + 1]; if ( ::lseek( d->input.fd, -128, SEEK_END ) == -1 ) { - // qDebug( "error seeking to id3 tags" ); + // odebug << "error seeking to id3 tags" << oendl; return; } if ( ::read( d->input.fd, id3v1, 128 ) != 128 ) { - // qDebug( "error reading in id3 tags" ); + // odebug << "error reading in id3 tags" << oendl; return; } @@ -842,5 +846,5 @@ void LibMadPlugin::printID3Tags() { QString label[5] = { tr( "Title" ), tr( "Artist" ), tr( "Album" ), tr( "Year" ), tr( "Comment" ) }; char *ptr = id3v1 + 3, *ptr2 = ptr + len[0]; - // qDebug( "ID3 tags in file:" ); + // odebug << "ID3 tags in file:" << oendl; info = ""; for ( int i = 0; i < 5; ptr += len[i], i++, ptr2 += len[i] ) { @@ -854,5 +858,5 @@ void LibMadPlugin::printID3Tags() { info += ( i != 0 ? ", " : "" ) + label[i] + ": " + ptr; } -// qDebug( info.latin1() ); +// odebug << info.latin1() << oendl; *ptr3 = push2; *ptr2 = push; @@ -863,5 +867,5 @@ void LibMadPlugin::printID3Tags() { if ( ::lseek(d->input.fd, 0, SEEK_SET) == -1 ) { - // qDebug( "error seeking back to beginning" ); + // odebug << "error seeking back to beginning" << oendl; return; } diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 4ed5921..91153fd 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp @@ -20,9 +20,22 @@ // L.J.Potter added changes Fri 02-15-2002 + +#include "mediaplayerstate.h" +#include "loopcontrol.h" +#include "videowidget.h" +#include "audiodevice.h" + +/* OPIE */ #include <qpe/qpeapplication.h> +#include <qpe/mediaplayerplugininterface.h> +#include <opie2/odebug.h> #ifdef Q_WS_QWS #include <qpe/qcopenvelope_qws.h> #endif + +/* QT */ + +/* STD */ #include <stdio.h> #include <stdlib.h> @@ -31,9 +44,4 @@ #include <errno.h> #include <unistd.h> -#include "loopcontrol.h" -#include "videowidget.h" -#include "audiodevice.h" -#include <qpe/mediaplayerplugininterface.h> -#include "mediaplayerstate.h" @@ -101,5 +109,5 @@ LoopControl::LoopControl( QObject *parent, const char *name ) isMuted = FALSE; connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); - //qDebug("starting loopcontrol"); + //odebug << "starting loopcontrol" << oendl; audioMutex = new Mutex; @@ -113,10 +121,10 @@ LoopControl::LoopControl( QObject *parent, const char *name ) pthread_attr_setschedparam(&audio_attr,¶ms); } else { - // qDebug( "Error setting up a realtime thread, reverting to using a normal thread." ); + // odebug << "Error setting up a realtime thread, reverting to using a normal thread." << oendl; pthread_attr_destroy(&audio_attr); pthread_attr_init(&audio_attr); } #endif - //qDebug("create audio thread"); + //odebug << "create audio thread" << oendl; pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); } @@ -154,5 +162,5 @@ void LoopControl::timerEvent( QTimerEvent *te ) { void LoopControl::setPosition( long pos ) { audioMutex->lock(); -// qDebug("Loop control %d", pos); +// odebug << "Loop control " << pos << "" << oendl; if ( hasVideoChannel && hasAudioChannel ) { playtime.restart(); @@ -229,5 +237,5 @@ void LoopControl::startAudio() { // if ( currentSample != audioSampleCounter + 1 ) -// qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); +// odebug << "out of sync with decoder " << currentSample << " " << audioSampleCounter << "" << oendl; long samplesRead = 0; @@ -242,5 +250,5 @@ void LoopControl::startAudio() { } else if ( sampleWaitTime <= -5000 ) { - // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); + // odebug << "need to catch up by: " << -sampleWaitTime << " (" << currentSample << "," << sampleWeShouldBeAt << ")" << oendl; // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); currentSample = sampleWeShouldBeAt; @@ -362,5 +370,5 @@ bool LoopControl::init( const QString& filename ) { current_frame = total_video_frames = total_audio_samples = 0; - // qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); + // odebug << "Using the " << mediaPlayerState->curDecoder()->pluginName() << " decoder" << oendl; // ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin @@ -388,5 +396,5 @@ bool LoopControl::init( const QString& filename ) { channels = mediaPlayerState->curDecoder()->audioChannels( astream ); - // qDebug( "LC- channels = %d", channels ); + // odebug << "LC- channels = " << channels << "" << oendl; // if ( !total_audio_samples ) @@ -394,9 +402,9 @@ bool LoopControl::init( const QString& filename ) { total_audio_samples += 1000; - // qDebug("total samples %d", total_audio_samples); + // odebug << "total samples " << total_audio_samples << "" << oendl; mediaPlayerState->setLength( total_audio_samples ); freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); - // qDebug( "LC- frequency = %d", freq ); + // odebug << "LC- frequency = " << freq << "" << oendl; audioSampleCounter = 0; @@ -404,5 +412,5 @@ bool LoopControl::init( const QString& filename ) { if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibWavPlugin") ) { bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); - // qDebug("using stupid hack"); + // odebug << "using stupid hack" << oendl; } else { bits_per_sample=0; @@ -452,5 +460,5 @@ bool LoopControl::init( const QString& filename ) { void LoopControl::play() { - // qDebug("LC- play"); + // odebug << "LC- play" << oendl; mediaPlayerState->setPosition( 0); //uglyhack diff --git a/core/multimedia/opieplayer/loopcontrol_threaded.cpp b/core/multimedia/opieplayer/loopcontrol_threaded.cpp index 0a1fc17..9a162c2 100644 --- a/core/multimedia/opieplayer/loopcontrol_threaded.cpp +++ b/core/multimedia/opieplayer/loopcontrol_threaded.cpp @@ -20,12 +20,26 @@ #define _REENTRANT +#include "mediaplayerplugininterface.h" +#include "loopcontrol.h" +#include "audiodevice.h" +#include "videowidget.h" +#include "audiowidget.h" +#include "mediaplayerstate.h" + +/* OPIE */ #include <qpe/qpeapplication.h> #include <qpe/custom.h> -#include <qimage.h> -#include <qpainter.h> + #if !defined(QT_NO_COP) #include <qpe/qcopenvelope_qws.h> #endif -#include "mediaplayerplugininterface.h" + +#include <opie2/odebug.h> + +/* QT */ +#include <qimage.h> +#include <qpainter.h> + +/* STD */ #include <stdio.h> #include <stdlib.h> @@ -34,12 +48,4 @@ #include <unistd.h> #include <pthread.h> -#include "loopcontrol.h" -#include "audiodevice.h" -#include "videowidget.h" -#include "audiowidget.h" -#include "mediaplayerstate.h" - - - @@ -192,5 +198,5 @@ void LoopControl::setPosition( long pos ) { videoMutex->lock(); audioMutex->lock(); - //qDebug("setting position"); + //odebug << "setting position" << oendl; playtime.restart(); playtime = playtime.addMSecs( -pos * 1000 / framerate ); @@ -293,5 +299,5 @@ void LoopControl::startVideo() { } while ( !done ); -// qDebug("elapsed: %i %i (%f)", int( playtime.elapsed() ), current_frame, framerate ); +// odebug << "elapsed: " << int( playtime.elapsed() ) << " " << current_frame << " (" << framerate << ")" << oendl; } else { @@ -308,5 +314,5 @@ void LoopControl::startVideo() { videoMutex->lock(); if ( current_frame > prev_frame + 1 ) { - // qDebug("skipped a frame"); + // odebug << "skipped a frame" << oendl; mediaPlayerState->curDecoder()->videoSetFrame( current_frame, stream ); } @@ -342,5 +348,5 @@ void LoopControl::startAudio() { // if ( currentSample != audioSampleCounter + 1 ) -// qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); +// odebug << "out of sync with decoder " << currentSample << " " << audioSampleCounter << "" << oendl; audioMutex->unlock(); @@ -366,10 +372,10 @@ void LoopControl::startAudio() { if ( sampleWaitTime >= 0 && sampleWaitTime <= 2000 ) { - //qDebug("sampleWaitTime: %i", sampleWaitTime); + //odebug << "sampleWaitTime: " << sampleWaitTime << "" << oendl; usleep( ( sampleWaitTime * 1000000 ) / ( freq ) ); } else { audioMutex->lock(); if ( sampleWaitTime <= -2000 ) { - // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); + // odebug << "need to catch up by: " << -sampleWaitTime << " (" << currentSample << "," << sampleWeShouldBeAt << ")" << oendl; mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); currentSample = sampleWeShouldBeAt; @@ -388,6 +394,6 @@ void LoopControl::startAudio() { emitChangePos = TRUE; - //qDebug("currentSample: %i audioSampleCounter: %i total_audio_samples: %i", currentSample, audioSampleCounter, total_audio_samples); -// qDebug("current: %i counter: %i total: %i", currentSample, audioSampleCounter, (int)total_audio_samples); + //odebug << "currentSample: " << currentSample << " audioSampleCounter: " << audioSampleCounter << " total_audio_samples: " << total_audio_samples << "" << oendl; +// odebug << "current: " << currentSample << " counter: " << audioSampleCounter << " total: " << (int)total_audio_samples << "" << oendl; moreAudio = audioSampleCounter <= total_audio_samples; @@ -402,5 +408,5 @@ void LoopControl::startAudio() { } - // qDebug( "End of file" ); + // odebug << "End of file" << oendl; if ( !moreVideo && !moreAudio ) @@ -416,5 +422,5 @@ void LoopControl::killTimers() { void *thread_result = 0; if ( pthread_join(video_tid,&thread_result) != 0 ) - // qDebug("thread join error 1"); + // odebug << "thread join error 1" << oendl; pthread_attr_destroy(&video_attr); } @@ -426,5 +432,5 @@ void LoopControl::killTimers() { void *thread_result = 0; if ( pthread_join(audio_tid,&thread_result) != 0 ) - // qDebug("thread join error 2"); + // odebug << "thread join error 2" << oendl; pthread_attr_destroy(&audio_attr); } @@ -448,5 +454,5 @@ void LoopControl::startTimers() { #ifdef USE_REALTIME_AUDIO_THREAD pthread_attr_setschedpolicy(&audio_attr,SCHED_RR); // Real-time round robin - //qDebug("min: %i, max: %i", sched_get_priority_min( SCHED_RR ), sched_get_priority_max( SCHED_RR ) ); + //odebug << "min: " << sched_get_priority_min( SCHED_RR ) << ", max: " << sched_get_priority_max( SCHED_RR ) << "" << oendl; sched_param params; params.sched_priority = 50; @@ -513,5 +519,5 @@ bool LoopControl::init( const QString& filename ) { current_frame = total_video_frames = total_audio_samples = 0; - // qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); + // odebug << "Using the " << mediaPlayerState->curDecoder()->pluginName() << " decoder" << oendl; // ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin diff --git a/core/multimedia/opieplayer/mediaplayer.cpp b/core/multimedia/opieplayer/mediaplayer.cpp index 6c743ec..15f6928 100644 --- a/core/multimedia/opieplayer/mediaplayer.cpp +++ b/core/multimedia/opieplayer/mediaplayer.cpp @@ -20,6 +20,4 @@ -#include <qmessagebox.h> - #include "mediaplayer.h" #include "playlistwidget.h" @@ -27,7 +25,11 @@ #include "loopcontrol.h" #include "audiodevice.h" - #include "mediaplayerstate.h" +/* OPIE */ +#include <opie2/odebug.h> + +/* QT */ +#include <qmessagebox.h> extern AudioWidget *audioUI; @@ -74,5 +76,5 @@ void MediaPlayer::play() { void MediaPlayer::setPlaying( bool play ) { - // qDebug("MediaPlayer setPlaying %d", play); + // odebug << "MediaPlayer setPlaying " << play << "" << oendl; if ( !play ) { mediaPlayerState->setPaused( FALSE ); @@ -85,5 +87,5 @@ void MediaPlayer::setPlaying( bool play ) { return; } - // qDebug("about to ctrash"); + // odebug << "about to ctrash" << oendl; const DocLnk *playListCurrent = playList->current(); @@ -192,5 +194,5 @@ void MediaPlayer::stopChangingVolume() { void MediaPlayer::timerEvent( QTimerEvent * ) { -// qDebug("timer"); +// odebug << "timer" << oendl; if ( volumeDirection == +1 ) AudioDevice::increaseVolume(); @@ -204,5 +206,5 @@ void MediaPlayer::timerEvent( QTimerEvent * ) { if ( drawnOnScreenDisplay && onScreenDisplayVolume == v ) { -// qDebug("returning %d, %d, %d, %d", v, l, r, m); +// odebug << "returning " << v << ", " << l << ", " << r << ", " << m << "" << oendl; return; } @@ -250,5 +252,5 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { break; case Key_F12: //home - // qDebug("Blank here"); + // odebug << "Blank here" << oendl; break; case Key_F13: //mail diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp index 5bfb87e..b700cd1 100644 --- a/core/multimedia/opieplayer/mediaplayerstate.cpp +++ b/core/multimedia/opieplayer/mediaplayerstate.cpp @@ -18,12 +18,4 @@ ** **********************************************************************/ -#include <qpe/qpeapplication.h> -#include <qpe/qlibrary.h> -#include <qpe/config.h> -#include <qdir.h> -#include <qpe/mediaplayerplugininterface.h> -#include "mediaplayerstate.h" - - #ifdef QT_NO_COMPONENT @@ -34,4 +26,16 @@ #endif +#include "mediaplayerstate.h" + +/* OPIE */ +#include <qpe/qpeapplication.h> +#include <qpe/qlibrary.h> +#include <qpe/config.h> +#include <qpe/mediaplayerplugininterface.h> +#include <opie2/odebug.h> + +/* QT */ +#include <qdir.h> + //#define MediaPlayerDebug(x) qDebug x @@ -126,5 +130,5 @@ MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { void MediaPlayerState::loadPlugins() { - // qDebug("load plugins"); + // odebug << "load plugins" << oendl; #ifndef QT_NO_COMPONENT QValueList<MediaPlayerPlugin>::Iterator mit; @@ -143,9 +147,9 @@ void MediaPlayerState::loadPlugins() { MediaPlayerPluginInterface *iface = 0; QLibrary *lib = new QLibrary( path + "/" + *it ); -// qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); +// odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl; if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { -// qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); +// odebug << "loading: " << QString( path + "/" + *it ) << "" << oendl; MediaPlayerPlugin plugin; diff --git a/core/multimedia/opieplayer/modplug/memfile.cpp b/core/multimedia/opieplayer/modplug/memfile.cpp index 8a29997..cd243c7 100644 --- a/core/multimedia/opieplayer/modplug/memfile.cpp +++ b/core/multimedia/opieplayer/modplug/memfile.cpp @@ -20,4 +20,8 @@ #include "memfile.h" +/* OPIE */ +#include <opie2/odebug.h> + +/* STD */ #include <unistd.h> #include <sys/mman.h> @@ -67,5 +71,5 @@ QByteArray &MemFile::data() } else - qDebug( "MemFile: mmap() failed!" ); + odebug << "MemFile: mmap() failed!" << oendl; // fallback #endif diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp index ae89518..95ed03c 100644 --- a/core/multimedia/opieplayer/om3u.cpp +++ b/core/multimedia/opieplayer/om3u.cpp @@ -32,4 +32,6 @@ #include "om3u.h" +/* OPIE */ +#include <opie2/odebug.h> @@ -45,5 +47,5 @@ static inline QString fullBaseName ( const QFileInfo &fi ) Om3u::Om3u( const QString &filePath, int mode) : QStringList (){ -//qDebug("<<<<<<<new m3u "+filePath); +//odebug << "<<<<<<<new m3u "+filePath << oendl; f.setName(filePath); f.open(mode); @@ -53,5 +55,5 @@ Om3u::~Om3u(){} void Om3u::readM3u() { -// qDebug("<<<<<<reading m3u "+f.name()); +// odebug << "<<<<<<reading m3u "+f.name() << oendl; QTextStream t(&f); t.setEncoding(QTextStream::UnicodeUTF8); @@ -59,5 +61,5 @@ void Om3u::readM3u() { while ( !t.atEnd() ) { s=t.readLine(); - // qDebug(s); + // odebug << s << oendl; if( s.find( "#", 0, TRUE) == -1 ) { if( s.left(2) == "E:" || s.left(2) == "P:" ) { @@ -68,5 +70,5 @@ void Om3u::readM3u() { s=s.replace( QRegExp( "\\" ), "/" ); append(s); - // qDebug(s); + // odebug << s << oendl; } else { // is url s.replace( QRegExp( "%20" )," " ); @@ -78,5 +80,5 @@ void Om3u::readM3u() { // } append(name); - // qDebug(name); + // odebug << name << oendl; } } @@ -93,5 +95,5 @@ void Om3u::readPls() { //it's a pls file s = s.right( s.length() - 6 ); s.replace( QRegExp( "%20" )," "); -// qDebug( "adding " + s + " to playlist" ); +// odebug << "adding " + s + " to playlist" << oendl; // numberofentries=2 // File1=http @@ -127,5 +129,5 @@ void Om3u::write() { //writes list to m3u file if(count()>0) { for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { - // qDebug(*it); + // odebug << *it << oendl; t << *it << "\n"; } @@ -143,5 +145,5 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { currentFile=*it; - // qDebug(*it); + // odebug << *it << oendl; if( filePath != currentFile) diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index ad831cf..58c3966 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp @@ -19,8 +19,13 @@ **********************************************************************/ -#include <qheader.h> - #include "playlistselection.h" +/* OPIE */ +#include <opie2/odebug.h> + +/* QT */ +#include <qheader.h> + +/* STD */ #include <stdlib.h> @@ -45,5 +50,5 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) : QListView( parent, name ) { -// qDebug("starting playlistselector"); +// odebug << "starting playlistselector" << oendl; // #ifdef USE_PLAYLIST_BACKGROUND // setStaticBackground( TRUE ); @@ -67,5 +72,5 @@ PlayListSelection::~PlayListSelection() { // #ifdef USE_PLAYLIST_BACKGROUND void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { -// qDebug("drawBackground"); +// odebug << "drawBackground" << oendl; p->fillRect( r, QBrush( white ) ); // QImage logo = Resource::loadImage( "launcher/opielogo" ); @@ -187,5 +192,5 @@ void PlayListSelection::writeCurrent( Config& cfg ) { if ( item ) cfg.writeEntry("current", item->text(0) ); - // qDebug(item->text(0)); + // odebug << item->text(0) << oendl; } @@ -196,7 +201,7 @@ void PlayListSelection::setSelectedItem(const QString &strk ) { QListViewItemIterator it( this ); for ( ; it.current(); ++it ) { -// qDebug( it.current()->text(0)); +// odebug << it.current()->text(0) << oendl; if( strk == it.current()->text(0)) { -// qDebug( "We have a match "+strk); +// odebug << "We have a match "+strk << oendl; setSelected( it.current(), TRUE); ensureItemVisible( it.current() ); diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 3609f5d..d85ce50 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -21,23 +21,25 @@ #define QTOPIA_INTERNAL_FSLP -#include <qtoolbar.h> +#include "playlistselection.h" +#include "playlistwidget.h" +#include "mediaplayerstate.h" +#include "inputDialog.h" +#include "audiowidget.h" +#include "videowidget.h" + +/* OPIE */ #include <qpe/qpemenubar.h> #include <qpe/lnkproperties.h> +#include <opie2/odebug.h> +/* QT */ +#include <qtoolbar.h> #include <qaction.h> #include <qlayout.h> #include <qmessagebox.h> - //#include <qtimer.h> -#include "playlistselection.h" -#include "playlistwidget.h" -#include "mediaplayerstate.h" - -#include "inputDialog.h" - +/* STD */ #include <stdlib.h> -#include "audiowidget.h" -#include "videowidget.h" #include <unistd.h> @@ -390,5 +392,5 @@ void PlayListWidget::writeConfig( Config& cfg ) const { QString entryName; entryName.sprintf( "File%i", noOfFiles + 1 ); -// qDebug(entryName); +// odebug << entryName << oendl; cfg.writeEntry( entryName, lnk->linkFile() ); // if this link does exist, add it so we have the file @@ -484,5 +486,5 @@ void PlayListWidget::setDocument(const QString& fileref) { void PlayListWidget::setDocumentEx(const QString& fileref) { - qDebug("opieplayer receive "+fileref); + odebug << "opieplayer receive "+fileref << oendl; clearList(); DocLnk lnk; @@ -493,5 +495,5 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { return; } - // qDebug("<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref); + // odebug << "<<<<<<<<<<<<<<<<<<<<<<setDocument "+fileref << oendl; QString extension = fileInfo.extension(false); if( extension.find( "m3u", 0, false) != -1) { //is m3u @@ -535,5 +537,5 @@ void PlayListWidget::setDocumentEx(const QString& fileref) { void PlayListWidget::setActiveWindow() { - // qDebug("SETTING active window"); + // odebug << "SETTING active window" << oendl; // When we get raised we need to ensure that it switches views char origView = mediaPlayerState->view(); @@ -552,5 +554,5 @@ const DocLnk *PlayListWidget::current() { // this is fugly case 0: //playlist { - // qDebug("playlist"); + // odebug << "playlist" << oendl; if ( mediaPlayerState->playlist() ) { return d->selectedFiles->current(); @@ -565,5 +567,5 @@ const DocLnk *PlayListWidget::current() { // this is fugly case 1://audio { - // qDebug("audioView"); + // odebug << "audioView" << oendl; QListIterator<DocLnk> dit( files.children() ); for ( ; dit.current(); ++dit ) { @@ -661,9 +663,9 @@ void PlayListWidget::saveList() { void PlayListWidget::loadList( const DocLnk & lnk) { QString name = lnk.name(); - // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); + // odebug << "<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name << oendl; if( name.length()>0) { setCaption("OpiePlayer: "+name); - // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); + // odebug << "<<<<<<<<<<<<load list "+ lnk.file() << oendl; clearList(); readm3u(lnk.file()); @@ -819,5 +821,5 @@ void PlayListWidget::btnPlay(bool b) { mediaPlayerState->setPlaying(b); insanityBool=FALSE; - qDebug("insanity"); + odebug << "insanity" << oendl; // } } @@ -952,5 +954,5 @@ void PlayListWidget::listDelete() { void PlayListWidget::scanForAudio() { - // qDebug("scan for audio"); + // odebug << "scan for audio" << oendl; files.detachChildren(); QListIterator<DocLnk> sdit( files.children() ); @@ -962,5 +964,5 @@ void PlayListWidget::scanForAudio() { } void PlayListWidget::scanForVideo() { - // qDebug("scan for video"); + // odebug << "scan for video" << oendl; vFiles.detachChildren(); QListIterator<DocLnk> sdit( vFiles.children() ); @@ -997,5 +999,5 @@ void PlayListWidget::populateAudioView() { else size = QFile( dit.current()->file() ).size(); - // qDebug(dit.current()->name()); + // odebug << dit.current()->name() << oendl; newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number(size ), storage, dit.current()->file()); @@ -1041,5 +1043,5 @@ void PlayListWidget::openFile() { if( fileDlg->result() == 1 ) { filename = fileDlg->text(); - // qDebug( "Selected filename is " + filename ); + // odebug << "Selected filename is " + filename << oendl; DocLnk lnk; Config cfg( "OpiePlayer" ); @@ -1086,5 +1088,5 @@ void PlayListWidget::openFile() { reads m3u and shows files/urls to playlist widget */ void PlayListWidget::readm3u( const QString &filename ) { - // qDebug( "read m3u filename " + filename ); + // odebug << "read m3u filename " + filename << oendl; Om3u *m3uList; @@ -1095,5 +1097,5 @@ void PlayListWidget::readm3u( const QString &filename ) { for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { s = *it; - // qDebug("reading "+ s); + // odebug << "reading "+ s << oendl; if(s.left(4)=="http") { lnk.setName( s ); //sets file name @@ -1112,9 +1114,9 @@ void PlayListWidget::readm3u( const QString &filename ) { // if(s.right(4) == '.') {//if regular file if(s.left(1) != "/") { - // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s); + // odebug << "set link "+QFileInfo(filename).dirPath()+"/"+s << oendl; lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); lnk.setIcon("SoundPlayer"); } else { - // qDebug("set link2 "+s); + // odebug << "set link2 "+s << oendl; lnk.setFile( s); lnk.setIcon("SoundPlayer"); @@ -1143,5 +1145,5 @@ reads pls and adds files/urls to playlist */ void PlayListWidget::readPls( const QString &filename ) { - // qDebug( "pls filename is " + filename ); + // odebug << "pls filename is " + filename << oendl; Om3u *m3uList; QString s, name; @@ -1186,5 +1188,5 @@ void PlayListWidget::readPls( const QString &filename ) { writes current playlist to current m3u file */ void PlayListWidget::writeCurrentM3u() { - // qDebug("writing to current m3u"); + // odebug << "writing to current m3u" << oendl; Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); @@ -1195,9 +1197,9 @@ void PlayListWidget::writeCurrentM3u() { if( d->selectedFiles->first()) { do { - // qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); + // odebug << "writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; m3uList->add( d->selectedFiles->current()->file() ); } while ( d->selectedFiles->next() ); - // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); + // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; m3uList->write(); m3uList->close(); @@ -1218,5 +1220,5 @@ void PlayListWidget::writem3u() { if( fileDlg->result() == 1 ) { name = fileDlg->text(); - // qDebug( filename ); + // odebug << filename << oendl; if( name.find("/",0,true) != -1) {// assume they specify a file path filename = name; @@ -1236,5 +1238,5 @@ void PlayListWidget::writem3u() { } while ( d->selectedFiles->next() ); - // qDebug( list ); + // odebug << list << oendl; m3uList->write(); m3uList->close(); @@ -1248,5 +1250,5 @@ void PlayListWidget::writem3u() { lnk.setName( name); //sets file name - // qDebug(filename); + // odebug << filename << oendl; Config config( "OpiePlayer" ); config.setGroup( "PlayList" ); @@ -1256,5 +1258,5 @@ void PlayListWidget::writem3u() { if(!lnk.writeLink()) { - // qDebug("Writing doclink did not work"); + // odebug << "Writing doclink did not work" << oendl; } @@ -1292,5 +1294,5 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) break; // case Key_P: //play -// qDebug("Play"); +// odebug << "Play" << oendl; // playSelected(); // break; @@ -1326,9 +1328,9 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) void PlayListWidget::keyPressEvent( QKeyEvent *) { -// qDebug("Key press"); +// odebug << "Key press" << oendl; // switch ( e->key() ) { // ////////////////////////////// Zaurus keys // case Key_A: //add to playlist -// qDebug("Add"); +// odebug << "Add" << oendl; // addSelected(); // break; @@ -1337,9 +1339,9 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) // break; // case Key_P: //play -// qDebug("Play"); +// odebug << "Play" << oendl; // playSelected(); // break; // case Key_Space: -// qDebug("Play"); +// odebug << "Play" << oendl; // playSelected(); // break; @@ -1348,5 +1350,5 @@ void PlayListWidget::keyPressEvent( QKeyEvent *) void PlayListWidget::doBlank() { - // qDebug("do blanking"); + // odebug << "do blanking" << oendl; #ifdef QT_QWS_DEVFS fd=open("/dev/fb/0",O_RDWR); @@ -1364,5 +1366,5 @@ void PlayListWidget::doUnblank() { // int fd; // fd=open("/dev/fb0",O_RDWR); - // qDebug("do unblanking"); + // odebug << "do unblanking" << oendl; if (fd != -1) { ioctl(fd,FBIOBLANK,0); @@ -1389,5 +1391,5 @@ void PlayListWidget::populateSkinsMenu() { while ( ( fi = it.current() ) ) { skinName = fi->fileName(); - // qDebug( fi->fileName() ); + // odebug << fi->fileName() << oendl; if( skinName != "." && skinName != ".." && skinName !="CVS" ) { item = skinsMenu->insertItem( fi->fileName() ) ; @@ -1415,5 +1417,5 @@ void PlayListWidget::skinsMenuActivated( int item ) { void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { - // qDebug("qcop message "+msg ); + // odebug << "qcop message "+msg << oendl; QDataStream stream ( data, IO_ReadOnly ); if ( msg == "play()" ) { //plays current selection diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index 164458b..e851044 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp @@ -18,13 +18,18 @@ ** **********************************************************************/ + +#include "videowidget.h" +#include "mediaplayerstate.h" + +/* OPIE */ #include <qpe/resource.h> #include <qpe/mediaplayerplugininterface.h> #include <qpe/config.h> #include <qpe/qpeapplication.h> +#include <opie2/odebug.h> +/* QT */ #include <qdir.h> #include <qslider.h> -#include "videowidget.h" -#include "mediaplayerstate.h" @@ -83,5 +88,5 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : skinPath = "opieplayer2/skins/default"; - // qDebug("skin path " + skinPath); + // odebug << "skin path " + skinPath << oendl; // QString skinPath = "opieplayer2/skins/" + skin; @@ -97,5 +102,5 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skinV_mask_" + skinV_mask_file_names[i] + ".png" ); - // qDebug("loading "+filename); + // odebug << "loading "+filename << oendl; masks[i] = new QBitmap( filename ); @@ -112,5 +117,5 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : } } - // qDebug("finished loading first pics"); + // odebug << "finished loading first pics" << oendl; for ( int i = 0; i < 7; i++ ) { buttonPixUp[i] = NULL; @@ -124,5 +129,5 @@ VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) : if( (width != pixBg->width() ) || (height != pixBg->height() ) ) { -// qDebug("<<<<<<<< scale image >>>>>>>>>>>>"); +// odebug << "<<<<<<<< scale image >>>>>>>>>>>>" << oendl; QImage img; img = pixBg->convertToImage(); @@ -354,5 +359,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { case VideoPlay: { - // qDebug("play"); + // odebug << "play" << oendl; if( !mediaPlayerState->playing()) { mediaPlayerState->setPlaying( true); @@ -362,10 +367,10 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { } if( mediaPlayerState->isPaused ) { - // qDebug("isPaused"); + // odebug << "isPaused" << oendl; setToggleButton( i, FALSE ); mediaPlayerState->setPaused( FALSE ); return; } else if( !mediaPlayerState->isPaused ) { - // qDebug("is not paused"); + // odebug << "is not paused" << oendl; setToggleButton( i, TRUE ); mediaPlayerState->setPaused( TRUE ); @@ -459,5 +464,5 @@ void VideoWidget::closeEvent( QCloseEvent* ) { bool VideoWidget::playVideo() { bool result = FALSE; -// qDebug("<<<<<<<<<<<<<<<< play video"); +// odebug << "<<<<<<<<<<<<<<<< play video" << oendl; int stream = 0; diff --git a/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp b/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp index 53c4b2b..0002213 100644 --- a/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp +++ b/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp @@ -20,4 +20,13 @@ // fixed and adapted for opieplayer 2003 ljp <llornkcor@handhelds.org> +#include "libtremorplugin.h" + +/* OPIE */ +#include <opie2/odebug.h> + +/* QT */ +#include <qmap.h> + +/* STD */ #include <stdio.h> #include <stdarg.h> @@ -34,8 +43,4 @@ #include <assert.h> -#include <qmap.h> - -#include "libtremorplugin.h" - extern "C" { @@ -63,5 +68,5 @@ public: LibTremorPlugin::LibTremorPlugin() { -qDebug("<<<<<<<<<<<<<TREMOR!!!!!>>>>>>>>>>>>>>>>>>"); +odebug << "<<<<<<<<<<<<<TREMOR!!!!!>>>>>>>>>>>>>>>>>>" << oendl; d = new LibTremorPluginData; d->f = 0; @@ -106,10 +111,10 @@ bool LibTremorPlugin::open( const QString& path ) { d->f = fopen( d->filename, "r" ); if (d->f == 0) { - qDebug("error opening %s", d->filename ); + odebug << "error opening " << d->filename << "" << oendl; return FALSE; } if (ov_open(d->f, &d->vf, NULL, 0) < 0) { - qDebug("error opening %s", d->filename); + odebug << "error opening " << d->filename << "" << oendl; return FALSE; } @@ -154,5 +159,5 @@ bool LibTremorPlugin::open( const QString& path ) { } - qDebug("finfo: " + d->finfo); + odebug << "finfo: " + d->finfo << oendl; return TRUE; @@ -166,5 +171,5 @@ bool LibTremorPlugin::close() { if (fclose(d->f) == -1) { - qDebug("error closing file %s", d->filename); + odebug << "error closing file " << d->filename << "" << oendl; result = FALSE; } @@ -194,5 +199,5 @@ int LibTremorPlugin::audioStreams() { int LibTremorPlugin::audioChannels( int ) { - qDebug( "LibTremorPlugin::audioChannels: %i", d->vi->channels ); + odebug << "LibTremorPlugin::audioChannels: " << d->vi->channels << "" << oendl; return d->vi->channels; } @@ -200,5 +205,5 @@ int LibTremorPlugin::audioChannels( int ) { int LibTremorPlugin::audioFrequency( int ) { - qDebug( "LibTremorPlugin::audioFrequency: %ld", d->vi->rate ); + odebug << "LibTremorPlugin::audioFrequency: " << d->vi->rate << "" << oendl; return d->vi->rate; } @@ -224,5 +229,5 @@ long LibTremorPlugin::audioGetSample( int ) { bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long& samplesMade, int ) { -// qDebug( "<<<<<<<<<<<<LibTremorPlugin::audioReadStereoSamples %d", samples ); +// odebug << "<<<<<<<<<<<<LibTremorPlugin::audioReadStereoSamples " << samples << "" << oendl; int old_section = d->csection; @@ -246,5 +251,5 @@ bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long& long ret = ov_read(&d->vf, buf, n, &d->csection); -// qDebug("%d", ret); +// odebug << "" << ret << "" << oendl; if (ret == 0) { break; 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 @@ -20,4 +20,14 @@ // L.J.Potter added changes Fri 02-15-2002 + +#include "wavplugin.h" + +/* OPIE */ +#include <opie2/odebug.h> + +/* QT */ +#include <qfile.h> + +/* STD */ #include <stdio.h> #include <stdarg.h> @@ -25,6 +35,4 @@ #include <errno.h> #include <unistd.h> -#include <qfile.h> -#include "wavplugin.h" //#define debugMsg(a) qDebug(a) @@ -77,5 +85,5 @@ public: if ( input == 0 ) { - qDebug("no input"); + odebug << "no input" << oendl; return FALSE; } @@ -84,5 +92,5 @@ public: int l,r; if ( getSample(l, r) == FALSE ) { - qDebug("didn't get sample"); + odebug << "didn't get sample" << oendl; return FALSE; } @@ -136,5 +144,5 @@ public: #define WAVE_FORMAT_PCM 1 if ( chunkdata.formatTag != WAVE_FORMAT_PCM ) { - qDebug("WAV file: UNSUPPORTED FORMAT %d",chunkdata.formatTag); + odebug << "WAV file: UNSUPPORTED FORMAT " << chunkdata.formatTag << "" << oendl; return FALSE; } @@ -146,5 +154,5 @@ public: } } // while - qDebug("bits %d", chunkdata.wBitsPerSample); + odebug << "bits " << chunkdata.wBitsPerSample << "" << oendl; return TRUE; } @@ -208,5 +216,5 @@ WavPlugin::~WavPlugin() { bool WavPlugin::isFileSupported( const QString& path ) { -// qDebug( "WavPlugin::isFileSupported" ); +// odebug << "WavPlugin::isFileSupported" << oendl; char *ext = strrchr( path.latin1(), '.' ); @@ -227,5 +235,5 @@ bool WavPlugin::isFileSupported( const QString& path ) { bool WavPlugin::open( const QString& path ) { -// qDebug( "WavPlugin::open" ); +// odebug << "WavPlugin::open" << oendl; d->max = d->out = sound_buffer_size; @@ -235,5 +243,5 @@ bool WavPlugin::open( const QString& path ) { d->input = new QFile( path ); if ( d->input->open(IO_ReadOnly) == FALSE ) { - qDebug("couldn't open file"); + odebug << "couldn't open file" << oendl; delete d->input; d->input = 0; @@ -249,5 +257,5 @@ bool WavPlugin::open( const QString& path ) { bool WavPlugin::close() { -// qDebug( "WavPlugin::close" ); +// odebug << "WavPlugin::close" << oendl; d->input->close(); @@ -259,5 +267,5 @@ bool WavPlugin::close() { bool WavPlugin::isOpen() { -// qDebug( "WavPlugin::isOpen" ); +// odebug << "WavPlugin::isOpen" << oendl; return ( d->input != 0 ); } @@ -265,5 +273,5 @@ bool WavPlugin::isOpen() { int WavPlugin::audioStreams() { -// qDebug( "WavPlugin::audioStreams" ); +// odebug << "WavPlugin::audioStreams" << oendl; return 1; } @@ -271,5 +279,5 @@ int WavPlugin::audioStreams() { int WavPlugin::audioChannels( int ) { -// qDebug( "WavPlugin::audioChannels" ); +// odebug << "WavPlugin::audioChannels" << oendl; return d->chunkdata.channels;// 2; // ### Always scale audio to stereo samples } @@ -277,5 +285,5 @@ int WavPlugin::audioChannels( int ) { int WavPlugin::audioFrequency( int ) { -// qDebug( "WavPlugin::audioFrequency %d", d->chunkdata.samplesPerSec ); +// odebug << "WavPlugin::audioFrequency " << d->chunkdata.samplesPerSec << "" << oendl; return d->chunkdata.samplesPerSec; //44100; // ### Always scale to frequency of 44100 } @@ -283,5 +291,5 @@ int WavPlugin::audioFrequency( int ) { int WavPlugin::audioSamples( int ) { -// qDebug( "WavPlugin::audioSamples" ); +// odebug << "WavPlugin::audioSamples" << oendl; 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 @@ -290,5 +298,5 @@ int WavPlugin::audioSamples( int ) { bool WavPlugin::audioSetSample( long, int ) { -// qDebug( "WavPlugin::audioSetSample" ); +// odebug << "WavPlugin::audioSetSample" << oendl; return FALSE; } @@ -296,5 +304,5 @@ bool WavPlugin::audioSetSample( long, int ) { long WavPlugin::audioGetSample( int ) { -// qDebug( "WavPlugin::audioGetSample" ); +// odebug << "WavPlugin::audioGetSample" << oendl; return 0; } @@ -326,15 +334,15 @@ bool WavPlugin::audioReadStereoSamples( short *output, long samples, long& sampl bool WavPlugin::audioReadSamples( short *output, int channels, long samples, long& samplesMade, int ) { -// qDebug( "WavPlugin::audioReadSamples" ); +// odebug << "WavPlugin::audioReadSamples" << oendl; return d->add( output, samples, samplesMade, channels != 1 ); } double WavPlugin::getTime() { -// qDebug( "WavPlugin::getTime" ); //this is a stupid hack here!! +// odebug << "WavPlugin::getTime" << oendl; //this is a stupid hack here!! return d->chunkdata.wBitsPerSample; /*0.0*/; } // int WavPlugin::audioBitsPerSample( int ) { -// // qDebug( "WavPlugin::audioFormat %d", d->chunkdata.wBitsPerSample ); +// // odebug << "WavPlugin::audioFormat " << d->chunkdata.wBitsPerSample << "" << oendl; // return d->chunkdata.wBitsPerSample; // // } |