src/audio/baudio/SDL_beaudio.cc
changeset 2060 866052b01ee5
parent 2049 5f6550e5184f
child 2859 99210400e8b9
     1.1 --- a/src/audio/baudio/SDL_beaudio.cc	Sat Oct 28 16:41:54 2006 +0000
     1.2 +++ b/src/audio/baudio/SDL_beaudio.cc	Sat Oct 28 16:48:03 2006 +0000
     1.3 @@ -58,15 +58,15 @@
     1.4          if (audio->convert.needed) {
     1.5              SDL_mutexP(audio->mixer_lock);
     1.6              (*audio->spec.callback) (audio->spec.userdata,
     1.7 -                                         (Uint8 *) audio->convert.buf,
     1.8 -                                         audio->convert.len);
     1.9 +                                     (Uint8 *) audio->convert.buf,
    1.10 +                                     audio->convert.len);
    1.11              SDL_mutexV(audio->mixer_lock);
    1.12              SDL_ConvertAudio(&audio->convert);
    1.13              SDL_memcpy(stream, audio->convert.buf, audio->convert.len_cvt);
    1.14          } else {
    1.15              SDL_mutexP(audio->mixer_lock);
    1.16              (*audio->spec.callback) (audio->spec.userdata,
    1.17 -                                        (Uint8 *) stream, len);
    1.18 +                                     (Uint8 *) stream, len);
    1.19              SDL_mutexV(audio->mixer_lock);
    1.20          }
    1.21      }
    1.22 @@ -106,56 +106,56 @@
    1.23      SDL_memset(&format, '\0', sizeof(media_raw_audio_format));
    1.24      format.byte_order = B_MEDIA_LITTLE_ENDIAN;
    1.25      format.frame_rate = (float) _this->spec.freq;
    1.26 -    format.channel_count = _this->spec.channels;  /* !!! FIXME: support > 2? */
    1.27 +    format.channel_count = _this->spec.channels;        /* !!! FIXME: support > 2? */
    1.28      while ((!valid_datatype) && (test_format)) {
    1.29          valid_datatype = 1;
    1.30          _this->spec.format = test_format;
    1.31          switch (test_format) {
    1.32 -            case AUDIO_S8:
    1.33 -                format.format = media_raw_audio_format::B_AUDIO_CHAR;
    1.34 -                break;
    1.35 +        case AUDIO_S8:
    1.36 +            format.format = media_raw_audio_format::B_AUDIO_CHAR;
    1.37 +            break;
    1.38  
    1.39 -            case AUDIO_U8:
    1.40 -                format.format = media_raw_audio_format::B_AUDIO_UCHAR;
    1.41 -                break;
    1.42 +        case AUDIO_U8:
    1.43 +            format.format = media_raw_audio_format::B_AUDIO_UCHAR;
    1.44 +            break;
    1.45  
    1.46 -            case AUDIO_S16LSB:
    1.47 -                format.format = media_raw_audio_format::B_AUDIO_SHORT;
    1.48 -                break;
    1.49 +        case AUDIO_S16LSB:
    1.50 +            format.format = media_raw_audio_format::B_AUDIO_SHORT;
    1.51 +            break;
    1.52  
    1.53 -            case AUDIO_S16MSB:
    1.54 -                format.format = media_raw_audio_format::B_AUDIO_SHORT;
    1.55 -                format.byte_order = B_MEDIA_BIG_ENDIAN;
    1.56 -                break;
    1.57 +        case AUDIO_S16MSB:
    1.58 +            format.format = media_raw_audio_format::B_AUDIO_SHORT;
    1.59 +            format.byte_order = B_MEDIA_BIG_ENDIAN;
    1.60 +            break;
    1.61  
    1.62 -            case AUDIO_S32LSB:
    1.63 -                format.format = media_raw_audio_format::B_AUDIO_INT;
    1.64 -                break;
    1.65 +        case AUDIO_S32LSB:
    1.66 +            format.format = media_raw_audio_format::B_AUDIO_INT;
    1.67 +            break;
    1.68  
    1.69 -            case AUDIO_S32MSB:
    1.70 -                format.format = media_raw_audio_format::B_AUDIO_INT;
    1.71 -                format.byte_order = B_MEDIA_BIG_ENDIAN;
    1.72 -                break;
    1.73 +        case AUDIO_S32MSB:
    1.74 +            format.format = media_raw_audio_format::B_AUDIO_INT;
    1.75 +            format.byte_order = B_MEDIA_BIG_ENDIAN;
    1.76 +            break;
    1.77  
    1.78 -            case AUDIO_F32LSB:
    1.79 -                format.format = media_raw_audio_format::B_AUDIO_FLOAT;
    1.80 -                break;
    1.81 +        case AUDIO_F32LSB:
    1.82 +            format.format = media_raw_audio_format::B_AUDIO_FLOAT;
    1.83 +            break;
    1.84  
    1.85 -            case AUDIO_F32MSB:
    1.86 -                format.format = media_raw_audio_format::B_AUDIO_FLOAT;
    1.87 -                format.byte_order = B_MEDIA_BIG_ENDIAN;
    1.88 -                break;
    1.89 +        case AUDIO_F32MSB:
    1.90 +            format.format = media_raw_audio_format::B_AUDIO_FLOAT;
    1.91 +            format.byte_order = B_MEDIA_BIG_ENDIAN;
    1.92 +            break;
    1.93  
    1.94 -            default:
    1.95 -                valid_datatype = 0;
    1.96 -                test_format = SDL_NextAudioFormat();
    1.97 -                break;
    1.98 +        default:
    1.99 +            valid_datatype = 0;
   1.100 +            test_format = SDL_NextAudioFormat();
   1.101 +            break;
   1.102          }
   1.103      }
   1.104  
   1.105      format.buffer_size = _this->spec.samples;
   1.106  
   1.107 -    if (!valid_datatype) {  /* shouldn't happen, but just in case... */
   1.108 +    if (!valid_datatype) {      /* shouldn't happen, but just in case... */
   1.109          BEOSAUDIO_CloseDevice(_this);
   1.110          SDL_SetError("Unsupported audio format");
   1.111          return 0;
   1.112 @@ -190,7 +190,7 @@
   1.113  }
   1.114  
   1.115  static int
   1.116 -BEOSAUDIO_Init(SDL_AudioDriverImpl *impl)
   1.117 +BEOSAUDIO_Init(SDL_AudioDriverImpl * impl)
   1.118  {
   1.119      /* Initialize the Be Application, if it's not already started */
   1.120      if (SDL_InitBeApp() < 0) {
   1.121 @@ -207,10 +207,12 @@
   1.122      return 1;
   1.123  }
   1.124  
   1.125 -extern "C" { extern AudioBootStrap BEOSAUDIO_bootstrap; }
   1.126 +extern "C"
   1.127 +{
   1.128 +    extern AudioBootStrap BEOSAUDIO_bootstrap;
   1.129 +}
   1.130  AudioBootStrap BEOSAUDIO_bootstrap = {
   1.131      "baudio", "BeOS BSoundPlayer", BEOSAUDIO_Init, 0
   1.132  };
   1.133  
   1.134  /* vi: set ts=4 sw=4 expandtab: */
   1.135 -