Skip to content

Commit

Permalink
Added init() and quit() methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 22, 2001
1 parent 7396bee commit 22b17bf
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 17 deletions.
24 changes: 20 additions & 4 deletions decoders/aiff.c
Expand Up @@ -57,7 +57,8 @@
#error SOUND_SUPPORTS_AIFF must be defined.
#endif


static int AIFF_init(void);
static void AIFF_quit(void);
static int AIFF_open(Sound_Sample *sample, const char *ext);
static void AIFF_close(Sound_Sample *sample);
static Uint32 AIFF_read(Sound_Sample *sample);
Expand All @@ -71,9 +72,11 @@ const Sound_DecoderFunctions __Sound_DecoderFunctions_AIFF =
"http://www.icculus.org/SDL_sound/"
},

AIFF_open, /* open() method */
AIFF_close, /* close() method */
AIFF_read /* read() method */
AIFF_init, /* init() method */
AIFF_quit, /* quit() method */
AIFF_open, /* open() method */
AIFF_close, /* close() method */
AIFF_read /* read() method */
};


Expand Down Expand Up @@ -135,6 +138,19 @@ typedef struct
} comm_t;



static int AIFF_init(void)
{
return(1); /* always succeeds. */
} /* AIFF_init */


static void AIFF_quit(void)
{
/* it's a no-op. */
} /* AIFF_quit */


/*
* Sample rate is encoded as an "80 bit IEEE Standard 754 floating point
* number (Standard Apple Numeric Environment [SANE] data type Extended)".
Expand Down
24 changes: 20 additions & 4 deletions decoders/ogg.c
Expand Up @@ -49,7 +49,8 @@
#error SOUND_SUPPORTS_OGG must be defined.
#endif


static int OGG_init(void);
static void OGG_quit(void);
static int OGG_open(Sound_Sample *sample, const char *ext);
static void OGG_close(Sound_Sample *sample);
static Uint32 OGG_read(Sound_Sample *sample);
Expand All @@ -63,12 +64,27 @@ const Sound_DecoderFunctions __Sound_DecoderFunctions_OGG =
"http://www.icculus.org/SDL_sound/"
},

OGG_open, /* open() method */
OGG_close, /* close() method */
OGG_read /* read() method */
OGG_init, /* init() method */
OGG_quit, /* quit() method */
OGG_open, /* open() method */
OGG_close, /* close() method */
OGG_read /* read() method */
};


static int OGG_init(void)
{
return(1); /* always succeeds. */
} /* OGG_init */


static void OGG_quit(void)
{
/* it's a no-op. */
} /* OGG_quit */



/*
* These are callbacks from vorbisfile that let them read data from
* a RWops...
Expand Down
22 changes: 19 additions & 3 deletions decoders/raw.c
Expand Up @@ -52,6 +52,8 @@
#endif


static int RAW_init(void);
static void RAW_quit(void);
static int RAW_open(Sound_Sample *sample, const char *ext);
static void RAW_close(Sound_Sample *sample);
static Uint32 RAW_read(Sound_Sample *sample);
Expand All @@ -65,12 +67,26 @@ const Sound_DecoderFunctions __Sound_DecoderFunctions_RAW =
"http://www.icculus.org/SDL_sound/"
},

RAW_open, /* open() method */
RAW_close, /* close() method */
RAW_read /* read() method */
RAW_init, /* init() method */
RAW_quit, /* quit() method */
RAW_open, /* open() method */
RAW_close, /* close() method */
RAW_read /* read() method */
};


static int RAW_init(void)
{
return(1); /* always succeeds. */
} /* RAW_init */


static void RAW_quit(void)
{
/* it's a no-op. */
} /* RAW_quit */


static int RAW_open(Sound_Sample *sample, const char *ext)
{
/*
Expand Down
18 changes: 18 additions & 0 deletions decoders/skeleton.c
Expand Up @@ -43,6 +43,8 @@
#endif


static int FMT_init(void);
static void FMT_quit(void);
static int FMT_open(Sound_Sample *sample, const char *ext);
static void FMT_close(Sound_Sample *sample);
static Uint32 FMT_read(Sound_Sample *sample);
Expand All @@ -56,12 +58,28 @@ const Sound_DecoderFunctions __Sound_DecoderFunctions_FMT =
"http://www.icculus.org/SDL_sound/"
},

FMT_init, /* init() method */
FMT_quit, /* quit() method */
FMT_open, /* open() method */
FMT_close, /* close() method */
FMT_read /* read() method */
};


static int FMT_init(void)
{
/* do any global decoder/library initialization you need here. */

return(1); /* initialization successful. */
} /* FMT_init */


static void FMT_quit(void)
{
/* do any global decoder/library cleanup you need here. */
} /* FMT_quit */


static int FMT_open(Sound_Sample *sample, const char *ext)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
Expand Down
22 changes: 19 additions & 3 deletions decoders/voc.c
Expand Up @@ -51,6 +51,8 @@
#endif


static int VOC_init(void);
static void VOC_quit(void);
static int VOC_open(Sound_Sample *sample, const char *ext);
static void VOC_close(Sound_Sample *sample);
static Uint32 VOC_read(Sound_Sample *sample);
Expand All @@ -64,9 +66,11 @@ const Sound_DecoderFunctions __Sound_DecoderFunctions_VOC =
"http://www.icculus.org/SDL_sound/"
},

VOC_open, /* open() method */
VOC_close, /* close() method */
VOC_read /* read() method */
VOC_init, /* init() method */
VOC_quit, /* quit() method */
VOC_open, /* open() method */
VOC_close, /* close() method */
VOC_read /* read() method */
};


Expand Down Expand Up @@ -117,6 +121,18 @@ typedef struct vocstuff {
#define VOC_DATA_16 9


static int VOC_init(void)
{
return(1); /* always succeeds. */
} /* VOC_init */


static void VOC_quit(void)
{
/* it's a no-op. */
} /* VOC_quit */


static __inline__ int voc_check_header(SDL_RWops *src)
{
/* VOC magic header */
Expand Down
22 changes: 19 additions & 3 deletions decoders/wav.c
Expand Up @@ -41,6 +41,8 @@
#error SOUND_SUPPORTS_WAV must be defined.
#endif

static int WAV_init(void);
static void WAV_quit(void);
static int WAV_open(Sound_Sample *sample, const char *ext);
static void WAV_close(Sound_Sample *sample);
static Uint32 WAV_read(Sound_Sample *sample);
Expand All @@ -54,9 +56,11 @@ const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV =
"http://www.icculus.org/SDL_sound/"
},

WAV_open, /* open() method */
WAV_close, /* close() method */
WAV_read /* read() method */
WAV_init, /* init() method */
WAV_quit, /* quit() method */
WAV_open, /* open() method */
WAV_close, /* close() method */
WAV_read /* read() method */
};


Expand Down Expand Up @@ -90,6 +94,18 @@ typedef struct
} fmt_t;


static int WAV_init(void)
{
return(1); /* always succeeds. */
} /* WAV_init */


static void WAV_quit(void)
{
/* it's a no-op. */
} /* WAV_quit */


/*
* Read in a fmt_t from disk. This makes this process safe regardless of
* the processor's byte order or how the fmt_t structure is packed.
Expand Down

0 comments on commit 22b17bf

Please sign in to comment.