Changeset 34 for GPL/trunk/alsa-kernel/include/sound/soundfont.h
- Timestamp:
- Dec 11, 2005, 5:57:39 PM (20 years ago)
- File:
-
- 1 edited
-
GPL/trunk/alsa-kernel/include/sound/soundfont.h (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/include/sound/soundfont.h
r33 r34 1 #ifndef __SOUND_SOUNDFONT_H 2 #define __SOUND_SOUNDFONT_H 3 1 4 /* 2 5 * Soundfont defines and definitions. … … 17 20 * You should have received a copy of the GNU General Public License 18 21 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 23 */ 21 22 #ifndef __SOUNDFONT_H23 #define __SOUNDFONT_H24 24 25 25 #include "sfnt_info.h" … … 30 30 #define SF_IS_DRUM_BANK(z) ((z) == 128) 31 31 32 typedefstruct snd_sf_zone {32 struct snd_sf_zone { 33 33 struct snd_sf_zone *next; /* Link to next */ 34 34 unsigned char bank; /* Midi bank for this zone */ … … 36 36 unsigned char mapped; /* True if mapped to something else */ 37 37 38 s oundfont_voice_info_tv; /* All the soundfont parameters */38 struct soundfont_voice_info v; /* All the soundfont parameters */ 39 39 int counter; 40 40 struct snd_sf_sample *sample; /* Link to sample */ … … 43 43 struct snd_sf_zone *next_instr; /* Next zone of this instrument */ 44 44 struct snd_sf_zone *next_zone; /* Next zone in play list */ 45 } snd_sf_zone_t;45 }; 46 46 47 typedefstruct snd_sf_sample {48 s oundfont_sample_info_tv;47 struct snd_sf_sample { 48 struct soundfont_sample_info v; 49 49 int counter; 50 s nd_util_memblk_t*block; /* allocated data block */50 struct snd_util_memblk *block; /* allocated data block */ 51 51 struct snd_sf_sample *next; 52 } snd_sf_sample_t;52 }; 53 53 54 54 /* 55 55 * This represents all the information relating to a soundfont. 56 56 */ 57 typedefstruct snd_soundfont {57 struct snd_soundfont { 58 58 struct snd_soundfont *next; /* Link to next */ 59 59 /*struct snd_soundfont *prev;*/ /* Link to previous */ … … 61 61 short type; /* font type */ 62 62 unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN]; /* identifier */ 63 s nd_sf_zone_t*zones; /* Font information */64 s nd_sf_sample_t*samples; /* The sample headers */65 } snd_soundfont_t;63 struct snd_sf_zone *zones; /* Font information */ 64 struct snd_sf_sample *samples; /* The sample headers */ 65 }; 66 66 67 67 /* 68 68 * Type of the sample access callback 69 69 */ 70 typedef int (*snd_sf_sample_new_t)(void *private_data, snd_sf_sample_t *sp, 71 snd_util_memhdr_t *hdr, const void *buf, long count); 72 typedef int (*snd_sf_sample_free_t)(void *private_data, snd_sf_sample_t *sp, 73 snd_util_memhdr_t *hdr); 74 typedef void (*snd_sf_sample_reset_t)(void *private); 75 76 typedef struct snd_sf_callback { 70 struct snd_sf_callback { 77 71 void *private_data; 78 snd_sf_sample_new_t sample_new; 79 snd_sf_sample_free_t sample_free; 80 snd_sf_sample_reset_t sample_reset; 81 } snd_sf_callback_t; 72 int (*sample_new)(void *private_data, struct snd_sf_sample *sp, 73 struct snd_util_memhdr *hdr, 74 const void __user *buf, long count); 75 int (*sample_free)(void *private_data, struct snd_sf_sample *sp, 76 struct snd_util_memhdr *hdr); 77 void (*sample_reset)(void *private); 78 }; 82 79 83 80 /* 84 81 * List of soundfonts. 85 82 */ 86 typedefstruct snd_sf_list {87 s nd_soundfont_t *currsf; /* The currently open soundfont */83 struct snd_sf_list { 84 struct snd_soundfont *currsf; /* The currently open soundfont */ 88 85 int open_client; /* client pointer for lock */ 89 86 int mem_used; /* used memory size */ 90 s nd_sf_zone_t*presets[SF_MAX_PRESETS];91 s nd_soundfont_t *fonts; /* The list of soundfonts */87 struct snd_sf_zone *presets[SF_MAX_PRESETS]; 88 struct snd_soundfont *fonts; /* The list of soundfonts */ 92 89 int fonts_size; /* number of fonts allocated */ 93 90 int zone_counter; /* last allocated time for zone */ … … 95 92 int zone_locked; /* locked time for zone */ 96 93 int sample_locked; /* locked time for sample */ 97 s nd_sf_callback_tcallback; /* callback functions */98 char sf_locked; /* font lock flag */94 struct snd_sf_callback callback; /* callback functions */ 95 int presets_locked; 99 96 struct semaphore presets_mutex; 100 97 spinlock_t lock; 101 s nd_util_memhdr_t*memhdr;102 } snd_sf_list_t;98 struct snd_util_memhdr *memhdr; 99 }; 103 100 104 101 /* Prototypes for soundfont.c */ 105 int snd_soundfont_load(snd_sf_list_t *sflist, const void *data, long count, int client); 106 int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char *data, 102 int snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data, 103 long count, int client); 104 int snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data, 107 105 long count, int client); 108 int snd_soundfont_close_check(s nd_sf_list_t *sflist, int client);106 int snd_soundfont_close_check(struct snd_sf_list *sflist, int client); 109 107 110 snd_sf_list_t *snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr); 111 void snd_sf_free(snd_sf_list_t *sflist); 108 struct snd_sf_list *snd_sf_new(struct snd_sf_callback *callback, 109 struct snd_util_memhdr *hdr); 110 void snd_sf_free(struct snd_sf_list *sflist); 112 111 113 int snd_soundfont_remove_samples(snd_sf_list_t *sflist); 114 int snd_soundfont_remove_unlocked(snd_sf_list_t *sflist); 115 int snd_soundfont_mem_used(snd_sf_list_t *sflist); 112 int snd_soundfont_remove_samples(struct snd_sf_list *sflist); 113 int snd_soundfont_remove_unlocked(struct snd_sf_list *sflist); 116 114 117 int snd_soundfont_search_zone(s nd_sf_list_t *sflist, int *notep, int vel,115 int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel, 118 116 int preset, int bank, 119 117 int def_preset, int def_bank, 120 s nd_sf_zone_t**table, int max_layers);118 struct snd_sf_zone **table, int max_layers); 121 119 122 120 /* Parameter conversions */ … … 126 124 #define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725); 127 125 extern int snd_sf_vol_table[128]; 126 int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio); 128 127 129 128 130 #endif 129 #endif /* __SOUND_SOUNDFONT_H */
Note:
See TracChangeset
for help on using the changeset viewer.
