Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Line 6 Linux USB driver
0004  *
0005  * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
0006  */
0007 
0008 #ifndef MIDI_H
0009 #define MIDI_H
0010 
0011 #include <sound/rawmidi.h>
0012 
0013 #include "midibuf.h"
0014 
0015 #define MIDI_BUFFER_SIZE 1024
0016 
0017 struct snd_line6_midi {
0018     /* Pointer back to the Line 6 driver data structure */
0019     struct usb_line6 *line6;
0020 
0021     /* MIDI substream for receiving (or NULL if not active) */
0022     struct snd_rawmidi_substream *substream_receive;
0023 
0024     /* MIDI substream for transmitting (or NULL if not active) */
0025     struct snd_rawmidi_substream *substream_transmit;
0026 
0027     /* Number of currently active MIDI send URBs */
0028     int num_active_send_urbs;
0029 
0030     /* Spin lock to protect MIDI buffer handling */
0031     spinlock_t lock;
0032 
0033     /* Wait queue for MIDI transmission */
0034     wait_queue_head_t send_wait;
0035 
0036     /* Buffer for incoming MIDI stream */
0037     struct midi_buffer midibuf_in;
0038 
0039     /* Buffer for outgoing MIDI stream */
0040     struct midi_buffer midibuf_out;
0041 };
0042 
0043 extern int line6_init_midi(struct usb_line6 *line6);
0044 extern void line6_midi_receive(struct usb_line6 *line6, unsigned char *data,
0045                    int length);
0046 
0047 #endif