usbaudio.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. enum {
  2. master_chan = 0x00,
  3. Speed_control = 0x00,
  4. /* Items below are defined by USB standard: */
  5. Mute_control = 0x01,
  6. Volume_control = 0x02,
  7. Bass_control = 0x03,
  8. Mid_control = 0x04,
  9. Treble_control = 0x05,
  10. Equalizer_control = 0x06,
  11. Agc_control = 0x07,
  12. Delay_control = 0x08,
  13. Bassboost_control = 0x09,
  14. Loudness_control = 0x0a,
  15. /* Items below are defined by implementation: */
  16. Channel_control = 0x0b,
  17. Resolution_control = 0x0c,
  18. Ncontrol,
  19. Selector_control = 0x0d,
  20. sampling_freq_control = 0x01,
  21. };
  22. #define AS_GENERAL 1
  23. #define FORMAT_TYPE 2
  24. #define FORMAT_SPECIFIC 3
  25. #define PCM 1
  26. #define PCM8 2
  27. #define IEEE_FLOAT 3
  28. #define ALAW 4
  29. #define MULAW 5
  30. #define SAMPLING_FREQ_CONTROL 0x01
  31. typedef struct Audioalt Audioalt;
  32. struct Audioalt {
  33. int nchan;
  34. int res;
  35. int subframesize;
  36. int minfreq, maxfreq; /* continuous freqs */
  37. int freqs[8]; /* discrete freqs */
  38. int caps; /* see below for meanings */
  39. };
  40. enum {
  41. /* Audioalt->caps bits */
  42. has_setspeed = 0x1, /* has a speed_set command */
  43. has_pitchset = 0x2, /* has a pitch_set command */
  44. has_contfreq = 0x4, /* frequency continuously variable */
  45. has_discfreq = 0x8, /* discrete set of frequencies */
  46. onefreq = 0x10, /* only one frequency */
  47. maxpkt_only = 0x80, /* packets must be padded to max size */
  48. };
  49. extern int defaultspeed[2];
  50. extern Device *ad;
  51. extern Channel *controlchan;
  52. void audio_interface(Device *d, int n, ulong csp, void *bb, int nb);
  53. void setalt(Device *d, int endpt, int value);
  54. int getalt(Device *d, int endpt);
  55. int setspeed(int rec, int speed);
  56. int setcontrol(int rec, char *name, long *value);
  57. int getspecialcontrol(int rec, int ctl, int req, long *value);
  58. int getcontrol(int rec, char *name, long *value);
  59. int findalt(int rec, int nchan, int res, int speed);
  60. void getcontrols(void);
  61. void serve(void *);
  62. int nbchanprint(Channel *c, char *fmt, ...);
  63. int Aconv(Fmt *fp);