sound_config.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* sound_config.h
  2.  *
  3.  * A driver for sound cards, misc. configuration parameters.
  4.  */
  5. /*
  6.  * Copyright (C) by Hannu Savolainen 1993-1997
  7.  *
  8.  * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
  9.  * Version 2 (June 1991). See the "COPYING" file distributed with this software
  10.  * for more info.
  11.  */
  12. #ifndef  _SOUND_CONFIG_H_
  13. #define  _SOUND_CONFIG_H_
  14. #include <linux/config.h>
  15. #include <linux/fs.h>
  16. #include <linux/sound.h>
  17. #include "os.h"
  18. #include "soundvers.h"
  19. #ifndef SND_DEFAULT_ENABLE
  20. #define SND_DEFAULT_ENABLE 1
  21. #endif
  22. #ifndef MAX_REALTIME_FACTOR
  23. #define MAX_REALTIME_FACTOR 4
  24. #endif
  25. /*
  26.  * Use always 64k buffer size. There is no reason to use shorter.
  27.  */
  28. #undef DSP_BUFFSIZE
  29. #define DSP_BUFFSIZE (64*1024)
  30. #ifndef DSP_BUFFCOUNT
  31. #define DSP_BUFFCOUNT 1 /* 1 is recommended. */
  32. #endif
  33. #define FM_MONO 0x388 /* This is the I/O address used by AdLib */
  34. #ifndef CONFIG_PAS_BASE
  35. #define CONFIG_PAS_BASE 0x388
  36. #endif
  37. /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
  38.    driver. (There is no need to alter this) */
  39. #define SEQ_MAX_QUEUE 1024
  40. #define SBFM_MAXINSTR (256) /* Size of the FM Instrument bank */
  41. /* 128 instruments for general MIDI setup and 16 unassigned  */
  42. #define SND_NDEVS 256 /* Number of supported devices */
  43. #define DSP_DEFAULT_SPEED 8000
  44. #define MAX_AUDIO_DEV 5
  45. #define MAX_MIXER_DEV 5
  46. #define MAX_SYNTH_DEV 5
  47. #define MAX_MIDI_DEV 6
  48. #define MAX_TIMER_DEV 4
  49. struct address_info {
  50. int io_base;
  51. int irq;
  52. int dma;
  53. int dma2;
  54. int always_detect; /* 1=Trust me, it's there */
  55. char *name;
  56. int driver_use_1; /* Driver defined field 1 */
  57. int driver_use_2; /* Driver defined field 2 */
  58. int *osp; /* OS specific info */
  59. int card_subtype; /* Driver specific. Usually 0 */
  60. void *memptr;           /* Module memory chainer */
  61. int slots[6];           /* To remember driver slot ids */
  62. };
  63. #define SYNTH_MAX_VOICES 32
  64. struct voice_alloc_info {
  65. int max_voice;
  66. int used_voices;
  67. int ptr; /* For device specific use */
  68. unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
  69. int timestamp;
  70. int alloc_times[SYNTH_MAX_VOICES];
  71. };
  72. struct channel_info {
  73. int pgm_num;
  74. int bender_value;
  75. int bender_range;
  76. unsigned char controllers[128];
  77. };
  78. /*
  79.  * Process wakeup reasons
  80.  */
  81. #define WK_NONE 0x00
  82. #define WK_WAKEUP 0x01
  83. #define WK_TIMEOUT 0x02
  84. #define WK_SIGNAL 0x04
  85. #define WK_SLEEP 0x08
  86. #define WK_SELECT 0x10
  87. #define WK_ABORT 0x20
  88. #define OPEN_READ PCM_ENABLE_INPUT
  89. #define OPEN_WRITE PCM_ENABLE_OUTPUT
  90. #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
  91. #if OPEN_READ == FMODE_READ && OPEN_WRITE == FMODE_WRITE
  92. static inline int translate_mode(struct file *file)
  93. {
  94. return file->f_mode;
  95. }
  96. #else
  97. static inline int translate_mode(struct file *file)
  98. {
  99. return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) |
  100. ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0);
  101. }
  102. #endif
  103. #include "sound_calls.h"
  104. #include "dev_table.h"
  105. #ifndef DEB
  106. #define DEB(x)
  107. #endif
  108. #ifndef DDB
  109. #define DDB(x) {}
  110. #endif
  111. #ifndef MDB
  112. #ifdef MODULE
  113. #define MDB(x) x
  114. #else
  115. #define MDB(x)
  116. #endif
  117. #endif
  118. #define TIMER_ARMED 121234
  119. #define TIMER_NOT_ARMED 1
  120. #endif