midi.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Line 6 Linux USB driver
  3. *
  4. * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation, version 2.
  9. *
  10. */
  11. #ifndef MIDI_H
  12. #define MIDI_H
  13. #include <sound/rawmidi.h>
  14. #include "midibuf.h"
  15. #define MIDI_BUFFER_SIZE 1024
  16. struct snd_line6_midi {
  17. /* Pointer back to the Line 6 driver data structure */
  18. struct usb_line6 *line6;
  19. /* MIDI substream for receiving (or NULL if not active) */
  20. struct snd_rawmidi_substream *substream_receive;
  21. /* MIDI substream for transmitting (or NULL if not active) */
  22. struct snd_rawmidi_substream *substream_transmit;
  23. /* Number of currently active MIDI send URBs */
  24. int num_active_send_urbs;
  25. /* Spin lock to protect MIDI buffer handling */
  26. spinlock_t lock;
  27. /* Wait queue for MIDI transmission */
  28. wait_queue_head_t send_wait;
  29. /* Buffer for incoming MIDI stream */
  30. struct midi_buffer midibuf_in;
  31. /* Buffer for outgoing MIDI stream */
  32. struct midi_buffer midibuf_out;
  33. };
  34. extern int line6_init_midi(struct usb_line6 *line6);
  35. extern void line6_midi_receive(struct usb_line6 *line6, unsigned char *data,
  36. int length);
  37. #endif