Fixed opening braces
authorSam Lantinga <slouken@libsdl.org>
Sat, 03 Oct 2009 03:53:45 +0000
changeset 4092ba29d53be77
parent 408 fc6c4861e8ec
child 410 5694b5d9b80a
Fixed opening braces
music_flac.c
     1.1 --- a/music_flac.c	Sat Oct 03 03:35:05 2009 +0000
     1.2 +++ b/music_flac.c	Sat Oct 03 03:53:45 2009 +0000
     1.3 @@ -40,18 +40,21 @@
     1.4  /* Initialize the FLAC player, with the given mixer settings
     1.5     This function returns 0, or -1 if there was an error.
     1.6   */
     1.7 -int FLAC_init(SDL_AudioSpec *mixerfmt) {
     1.8 +int FLAC_init(SDL_AudioSpec *mixerfmt)
     1.9 +{
    1.10  	mixer = *mixerfmt;
    1.11  	return(0);
    1.12  }
    1.13  
    1.14  /* Set the volume for an FLAC stream */
    1.15 -void FLAC_setvolume(FLAC_music *music, int volume) {
    1.16 +void FLAC_setvolume(FLAC_music *music, int volume)
    1.17 +{
    1.18  	music->volume = volume;
    1.19  }
    1.20  
    1.21  /* Load an FLAC stream from the given file */
    1.22 -FLAC_music *FLAC_new(const char *file) {
    1.23 +FLAC_music *FLAC_new(const char *file)
    1.24 +{
    1.25  	SDL_RWops *rw;
    1.26  
    1.27  	rw = SDL_RWFromFile (file, "rb");
    1.28 @@ -66,7 +69,8 @@
    1.29  									const FLAC__StreamDecoder *decoder,
    1.30  									FLAC__byte buffer[],
    1.31  									size_t *bytes,
    1.32 -									void *client_data) {
    1.33 +									void *client_data)
    1.34 +{
    1.35  	FLAC_music *data = (FLAC_music*)client_data;
    1.36  
    1.37  	// make sure there is something to be reading
    1.38 @@ -91,7 +95,8 @@
    1.39  static FLAC__StreamDecoderSeekStatus flac_seek_music_cb(
    1.40  									const FLAC__StreamDecoder *decoder,
    1.41  									FLAC__uint64 absolute_byte_offset,
    1.42 -									void *client_data) {
    1.43 +									void *client_data)
    1.44 +{
    1.45  	FLAC_music *data = (FLAC_music*)client_data;
    1.46  
    1.47  	if (SDL_RWseek (data->rwops, absolute_byte_offset, SEEK_SET) < 0) {
    1.48 @@ -105,7 +110,8 @@
    1.49  static FLAC__StreamDecoderTellStatus flac_tell_music_cb(
    1.50  									const FLAC__StreamDecoder *decoder,
    1.51  									FLAC__uint64 *absolute_byte_offset,
    1.52 -									void *client_data ) {
    1.53 +									void *client_data )
    1.54 +{
    1.55  	FLAC_music *data = (FLAC_music*)client_data;
    1.56  
    1.57  	int pos = SDL_RWtell (data->rwops);
    1.58 @@ -122,7 +128,8 @@
    1.59  static FLAC__StreamDecoderLengthStatus flac_length_music_cb (
    1.60  									const FLAC__StreamDecoder *decoder,
    1.61  									FLAC__uint64 *stream_length,
    1.62 -									void *client_data) {
    1.63 +									void *client_data)
    1.64 +{
    1.65  	FLAC_music *data = (FLAC_music*)client_data;
    1.66  
    1.67  	int pos = SDL_RWtell (data->rwops);
    1.68 @@ -141,7 +148,8 @@
    1.69  
    1.70  static FLAC__bool flac_eof_music_cb(
    1.71  								const FLAC__StreamDecoder *decoder,
    1.72 -								void *client_data ) {
    1.73 +								void *client_data )
    1.74 +{
    1.75  	FLAC_music *data = (FLAC_music*)client_data;
    1.76  
    1.77  	int pos = SDL_RWtell (data->rwops);
    1.78 @@ -164,7 +172,8 @@
    1.79  									const FLAC__StreamDecoder *decoder,
    1.80  									const FLAC__Frame *frame,
    1.81  									const FLAC__int32 *const buffer[],
    1.82 -									void *client_data) {
    1.83 +									void *client_data)
    1.84 +{
    1.85  	FLAC_music *data = (FLAC_music *)client_data;
    1.86  	size_t i;
    1.87  
    1.88 @@ -267,7 +276,8 @@
    1.89  static void flac_metadata_music_cb(
    1.90  					const FLAC__StreamDecoder *decoder,
    1.91  					const FLAC__StreamMetadata *metadata,
    1.92 -					void *client_data) {
    1.93 +					void *client_data)
    1.94 +{
    1.95  	FLAC_music *data = (FLAC_music *)client_data;
    1.96  
    1.97  	if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
    1.98 @@ -285,7 +295,8 @@
    1.99  static void flac_error_music_cb(
   1.100  				const FLAC__StreamDecoder *decoder,
   1.101  				FLAC__StreamDecoderErrorStatus status,
   1.102 -				void *client_data) {
   1.103 +				void *client_data)
   1.104 +{
   1.105  	// print an SDL error based on the error status
   1.106  	switch (status) {
   1.107  		case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC:
   1.108 @@ -307,7 +318,8 @@
   1.109  }
   1.110  
   1.111  /* Load an FLAC stream from an SDL_RWops object */
   1.112 -FLAC_music *FLAC_new_RW(SDL_RWops *rw) {
   1.113 +FLAC_music *FLAC_new_RW(SDL_RWops *rw)
   1.114 +{
   1.115  	FLAC_music *music;
   1.116  	int init_stage = 0;
   1.117  	int was_error = 1;
   1.118 @@ -381,17 +393,20 @@
   1.119  }
   1.120  
   1.121  /* Start playback of a given FLAC stream */
   1.122 -void FLAC_play(FLAC_music *music) {
   1.123 +void FLAC_play(FLAC_music *music)
   1.124 +{
   1.125  	music->playing = 1;
   1.126  }
   1.127  
   1.128  /* Return non-zero if a stream is currently playing */
   1.129 -int FLAC_playing(FLAC_music *music) {
   1.130 +int FLAC_playing(FLAC_music *music)
   1.131 +{
   1.132  	return(music->playing);
   1.133  }
   1.134  
   1.135  /* Read some FLAC stream data and convert it for output */
   1.136 -static void FLAC_getsome(FLAC_music *music) {
   1.137 +static void FLAC_getsome(FLAC_music *music)
   1.138 +{
   1.139  	int section;
   1.140  	SDL_AudioCVT *cvt;
   1.141  
   1.142 @@ -492,7 +507,8 @@
   1.143  }
   1.144  
   1.145  /* Play some of a stream previously started with FLAC_play() */
   1.146 -int FLAC_playAudio(FLAC_music *music, Uint8 *snd, int len) {
   1.147 +int FLAC_playAudio(FLAC_music *music, Uint8 *snd, int len)
   1.148 +{
   1.149  	int mixable;
   1.150  
   1.151  	while ((len > 0) && music->playing) {
   1.152 @@ -519,12 +535,14 @@
   1.153  }
   1.154  
   1.155  /* Stop playback of a stream previously started with FLAC_play() */
   1.156 -void FLAC_stop(FLAC_music *music) {
   1.157 +void FLAC_stop(FLAC_music *music)
   1.158 +{
   1.159  	music->playing = 0;
   1.160  }
   1.161  
   1.162  /* Close the given FLAC_music object */
   1.163 -void FLAC_delete(FLAC_music *music) {
   1.164 +void FLAC_delete(FLAC_music *music)
   1.165 +{
   1.166  	if (music) {
   1.167  		if (music->flac_decoder) {
   1.168  			flac.FLAC__stream_decoder_finish (music->flac_decoder);
   1.169 @@ -550,7 +568,8 @@
   1.170  }
   1.171  
   1.172  /* Jump (seek) to a given position (time is in seconds) */
   1.173 -void FLAC_jump_to_time(FLAC_music *music, double time) {
   1.174 +void FLAC_jump_to_time(FLAC_music *music, double time)
   1.175 +{
   1.176  	if (music) {
   1.177  		if (music->flac_decoder) {
   1.178  			double seek_sample = music->flac_data.sample_rate * time;