ainstr_fm.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * Advanced Linux Sound Architecture
  3. *
  4. * FM (OPL2/3) Instrument Format
  5. * Copyright (c) 2000 Uros Bizjak <uros@kss-loka.si>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #ifndef __SOUND_AINSTR_FM_H
  24. #define __SOUND_AINSTR_FM_H
  25. #ifndef __KERNEL__
  26. #include <asm/types.h>
  27. #include <asm/byteorder.h>
  28. #endif
  29. /*
  30. * share types (share ID 1)
  31. */
  32. #define FM_SHARE_FILE 0
  33. /*
  34. * FM operator
  35. */
  36. struct fm_operator {
  37. unsigned char am_vib;
  38. unsigned char ksl_level;
  39. unsigned char attack_decay;
  40. unsigned char sustain_release;
  41. unsigned char wave_select;
  42. };
  43. /*
  44. * Instrument
  45. */
  46. #define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */
  47. #define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */
  48. struct fm_instrument {
  49. unsigned int share_id[4]; /* share id - zero = no sharing */
  50. unsigned char type; /* instrument type */
  51. struct fm_operator op[4];
  52. unsigned char feedback_connection[2];
  53. unsigned char echo_delay;
  54. unsigned char echo_atten;
  55. unsigned char chorus_spread;
  56. unsigned char trnsps;
  57. unsigned char fix_dur;
  58. unsigned char modes;
  59. unsigned char fix_key;
  60. };
  61. /*
  62. *
  63. * Kernel <-> user space
  64. * Hardware (CPU) independent section
  65. *
  66. * * = zero or more
  67. * + = one or more
  68. *
  69. * fm_xinstrument FM_STRU_INSTR
  70. *
  71. */
  72. #define FM_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
  73. /*
  74. * FM operator
  75. */
  76. struct fm_xoperator {
  77. __u8 am_vib;
  78. __u8 ksl_level;
  79. __u8 attack_decay;
  80. __u8 sustain_release;
  81. __u8 wave_select;
  82. };
  83. /*
  84. * Instrument
  85. */
  86. struct fm_xinstrument {
  87. __u32 stype; /* structure type */
  88. __u32 share_id[4]; /* share id - zero = no sharing */
  89. __u8 type; /* instrument type */
  90. struct fm_xoperator op[4]; /* fm operators */
  91. __u8 feedback_connection[2];
  92. __u8 echo_delay;
  93. __u8 echo_atten;
  94. __u8 chorus_spread;
  95. __u8 trnsps;
  96. __u8 fix_dur;
  97. __u8 modes;
  98. __u8 fix_key;
  99. };
  100. #ifdef __KERNEL__
  101. #include "seq_instr.h"
  102. int snd_seq_fm_init(struct snd_seq_kinstr_ops * ops,
  103. struct snd_seq_kinstr_ops * next);
  104. #endif
  105. /* typedefs for compatibility to user-space */
  106. typedef struct fm_xoperator fm_xoperator_t;
  107. typedef struct fm_xinstrument fm_xinstrument_t;
  108. #endif /* __SOUND_AINSTR_FM_H */