@@ -71,8 +71,8 @@ static struct _outbuffer_s OutputRingBuffer;
71
71
static u32 init_done = 0 ;
72
72
static u32 CurrentBuffer = 0 ;
73
73
static f32 VSA = (1.0 /4294967295.0 );
74
- static BOOL thr_running = FALSE ;
75
- static BOOL MP3Playing = FALSE ;
74
+ static bool thr_running = false ;
75
+ static bool MP3Playing = false ;
76
76
static void * mp3cb_data = NULL ;
77
77
78
78
static void * StreamPlay (void * );
@@ -231,7 +231,7 @@ void MP3Player_Init(void)
231
231
232
232
s32 MP3Player_PlayBuffer (const void * buffer ,s32 len ,void (* filterfunc )(struct mad_stream * ,struct mad_frame * ))
233
233
{
234
- if (thr_running == TRUE ) return -1 ;
234
+ if (thr_running ) return -1 ;
235
235
236
236
rambuffer .buf_addr = buffer ;
237
237
rambuffer .len = len ;
@@ -248,7 +248,7 @@ s32 MP3Player_PlayBuffer(const void *buffer,s32 len,void (*filterfunc)(struct ma
248
248
249
249
s32 MP3Player_PlayFile (void * cb_data ,s32 (* reader )(void * ,void * ,s32 ),void (* filterfunc )(struct mad_stream * ,struct mad_frame * ))
250
250
{
251
- if (thr_running == TRUE ) return -1 ;
251
+ if (thr_running ) return -1 ;
252
252
253
253
mp3cb_data = cb_data ;
254
254
mp3read = reader ;
@@ -261,28 +261,28 @@ s32 MP3Player_PlayFile(void *cb_data,s32 (*reader)(void *,void *,s32),void (*fil
261
261
262
262
void MP3Player_Stop (void )
263
263
{
264
- if (thr_running == FALSE ) return ;
264
+ if (! thr_running ) return ;
265
265
266
- thr_running = FALSE ;
266
+ thr_running = false ;
267
267
LWP_JoinThread (hStreamPlay ,NULL );
268
268
}
269
269
270
- BOOL MP3Player_IsPlaying (void )
270
+ bool MP3Player_IsPlaying (void )
271
271
{
272
272
return thr_running ;
273
273
}
274
274
275
275
static void * StreamPlay (void * arg )
276
276
{
277
- BOOL atend ;
277
+ bool atend ;
278
278
u8 * GuardPtr = NULL ;
279
279
struct mad_stream Stream ;
280
280
struct mad_frame Frame ;
281
281
struct mad_synth Synth ;
282
282
mad_timer_t Timer ;
283
283
EQState eqs [2 ];
284
284
285
- thr_running = TRUE ;
285
+ thr_running = true ;
286
286
287
287
CurrentBuffer = 0 ;
288
288
memset (OutputBuffer [0 ],0 ,ADMA_BUFFERSIZE );
@@ -303,9 +303,9 @@ static void *StreamPlay(void *arg)
303
303
mad_synth_init (& Synth );
304
304
mad_timer_reset (& Timer );
305
305
306
- atend = FALSE ;
307
- MP3Playing = FALSE ;
308
- while (atend == FALSE && thr_running == TRUE ) {
306
+ atend = false ;
307
+ MP3Playing = false ;
308
+ while (! atend && thr_running ) {
309
309
if (Stream .buffer == NULL || Stream .error == MAD_ERROR_BUFLEN ) {
310
310
u8 * ReadStart ;
311
311
s32 ReadSize , Remaining ;
@@ -327,14 +327,14 @@ static void *StreamPlay(void *arg)
327
327
GuardPtr = ReadStart ;
328
328
memset (GuardPtr ,0 ,MAD_BUFFER_GUARD );
329
329
ReadSize = MAD_BUFFER_GUARD ;
330
- atend = TRUE ;
330
+ atend = true ;
331
331
}
332
332
333
333
mad_stream_buffer (& Stream ,InputBuffer ,(ReadSize + Remaining ));
334
334
//Stream.error = 0;
335
335
}
336
336
337
- while (!mad_frame_decode (& Frame ,& Stream ) && thr_running == TRUE ) {
337
+ while (!mad_frame_decode (& Frame ,& Stream ) && thr_running ) {
338
338
if (mp3filterfunc )
339
339
mp3filterfunc (& Stream ,& Frame );
340
340
@@ -357,7 +357,7 @@ static void *StreamPlay(void *arg)
357
357
mad_frame_finish (& Frame );
358
358
mad_stream_finish (& Stream );
359
359
360
- while (MP3Playing == TRUE )
360
+ while (MP3Playing )
361
361
LWP_ThreadSleep (thQueue );
362
362
363
363
#ifndef __SNDLIB_H__
@@ -369,7 +369,7 @@ static void *StreamPlay(void *arg)
369
369
370
370
LWP_CloseQueue (thQueue );
371
371
372
- thr_running = FALSE ;
372
+ thr_running = false ;
373
373
374
374
return 0 ;
375
375
}
@@ -452,7 +452,7 @@ static void DataTransferCallback(s32 voice)
452
452
CurrentBuffer = (CurrentBuffer + 1 )%3 ;
453
453
MP3Playing = (buf_get (& OutputRingBuffer ,OutputBuffer [CurrentBuffer ],ADMA_BUFFERSIZE )> 0 );
454
454
#else
455
- if (thr_running != TRUE ) {
455
+ if (! thr_running ) {
456
456
MP3Playing = (buf_get (& OutputRingBuffer ,OutputBuffer [CurrentBuffer ],ADMA_BUFFERSIZE )> 0 );
457
457
return ;
458
458
}
0 commit comments