Diffstat (limited to 'core/multimedia/opieplayer/vorbis') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/vorbis/libtremorplugin.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
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 @@ -14,34 +14,39 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ****************************************************************************/ // 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> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <time.h> #include <locale.h> #include <math.h> #include <assert.h> -#include <qmap.h> - -#include "libtremorplugin.h" - extern "C" { #include "tremor/ivorbisfile.h" } #define MPEG_BUFFER_SIZE 65536 //#define debugMsg(a) qDebug(a) @@ -57,17 +62,17 @@ public: vorbis_comment* vc; bool bos; int csection; QString finfo; }; LibTremorPlugin::LibTremorPlugin() { -qDebug("<<<<<<<<<<<<<TREMOR!!!!!>>>>>>>>>>>>>>>>>>"); +odebug << "<<<<<<<<<<<<<TREMOR!!!!!>>>>>>>>>>>>>>>>>>" << oendl; d = new LibTremorPluginData; d->f = 0; d->vi = 0; d->vc = 0; d->bos = 0; d->csection = 0; d->finfo = ""; } @@ -100,22 +105,22 @@ bool LibTremorPlugin::isFileSupported( const QString& path ) { bool LibTremorPlugin::open( const QString& path ) { debugMsg( "LibTremorPlugin::open" ); d->filename = (char*) path.latin1(); 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; } d->vc = ov_comment(&d->vf, -1); d->vi = ov_info(&d->vf, -1); d->bos = false; QString comments[] = { "title", "artist", "album", "year", "tracknumber", "" }; @@ -148,29 +153,29 @@ bool LibTremorPlugin::open( const QString& path ) { if (!d->finfo.isEmpty()) { d->finfo += ", "; } d->finfo += cdescr[i] + ": " + v; } } - qDebug("finfo: " + d->finfo); + odebug << "finfo: " + d->finfo << oendl; return TRUE; } bool LibTremorPlugin::close() { debugMsg( "LibTremorPlugin::close" ); int result = TRUE; if (fclose(d->f) == -1) { - qDebug("error closing file %s", d->filename); + odebug << "error closing file " << d->filename << "" << oendl; result = FALSE; } d->f = 0; d->finfo = ""; return result; } @@ -188,23 +193,23 @@ const QString &LibTremorPlugin::fileInfo() { int LibTremorPlugin::audioStreams() { debugMsg( "LibTremorPlugin::audioStreams" ); return 1; } int LibTremorPlugin::audioChannels( int ) { - qDebug( "LibTremorPlugin::audioChannels: %i", d->vi->channels ); + odebug << "LibTremorPlugin::audioChannels: " << d->vi->channels << "" << oendl; return d->vi->channels; } int LibTremorPlugin::audioFrequency( int ) { - qDebug( "LibTremorPlugin::audioFrequency: %ld", d->vi->rate ); + odebug << "LibTremorPlugin::audioFrequency: " << d->vi->rate << "" << oendl; return d->vi->rate; } int LibTremorPlugin::audioSamples( int ) { debugMsg( "LibTremorPlugin::audioSamples" ); return (int) ov_pcm_total(&d->vf,-1); } @@ -218,17 +223,17 @@ bool LibTremorPlugin::audioSetSample( long, int ) { long LibTremorPlugin::audioGetSample( int ) { debugMsg( "LibTremorPlugin::audioGetSample" ); return 0; } 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; char* buf = (char*) output; int length = samples * 4; if ( samples == 0 ) return false; @@ -240,17 +245,17 @@ bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long& } int n = 4096; if (length < n) { n = length; } long ret = ov_read(&d->vf, buf, n, &d->csection); -// qDebug("%d", ret); +// odebug << "" << ret << "" << oendl; if (ret == 0) { break; } else if (ret < 0) { return true; } if (old_section != d->csection) { d->bos = true; |