File: ump_convert.h

package info (click to toggle)
linux 6.16.9-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,724,628 kB
  • sloc: ansic: 26,562,645; asm: 271,329; sh: 144,039; python: 72,469; makefile: 57,135; perl: 36,821; xml: 19,553; cpp: 5,820; yacc: 4,915; lex: 2,955; awk: 1,667; sed: 28; ruby: 25
file content (47 lines) | stat: -rw-r--r-- 1,282 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef __SOUND_UMP_CONVERT_H
#define __SOUND_UMP_CONVERT_H

#include <sound/ump_msg.h>

/* context for converting from legacy control messages to UMP packet */
struct ump_cvt_to_ump_bank {
	bool rpn_set;
	bool nrpn_set;
	bool bank_set;
	unsigned char cc_rpn_msb, cc_rpn_lsb;
	unsigned char cc_nrpn_msb, cc_nrpn_lsb;
	unsigned char cc_data_msb, cc_data_lsb;
	unsigned char cc_bank_msb, cc_bank_lsb;
	bool cc_data_msb_set, cc_data_lsb_set;
};

/* context for converting from MIDI1 byte stream to UMP packet */
struct ump_cvt_to_ump {
	/* MIDI1 intermediate buffer */
	unsigned char buf[6]; /* up to 6 bytes for SysEx */
	int len;
	int cmd_bytes;

	/* UMP output packet */
	u32 ump[4];
	int ump_bytes;

	/* various status */
	unsigned int in_sysex;
	struct ump_cvt_to_ump_bank bank[16];	/* per channel */
};

int snd_ump_convert_from_ump(const u32 *data, unsigned char *dst,
			     unsigned char *group_ret);
void snd_ump_convert_to_ump(struct ump_cvt_to_ump *cvt, unsigned char group,
			    unsigned int protocol, unsigned char c);

/* reset the converter context, called at each open to ump */
static inline void snd_ump_convert_reset(struct ump_cvt_to_ump *ctx)
{
	memset(ctx, 0, sizeof(*ctx));

}

#endif /* __SOUND_UMP_CONVERT_H */