Ignore:
Timestamp:
Dec 11, 2005, 5:57:39 PM (20 years ago)
Author:
vladest
Message:

Latest update from ALSA. some intial > 15 interrupts support

File:
1 edited

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
    14/*
    25 *  Soundfont defines and definitions.
     
    1720 *   You should have received a copy of the GNU General Public License
    1821 *   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
    2023 */
    21 
    22 #ifndef __SOUNDFONT_H
    23 #define __SOUNDFONT_H
    2424
    2525#include "sfnt_info.h"
     
    3030#define SF_IS_DRUM_BANK(z) ((z) == 128)
    3131
    32 typedef struct snd_sf_zone {
     32struct snd_sf_zone {
    3333        struct snd_sf_zone *next;       /* Link to next */
    3434        unsigned char bank;             /* Midi bank for this zone */
     
    3636        unsigned char mapped;           /* True if mapped to something else */
    3737
    38         soundfont_voice_info_t v;       /* All the soundfont parameters */
     38        struct soundfont_voice_info v;  /* All the soundfont parameters */
    3939        int counter;
    4040        struct snd_sf_sample *sample;   /* Link to sample */
     
    4343        struct snd_sf_zone *next_instr; /* Next zone of this instrument */
    4444        struct snd_sf_zone *next_zone;  /* Next zone in play list */
    45 } snd_sf_zone_t;
     45};
    4646
    47 typedef struct snd_sf_sample {
    48         soundfont_sample_info_t v;
     47struct snd_sf_sample {
     48        struct soundfont_sample_info v;
    4949        int counter;
    50         snd_util_memblk_t *block;       /* allocated data block */
     50        struct snd_util_memblk *block;  /* allocated data block */
    5151        struct snd_sf_sample *next;
    52 } snd_sf_sample_t;
     52};
    5353
    5454/*
    5555 * This represents all the information relating to a soundfont.
    5656 */
    57 typedef struct snd_soundfont {
     57struct snd_soundfont {
    5858        struct snd_soundfont *next;     /* Link to next */
    5959        /*struct snd_soundfont *prev;*/ /* Link to previous */
     
    6161        short  type;            /* font type */
    6262        unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN];  /* identifier */
    63         snd_sf_zone_t *zones; /* Font information */
    64         snd_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};
    6666
    6767/*
    6868 * Type of the sample access callback
    6969 */
    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 {
     70struct snd_sf_callback {
    7771        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};
    8279
    8380/*
    8481 * List of soundfonts.
    8582 */
    86 typedef struct snd_sf_list {
    87         snd_soundfont_t *currsf; /* The currently open soundfont */
     83struct snd_sf_list {
     84        struct snd_soundfont *currsf; /* The currently open soundfont */
    8885        int open_client;        /* client pointer for lock */
    8986        int mem_used;           /* used memory size */
    90         snd_sf_zone_t *presets[SF_MAX_PRESETS];
    91         snd_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 */
    9289        int fonts_size; /* number of fonts allocated */
    9390        int zone_counter;       /* last allocated time for zone */
     
    9592        int zone_locked;        /* locked time for zone */
    9693        int sample_locked;      /* locked time for sample */
    97         snd_sf_callback_t callback;     /* callback functions */
    98         char sf_locked;         /* font lock flag */
     94        struct snd_sf_callback callback;        /* callback functions */
     95        int presets_locked;
    9996        struct semaphore presets_mutex;
    10097        spinlock_t lock;
    101         snd_util_memhdr_t *memhdr;
    102 } snd_sf_list_t;
     98        struct snd_util_memhdr *memhdr;
     99};
    103100
    104101/* 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,
     102int snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
     103                       long count, int client);
     104int snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,
    107105                                long count, int client);
    108 int snd_soundfont_close_check(snd_sf_list_t *sflist, int client);
     106int snd_soundfont_close_check(struct snd_sf_list *sflist, int client);
    109107
    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);
     108struct snd_sf_list *snd_sf_new(struct snd_sf_callback *callback,
     109                               struct snd_util_memhdr *hdr);
     110void snd_sf_free(struct snd_sf_list *sflist);
    112111
    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);
     112int snd_soundfont_remove_samples(struct snd_sf_list *sflist);
     113int snd_soundfont_remove_unlocked(struct snd_sf_list *sflist);
    116114
    117 int snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,
     115int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
    118116                              int preset, int bank,
    119117                              int def_preset, int def_bank,
    120                               snd_sf_zone_t **table, int max_layers);
     118                              struct snd_sf_zone **table, int max_layers);
    121119
    122120/* Parameter conversions */
     
    126124#define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725);
    127125extern int snd_sf_vol_table[128];
     126int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio);
    128127
    129128
    130 #endif
     129#endif /* __SOUND_SOUNDFONT_H */
Note: See TracChangeset for help on using the changeset viewer.