~ubuntu-branches/ubuntu/warty/alsa-lib/warty

« back to all changes in this revision

Viewing changes to include/sound/ainstr_fm.h

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-09-23 19:38:45 UTC
  • Revision ID: james.westby@ubuntu.com-20040923193845-71lrqesgxij0yzn7
Tags: upstream-1.0.5
ImportĀ upstreamĀ versionĀ 1.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
24
#ifndef __SOUND_AINSTR_FM_H
 
25
#define __SOUND_AINSTR_FM_H
 
26
 
 
27
#ifndef __KERNEL__
 
28
#define __KERNEL__
 
29
#include <asm/types.h>
 
30
#include <asm/byteorder.h>
 
31
#undef __KERNEL__
 
32
#endif
 
33
 
 
34
/*
 
35
 *  share types (share ID 1)
 
36
 */
 
37
 
 
38
#define FM_SHARE_FILE           0
 
39
 
 
40
/*
 
41
 * FM operator
 
42
 */
 
43
 
 
44
typedef struct fm_operator {
 
45
        unsigned char am_vib;
 
46
        unsigned char ksl_level;
 
47
        unsigned char attack_decay;
 
48
        unsigned char sustain_release;
 
49
        unsigned char wave_select;
 
50
} fm_operator_t;
 
51
 
 
52
/*
 
53
 *  Instrument
 
54
 */
 
55
 
 
56
#define FM_PATCH_OPL2   0x01            /* OPL2 2 operators FM instrument */
 
57
#define FM_PATCH_OPL3   0x02            /* OPL3 4 operators FM instrument */
 
58
 
 
59
typedef struct {
 
60
        unsigned int share_id[4];       /* share id - zero = no sharing */
 
61
        unsigned char type;             /* instrument type */
 
62
 
 
63
        fm_operator_t op[4];
 
64
        unsigned char feedback_connection[2];
 
65
 
 
66
        unsigned char echo_delay;
 
67
        unsigned char echo_atten;
 
68
        unsigned char chorus_spread;
 
69
        unsigned char trnsps;
 
70
        unsigned char fix_dur;
 
71
        unsigned char modes;
 
72
        unsigned char fix_key;
 
73
} fm_instrument_t;
 
74
 
 
75
/*
 
76
 *
 
77
 *    Kernel <-> user space
 
78
 *    Hardware (CPU) independent section
 
79
 *
 
80
 *    * = zero or more
 
81
 *    + = one or more
 
82
 *
 
83
 *    fm_xinstrument    FM_STRU_INSTR
 
84
 *
 
85
 */
 
86
 
 
87
#define FM_STRU_INSTR   __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T')
 
88
 
 
89
/*
 
90
 * FM operator
 
91
 */
 
92
 
 
93
typedef struct fm_xoperator {
 
94
        __u8 am_vib;
 
95
        __u8 ksl_level;
 
96
        __u8 attack_decay;
 
97
        __u8 sustain_release;
 
98
        __u8 wave_select;
 
99
} fm_xoperator_t;
 
100
 
 
101
/*
 
102
 *  Instrument
 
103
 */
 
104
 
 
105
typedef struct fm_xinstrument {
 
106
        __u32 stype;                    /* structure type */
 
107
 
 
108
        __u32 share_id[4];              /* share id - zero = no sharing */
 
109
        __u8 type;                      /* instrument type */
 
110
 
 
111
        fm_xoperator_t op[4];           /* fm operators */
 
112
        __u8 feedback_connection[2];
 
113
 
 
114
        __u8 echo_delay;
 
115
        __u8 echo_atten;
 
116
        __u8 chorus_spread;
 
117
        __u8 trnsps;
 
118
        __u8 fix_dur;
 
119
        __u8 modes;
 
120
        __u8 fix_key;
 
121
} fm_xinstrument_t;
 
122
 
 
123
#ifdef __KERNEL__
 
124
 
 
125
#include "seq_instr.h"
 
126
 
 
127
extern char *snd_seq_fm_id;
 
128
 
 
129
int snd_seq_fm_init(snd_seq_kinstr_ops_t * ops,
 
130
                    snd_seq_kinstr_ops_t * next);
 
131
 
 
132
#endif
 
133
 
 
134
#endif  /* __SOUND_AINSTR_FM_H */