src/audio/nds/SDL_ndsaudio.c
branchgsoc2008_nds
changeset 2697 c9121b04cffa
parent 2689 e065c9f6a393
child 2698 e1da92da346c
     1.1 --- a/src/audio/nds/SDL_ndsaudio.c	Mon Aug 18 07:29:52 2008 +0000
     1.2 +++ b/src/audio/nds/SDL_ndsaudio.c	Thu Aug 21 12:38:21 2008 +0000
     1.3 @@ -31,6 +31,8 @@
     1.4  #include "../SDL_audio_c.h"
     1.5  #include "SDL_ndsaudio.h"
     1.6  
     1.7 +#define TRACE printf
     1.8 +
     1.9  static int
    1.10  NDSAUD_OpenDevice(_THIS, const char *devname, int iscapture)
    1.11  {
    1.12 @@ -44,6 +46,7 @@
    1.13      }
    1.14      SDL_memset(this->hidden, 0, (sizeof *this->hidden));
    1.15  
    1.16 +    TRACE("+NDSAUD_OpenDevice\n");
    1.17      while ((!valid_datatype) && (test_format)) {
    1.18          this->spec.format = test_format;
    1.19          switch (test_format) {
    1.20 @@ -63,6 +66,7 @@
    1.21                      64,     /* panning/balance */
    1.22                      0);     /* sound format*/
    1.23  
    1.24 +    TRACE("-NDSAUD_OpenDevice\n");
    1.25      return 1;
    1.26  }
    1.27  
    1.28 @@ -73,9 +77,11 @@
    1.29      if(!sound) {
    1.30          SDL_OutOfMemory();
    1.31      }
    1.32 +    TRACE("+NDSAUD_PlayDevice\n");
    1.33  
    1.34      playGenericSound(this->hidden->mixbuf, this->hidden->mixlen);
    1.35  
    1.36 +    TRACE("-NDSAUD_PlayDevice\n");
    1.37  //    sound->data = this->hidden->mixbuf;/* pointer to raw audio data */
    1.38  //    sound->len = this->hidden->mixlen; /* size of raw data pointed to above */
    1.39  //    sound->rate = 22050; /* sample rate = 22050Hz */
    1.40 @@ -89,6 +95,7 @@
    1.41  static Uint8 *
    1.42  NDSAUD_GetDeviceBuf(_THIS)
    1.43  {   /* is this right? */
    1.44 +    TRACE("!NDSAUD_GetDeviceBuf\n");
    1.45      return this->hidden->mixbuf;
    1.46  }
    1.47  
    1.48 @@ -96,29 +103,39 @@
    1.49  NDSAUD_WaitDevice(_THIS)
    1.50  {
    1.51      /* stub */
    1.52 +    TRACE("!NDSAUD_WaitDevice\n");
    1.53  }
    1.54  
    1.55  static void
    1.56  NDSAUD_CloseDevice(_THIS)
    1.57  {
    1.58      /* stub */
    1.59 +    TRACE("!NDSAUD_CloseDevice\n");
    1.60  }
    1.61  
    1.62  static int
    1.63  NDSAUD_Init(SDL_AudioDriverImpl * impl)
    1.64  {
    1.65 +    TRACE("+NDSAUD_Init\n");
    1.66 +
    1.67      /* Set the function pointers */
    1.68      impl->OpenDevice = NDSAUD_OpenDevice;
    1.69      impl->PlayDevice = NDSAUD_PlayDevice;
    1.70      impl->WaitDevice = NDSAUD_WaitDevice;
    1.71      impl->GetDeviceBuf = NDSAUD_GetDeviceBuf;
    1.72      impl->CloseDevice = NDSAUD_CloseDevice;
    1.73 +
    1.74 +    /* and the capabilities */
    1.75 +    impl->HasCaptureSupport = 1;
    1.76      impl->OnlyHasDefaultOutputDevice = 1;
    1.77 +    impl->OnlyHasDefaultInputDevice = 1;
    1.78 +
    1.79 +    TRACE("-NDSAUD_Init\n");
    1.80      return 1;
    1.81  }
    1.82  
    1.83  AudioBootStrap NDSAUD_bootstrap = {
    1.84 -    "nds", "SDL NDS audio driver", NDSAUD_Init, 1
    1.85 +    "nds", "SDL NDS audio driver", NDSAUD_Init, 0 /*1?*/
    1.86  };
    1.87  
    1.88  /* vi: set ts=4 sw=4 expandtab: */