midi.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Line 6 Linux USB driver
  4. *
  5. * Copyright (C) 2004-2010 Markus Grabner ([email protected])
  6. */
  7. #ifndef MIDI_H
  8. #define MIDI_H
  9. #include <sound/rawmidi.h>
  10. #include "midibuf.h"
  11. #define MIDI_BUFFER_SIZE 1024
  12. struct snd_line6_midi {
  13. /* Pointer back to the Line 6 driver data structure */
  14. struct usb_line6 *line6;
  15. /* MIDI substream for receiving (or NULL if not active) */
  16. struct snd_rawmidi_substream *substream_receive;
  17. /* MIDI substream for transmitting (or NULL if not active) */
  18. struct snd_rawmidi_substream *substream_transmit;
  19. /* Number of currently active MIDI send URBs */
  20. int num_active_send_urbs;
  21. /* Spin lock to protect MIDI buffer handling */
  22. spinlock_t lock;
  23. /* Wait queue for MIDI transmission */
  24. wait_queue_head_t send_wait;
  25. /* Buffer for incoming MIDI stream */
  26. struct midi_buffer midibuf_in;
  27. /* Buffer for outgoing MIDI stream */
  28. struct midi_buffer midibuf_out;
  29. };
  30. extern int line6_init_midi(struct usb_line6 *line6);
  31. extern void line6_midi_receive(struct usb_line6 *line6, unsigned char *data,
  32. int length);
  33. #endif