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
@@ -18,8 +18,17 @@
18* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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>
25#include <sys/types.h> 34#include <sys/types.h>
@@ -32,12 +41,8 @@
32#include <locale.h> 41#include <locale.h>
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"
43} 48}
@@ -61,9 +66,9 @@ public:
61}; 66};
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;
69 d->vc = 0; 74 d->vc = 0;
@@ -104,14 +109,14 @@ bool LibTremorPlugin::open( const QString& path ) {
104 109
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
117 d->vc = ov_comment(&d->vf, -1); 122 d->vc = ov_comment(&d->vf, -1);
@@ -152,9 +157,9 @@ bool LibTremorPlugin::open( const QString& path ) {
152 d->finfo += cdescr[i] + ": " + v; 157 d->finfo += cdescr[i] + ": " + v;
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}
160 165
@@ -164,9 +169,9 @@ bool LibTremorPlugin::close() {
164 169
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
172 d->f = 0; 177 d->f = 0;
@@ -192,15 +197,15 @@ int LibTremorPlugin::audioStreams() {
192} 197}
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
206 211
@@ -222,9 +227,9 @@ long LibTremorPlugin::audioGetSample( int ) {
222} 227}
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
230 char* buf = (char*) output; 235 char* buf = (char*) output;
@@ -244,9 +249,9 @@ bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long&
244 n = length; 249 n = length;
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) {
252 return true; 257 return true;