aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/seq_virmidi.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/sound/seq_virmidi.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/sound/seq_virmidi.h')
-rw-r--r--include/sound/seq_virmidi.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/include/sound/seq_virmidi.h b/include/sound/seq_virmidi.h
new file mode 100644
index 000000000000..cf4e2388103f
--- /dev/null
+++ b/include/sound/seq_virmidi.h
@@ -0,0 +1,84 @@
1#ifndef __SOUND_SEQ_VIRMIDI_H
2#define __SOUND_SEQ_VIRMIDI_H
3
4/*
5 * Virtual Raw MIDI client on Sequencer
6 * Copyright (c) 2000 by Takashi Iwai <tiwai@suse.de>,
7 * Jaroslav Kysela <perex@suse.cz>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25#include "rawmidi.h"
26#include "seq_midi_event.h"
27
28typedef struct _snd_virmidi_dev snd_virmidi_dev_t;
29
30/*
31 * device file instance:
32 * This instance is created at each time the midi device file is
33 * opened. Each instance has its own input buffer and MIDI parser
34 * (buffer), and is associated with the device instance.
35 */
36typedef struct _snd_virmidi {
37 struct list_head list;
38 int seq_mode;
39 int client;
40 int port;
41 unsigned int trigger: 1;
42 snd_midi_event_t *parser;
43 snd_seq_event_t event;
44 snd_virmidi_dev_t *rdev;
45 snd_rawmidi_substream_t *substream;
46} snd_virmidi_t;
47
48#define SNDRV_VIRMIDI_SUBSCRIBE (1<<0)
49#define SNDRV_VIRMIDI_USE (1<<1)
50
51/*
52 * device record:
53 * Each virtual midi device has one device instance. It contains
54 * common information and the linked-list of opened files,
55 */
56struct _snd_virmidi_dev {
57 snd_card_t *card; /* associated card */
58 snd_rawmidi_t *rmidi; /* rawmidi device */
59 int seq_mode; /* SNDRV_VIRMIDI_XXX */
60 int device; /* sequencer device */
61 int client; /* created/attached client */
62 int port; /* created/attached port */
63 unsigned int flags; /* SNDRV_VIRMIDI_* */
64 rwlock_t filelist_lock;
65 struct list_head filelist;
66};
67
68/* sequencer mode:
69 * ATTACH = input/output events from midi device are routed to the
70 * attached sequencer port. sequencer port is not created
71 * by virmidi itself.
72 * the input to rawmidi must be processed by passing the
73 * incoming events via snd_virmidi_receive()
74 * DISPATCH = input/output events are routed to subscribers.
75 * sequencer port is created in virmidi.
76 */
77#define SNDRV_VIRMIDI_SEQ_NONE 0
78#define SNDRV_VIRMIDI_SEQ_ATTACH 1
79#define SNDRV_VIRMIDI_SEQ_DISPATCH 2
80
81int snd_virmidi_new(snd_card_t *card, int device, snd_rawmidi_t **rrmidi);
82int snd_virmidi_receive(snd_rawmidi_t *rmidi, snd_seq_event_t *ev);
83
84#endif /* __SOUND_SEQ_VIRMIDI */