comparison decoders/aiff.c @ 306:c97be6e1bd27

Added framework for Sound_Seek() support.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 21 Apr 2002 18:39:47 +0000
parents c9772a9f5271
children 8ba541e81c1e
comparison
equal deleted inserted replaced
305:c345a40a8a99 306:c97be6e1bd27
64 static void AIFF_quit(void); 64 static void AIFF_quit(void);
65 static int AIFF_open(Sound_Sample *sample, const char *ext); 65 static int AIFF_open(Sound_Sample *sample, const char *ext);
66 static void AIFF_close(Sound_Sample *sample); 66 static void AIFF_close(Sound_Sample *sample);
67 static Uint32 AIFF_read(Sound_Sample *sample); 67 static Uint32 AIFF_read(Sound_Sample *sample);
68 static int AIFF_rewind(Sound_Sample *sample); 68 static int AIFF_rewind(Sound_Sample *sample);
69 static int AIFF_seek(Sound_Sample *sample, Uint32 ms);
69 70
70 static const char *extensions_aiff[] = { "AIFF", NULL }; 71 static const char *extensions_aiff[] = { "AIFF", NULL };
71 const Sound_DecoderFunctions __Sound_DecoderFunctions_AIFF = 72 const Sound_DecoderFunctions __Sound_DecoderFunctions_AIFF =
72 { 73 {
73 { 74 {
80 AIFF_init, /* init() method */ 81 AIFF_init, /* init() method */
81 AIFF_quit, /* quit() method */ 82 AIFF_quit, /* quit() method */
82 AIFF_open, /* open() method */ 83 AIFF_open, /* open() method */
83 AIFF_close, /* close() method */ 84 AIFF_close, /* close() method */
84 AIFF_read, /* read() method */ 85 AIFF_read, /* read() method */
85 AIFF_rewind /* rewind() method */ 86 AIFF_rewind, /* rewind() method */
87 AIFF_seek /* seek() method */
86 }; 88 };
87 89
88 90
89 /***************************************************************************** 91 /*****************************************************************************
90 * aiff_t is what we store in our internal->decoder_private field... * 92 * aiff_t is what we store in our internal->decoder_private field... *
518 { 520 {
519 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; 521 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
520 aiff_t *a = (aiff_t *) internal->decoder_private; 522 aiff_t *a = (aiff_t *) internal->decoder_private;
521 a->fmt.free(&(a->fmt)); 523 a->fmt.free(&(a->fmt));
522 free(a); 524 free(a);
523 } /* WAV_close */ 525 } /* AIFF_close */
524 526
525 527
526 static Uint32 AIFF_read(Sound_Sample *sample) 528 static Uint32 AIFF_read(Sound_Sample *sample)
527 { 529 {
528 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; 530 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
540 BAIL_IF_MACRO(rc != fmt->data_starting_offset, ERR_IO_ERROR, 0); 542 BAIL_IF_MACRO(rc != fmt->data_starting_offset, ERR_IO_ERROR, 0);
541 a->bytesLeft = fmt->total_bytes; 543 a->bytesLeft = fmt->total_bytes;
542 return(fmt->rewind_sample(sample)); 544 return(fmt->rewind_sample(sample));
543 } /* AIFF_rewind */ 545 } /* AIFF_rewind */
544 546
547
548 static int AIFF_seek(Sound_Sample *sample, Uint32 ms)
549 {
550 BAIL_MACRO("!!! FIXME: Not implemented", 0);
551 } /* AIFF_seek */
552
545 #endif /* SOUND_SUPPORTS_AIFF */ 553 #endif /* SOUND_SUPPORTS_AIFF */
546 554
547 /* end of aiff.c ... */ 555 /* end of aiff.c ... */
548 556