summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/vorbis/libtremorplugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/vorbis/libtremorplugin.cpp31
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
@@ -19,6 +19,15 @@
19****************************************************************************/ 19****************************************************************************/
20// fixed and adapted for opieplayer 2003 ljp <llornkcor@handhelds.org> 20// fixed and adapted for opieplayer 2003 ljp <llornkcor@handhelds.org>
21 21
22#include "libtremorplugin.h"
23
24/* OPIE */
25#include <opie2/odebug.h>
26
27/* QT */
28#include <qmap.h>
29
30/* STD */
22#include <stdio.h> 31#include <stdio.h>
23#include <stdarg.h> 32#include <stdarg.h>
24#include <stdlib.h> 33#include <stdlib.h>
@@ -33,10 +42,6 @@
33#include <math.h> 42#include <math.h>
34#include <assert.h> 43#include <assert.h>
35 44
36#include <qmap.h>
37
38#include "libtremorplugin.h"
39
40 45
41extern "C" { 46extern "C" {
42#include "tremor/ivorbisfile.h" 47#include "tremor/ivorbisfile.h"
@@ -62,7 +67,7 @@ public:
62 67
63 68
64LibTremorPlugin::LibTremorPlugin() { 69LibTremorPlugin::LibTremorPlugin() {
65qDebug("<<<<<<<<<<<<<TREMOR!!!!!>>>>>>>>>>>>>>>>>>"); 70odebug << "<<<<<<<<<<<<<TREMOR!!!!!>>>>>>>>>>>>>>>>>>" << oendl;
66 d = new LibTremorPluginData; 71 d = new LibTremorPluginData;
67 d->f = 0; 72 d->f = 0;
68 d->vi = 0; 73 d->vi = 0;
@@ -105,12 +110,12 @@ bool LibTremorPlugin::open( const QString& path ) {
105 d->filename = (char*) path.latin1(); 110 d->filename = (char*) path.latin1();
106 d->f = fopen( d->filename, "r" ); 111 d->f = fopen( d->filename, "r" );
107 if (d->f == 0) { 112 if (d->f == 0) {
108 qDebug("error opening %s", d->filename ); 113 odebug << "error opening " << d->filename << "" << oendl;
109 return FALSE; 114 return FALSE;
110 } 115 }
111 116
112 if (ov_open(d->f, &d->vf, NULL, 0) < 0) { 117 if (ov_open(d->f, &d->vf, NULL, 0) < 0) {
113 qDebug("error opening %s", d->filename); 118 odebug << "error opening " << d->filename << "" << oendl;
114 return FALSE; 119 return FALSE;
115 } 120 }
116 121
@@ -153,7 +158,7 @@ bool LibTremorPlugin::open( const QString& path ) {
153 } 158 }
154 } 159 }
155 160
156 qDebug("finfo: " + d->finfo); 161 odebug << "finfo: " + d->finfo << oendl;
157 162
158 return TRUE; 163 return TRUE;
159} 164}
@@ -165,7 +170,7 @@ bool LibTremorPlugin::close() {
165 int result = TRUE; 170 int result = TRUE;
166 171
167 if (fclose(d->f) == -1) { 172 if (fclose(d->f) == -1) {
168 qDebug("error closing file %s", d->filename); 173 odebug << "error closing file " << d->filename << "" << oendl;
169 result = FALSE; 174 result = FALSE;
170 } 175 }
171 176
@@ -193,13 +198,13 @@ int LibTremorPlugin::audioStreams() {
193 198
194 199
195int LibTremorPlugin::audioChannels( int ) { 200int LibTremorPlugin::audioChannels( int ) {
196 qDebug( "LibTremorPlugin::audioChannels: %i", d->vi->channels ); 201 odebug << "LibTremorPlugin::audioChannels: " << d->vi->channels << "" << oendl;
197 return d->vi->channels; 202 return d->vi->channels;
198} 203}
199 204
200 205
201int LibTremorPlugin::audioFrequency( int ) { 206int LibTremorPlugin::audioFrequency( int ) {
202 qDebug( "LibTremorPlugin::audioFrequency: %ld", d->vi->rate ); 207 odebug << "LibTremorPlugin::audioFrequency: " << d->vi->rate << "" << oendl;
203 return d->vi->rate; 208 return d->vi->rate;
204} 209}
205 210
@@ -223,7 +228,7 @@ long LibTremorPlugin::audioGetSample( int ) {
223 228
224 229
225bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long& samplesMade, int ) { 230bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long& samplesMade, int ) {
226// qDebug( "<<<<<<<<<<<<LibTremorPlugin::audioReadStereoSamples %d", samples ); 231// odebug << "<<<<<<<<<<<<LibTremorPlugin::audioReadStereoSamples " << samples << "" << oendl;
227 232
228 int old_section = d->csection; 233 int old_section = d->csection;
229 234
@@ -245,7 +250,7 @@ bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long&
245 } 250 }
246 251
247 long ret = ov_read(&d->vf, buf, n, &d->csection); 252 long ret = ov_read(&d->vf, buf, n, &d->csection);
248// qDebug("%d", ret); 253// odebug << "" << ret << "" << oendl;
249 if (ret == 0) { 254 if (ret == 0) {
250 break; 255 break;
251 } else if (ret < 0) { 256 } else if (ret < 0) {