summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/vorbis/libtremorplugin.cpp
authorar <ar>2004-05-02 17:04:41 (UTC)
committer ar <ar>2004-05-02 17:04:41 (UTC)
commit4d3379027557e251201b531896974a69ae4c665a (patch) (unidiff)
tree6e813be1aa29131f8f8e91f532f38f8a381e38f4 /core/multimedia/opieplayer/vorbis/libtremorplugin.cpp
parentf8add41b2e0b0371754521b44d95f87fa70a6ff2 (diff)
downloadopie-4d3379027557e251201b531896974a69ae4c665a.zip
opie-4d3379027557e251201b531896974a69ae4c665a.tar.gz
opie-4d3379027557e251201b531896974a69ae4c665a.tar.bz2
- convert qDebug to odebug
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
@@ -16,12 +16,21 @@
16* You should have received a copy of the GNU General Public License 16* You should have received a copy of the GNU General Public License
17* along with this program; if not, write to the Free Software 17* along with this program; if not, write to the Free Software
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>
26#include <sys/stat.h> 35#include <sys/stat.h>
27#include <fcntl.h> 36#include <fcntl.h>
@@ -30,16 +39,12 @@
30#include <errno.h> 39#include <errno.h>
31#include <time.h> 40#include <time.h>
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}
44 49
45 50
@@ -59,13 +64,13 @@ public:
59 int csection; 64 int csection;
60 QString finfo; 65 QString finfo;
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;
70 d->bos = 0; 75 d->bos = 0;
71 d->csection = 0; 76 d->csection = 0;
@@ -102,18 +107,18 @@ bool LibTremorPlugin::isFileSupported( const QString& path ) {
102bool LibTremorPlugin::open( const QString& path ) { 107bool LibTremorPlugin::open( const QString& path ) {
103 debugMsg( "LibTremorPlugin::open" ); 108 debugMsg( "LibTremorPlugin::open" );
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);
118 d->vi = ov_info(&d->vf, -1); 123 d->vi = ov_info(&d->vf, -1);
119 d->bos = false; 124 d->bos = false;
@@ -150,25 +155,25 @@ bool LibTremorPlugin::open( const QString& path ) {
150 } 155 }
151 156
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
161 166
162bool LibTremorPlugin::close() { 167bool LibTremorPlugin::close() {
163 debugMsg( "LibTremorPlugin::close" ); 168 debugMsg( "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;
173 d->finfo = ""; 178 d->finfo = "";
174 179
@@ -190,19 +195,19 @@ int LibTremorPlugin::audioStreams() {
190 debugMsg( "LibTremorPlugin::audioStreams" ); 195 debugMsg( "LibTremorPlugin::audioStreams" );
191 return 1; 196 return 1;
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
207int LibTremorPlugin::audioSamples( int ) { 212int LibTremorPlugin::audioSamples( int ) {
208 debugMsg( "LibTremorPlugin::audioSamples" ); 213 debugMsg( "LibTremorPlugin::audioSamples" );
@@ -220,13 +225,13 @@ long LibTremorPlugin::audioGetSample( int ) {
220 debugMsg( "LibTremorPlugin::audioGetSample" ); 225 debugMsg( "LibTremorPlugin::audioGetSample" );
221 return 0; 226 return 0;
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;
231 int length = samples * 4; 236 int length = samples * 4;
232 237
@@ -242,13 +247,13 @@ bool LibTremorPlugin::audioReadSamples( short *output, int, long samples, long&
242 int n = 4096; 247 int n = 4096;
243 if (length < n) { 248 if (length < n) {
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;
253 } 258 }
254 259