home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / dev / src / wavetools_dev.lha / wavetools / dad_audio.h next >
Encoding:
C/C++ Source or Header  |  1995-11-15  |  5.7 KB  |  180 lines

  1. #ifndef DAD_AUDIO_H
  2. #define DAD_AUDIO_H
  3. /************************************************************************
  4. ** $VER: 0.19_BETA dad_audio.h (95.11.15)                              **
  5. ** dad_audio.device include file BETA by Johan Nyblom                  **
  6. ** email: nyblom@mother.ludd.luth.se                                   **
  7. ** All this knowledge has been found by reverse engineering,           **
  8. ** guessing and the use of devmon. It has NOTHING to do with           **
  9. ** Digital Audio Design, the makers of wavetools hardware              **
  10. ** and software.                                                       **
  11. ** I am not responsible for any damage anyone does with this stuff :)  **
  12. ** just so that you know, this is EXTREMELY shaky knowledge.           **
  13. ** Ye have been forewarned!                                            **
  14. ************************************************************************/
  15.  
  16. #include <exec/io.h>    /*std DEVICE commands and structures*/
  17.  
  18. /* Standard device commands, listed for easy access.
  19. CMD_INVALID    0 Invalid Command
  20. CMD_RESET    1 Reset device to orig.state
  21. CMD_READ    2 Read from device
  22. CMD_WRITE    3 Write to device
  23. CMD_UPDATE    4 Process buffer
  24. CMD_CLEAR    5 Clear all buffers
  25. CMD_STOP    6 Insert pause
  26. CMD_START    7 Continue after pause
  27. CMD_FLUSH    8 Stop current task
  28. */
  29.  
  30. /************************************************************************
  31. **                                                                     **
  32. ** dad_audio.device                                  **
  33. **                                                                     **
  34. ************************************************************************/
  35.  
  36. /* CMD_READ    standard device command
  37. **        io_Data = Longword Aligned.
  38. **            data is read into the address in io_Data.
  39. **        io_Offset = -1, it worls with Offset=0 but dad_audio.device
  40. **            returns offset=-1 so why not use it from the start,
  41. **            besides WaveTools(software) uses Offset -1 so...
  42. **
  43. **        Result: buffer is read to address,
  44. **            io_Actual = bytes read
  45. **
  46. **
  47. ** DataFormat is LONG( WORD(left) , WORD(right))
  48. **
  49. */
  50.  
  51.  
  52.  
  53. /*
  54. ** dad_audio.device commandon
  55. */
  56.  
  57. #define    DADCMD_BUFFER        (CMD_NONSTD+0)
  58. #define    DAD_BUFFER_SETUP    0L
  59. #define    DAD_BUFFER_SWITCH    -1L
  60.     /* Call with Offset to determine usage,
  61.     ** Offset =     DAD_ BUFFER_SWITCH
  62.     **        Result: io_Actual = number of bytes in presampled buffer.
  63.     **
  64.     ** Offset =     DAD_BUFFER_SETUP
  65.     **         Result:    io_Actual is set to first sampling length (ie max internal buffer size)
  66.     **        usually 8084 but it could differ with another hardware setup.
  67.     **
  68.     **Model:
  69.     **    Suppose the card has 2 onboard buffes, these buffers are 8084 bytes each.
  70.     ** 1.    Setup onboard buffers, returning maximum size in bytes. (8084)
  71.     ** 2.    Next read from the card to a buffer MEMF_24BITDMA or
  72.     **        MEMF_CHIP if you are gonna dump it do disk,
  73.     **        the card starts sampling into buffer1 and let me read it when it is full,
  74.     **        while the card continues to sample into buffer2.
  75.     ** 3.    I am done reading and now switches buffers with the buffer command,
  76.     **        buffer2 is frozen. and sampling to buffer 1 starts,
  77.     **        io_Actual is the length the card managed to sample into buffer2.
  78.     **        io_Error = -128 if overflow(or some error) happened.
  79.     ** 4.    I read from card, getting my data from buffer2 this time.
  80.     **    Then it starts over at 3.
  81.         */
  82.  
  83.  
  84.  
  85. #define    DADCMD_OUTPUTDAMP    (CMD_NONSTD+2)
  86. #define    DADCONST_MAXDAMP    31L        /* value from dad_audio.device */
  87.     /*
  88.     ** Set damping on output, io_Data = Damping
  89.     ** The maximum is 31 which gives no sound out and minimum is 0, integer steps.
  90.     ** all other except flags and command should be zero
  91.         */
  92.  
  93.  
  94. #define    DADCMD_INPUTGAIN    (CMD_NONSTD+3)
  95. #define    DADCONST_MAXGAIN    15L
  96.     /*
  97.     ** Set gain on input, io_Data = gain
  98.     ** Maximum = 15, minimum = 0 integer steps
  99.     */
  100.  
  101.  
  102. #define    DADCMD_REPLAYFREQ    (CMD_NONSTD+4)
  103.     /*
  104.     ** set playback frequency io_Data = Frequency.
  105.     ** You can only use a couple of frequencies
  106.     ** see below DADFREQ_*
  107.     */
  108.  
  109.  
  110. #define    DADCMD_INIT1        (CMD_NONSTD+5)
  111.     /*
  112.     ** This is called by WaveTools (sampling software)
  113.     ** with all values = 0 except command,
  114.     ** upon return io_Data = an address which is later used
  115.     ** in the set buffer command. I dont know what this is about
  116.     ** maybe it is auto buffer allocation. Maybe it is base address of the
  117.     ** hardware dma zone or something. But since you can set your own bufferspace,
  118.     ** it doesnt matter.
  119.     */
  120.  
  121.  
  122. #define    DADCMD_MUTE        (CMD_NONSTD+6)
  123.     /*
  124.     ** Mute Internal channels output
  125.     ** io_Data = 0 turns sound off
  126.     ** io_Data = 1 turns them on
  127.     */
  128.  
  129.  
  130. #define    DADCMD_SAMPLEFREQ    (CMD_NONSTD+7)
  131.     /*
  132.     ** set sampling frequency io_Data = frequency
  133.     ** I checked dad_audio.device and it did no real checking of the
  134.     ** frequency, maybe it is linked to replay frequency.
  135.     */
  136.  
  137.  
  138. #define    DADCMD_SMPTE        (CMD_NONSTD+15)
  139.     /*
  140.     ** SMPTE port init, E=-1 if hardware is not there.
  141.     ** I cant check anything more because I havent got the hardware :(
  142.     */
  143.  
  144.  
  145. #define    DADCMD_INIT2        (CMD_NONSTD+17)
  146.     /*
  147.     ** This is an interresting command, it is called with
  148.     ** io_Data = (DADF_SET | DADF_INIT) (ie. $80000001) by wavetools
  149.     ** prior to setting frequency,damping and such.
  150.     ** I dont know what it is, could be internal status bits or something.
  151.     */
  152.  
  153.  
  154. #define    DAD_DEVICENAME "dad_audio.device"
  155.  
  156. /*
  157. ** Flags
  158. */
  159. #define    DADB_INIT    0L
  160. #define DADB_SETFLAG    31L
  161.  
  162. #define    DADF_INIT    (1L << 0)    /* $00000001 */
  163. #define DADF_SETFLAG    (1L << 31)    /* $80000000 */
  164.  
  165.  
  166. /*
  167. ** Frequencies
  168. */
  169. #define DADFREQ_48000    48000;    /* These values are checked for in dad_audio.device     */
  170. #define DADFREQ_44100    44100;    /* I guess they are the only frequencys alowed        */
  171. #define DADFREQ_32000    32000;    /* they are valid for both sampling and playback    */
  172. #define DADFREQ_29400    29400;
  173. #define DADFREQ_24000    24000;
  174. #define DADFREQ_22050    22050;
  175. #define DADFREQ_19200    19200;
  176. #define DADFREQ_17640    17640;
  177.  
  178.  
  179. #endif    /* DAD_AUDIO_H  */
  180.