midi.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Linux driver for TerraTec DMX 6Fire USB
  3. *
  4. * Author: Torsten Schenk <torsten.schenk@zoho.com>
  5. * Created: Jan 01, 2011
  6. * Copyright: (C) Torsten Schenk
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #ifndef USB6FIRE_MIDI_H
  14. #define USB6FIRE_MIDI_H
  15. #include "common.h"
  16. enum {
  17. MIDI_BUFSIZE = 64
  18. };
  19. struct midi_runtime {
  20. struct sfire_chip *chip;
  21. struct snd_rawmidi *instance;
  22. struct snd_rawmidi_substream *in;
  23. char in_active;
  24. spinlock_t in_lock;
  25. spinlock_t out_lock;
  26. struct snd_rawmidi_substream *out;
  27. struct urb out_urb;
  28. u8 out_serial; /* serial number of out packet */
  29. u8 out_buffer[MIDI_BUFSIZE];
  30. int buffer_offset;
  31. void (*in_received)(struct midi_runtime *rt, u8 *data, int length);
  32. };
  33. int __devinit usb6fire_midi_init(struct sfire_chip *chip);
  34. void usb6fire_midi_abort(struct sfire_chip *chip);
  35. void usb6fire_midi_destroy(struct sfire_chip *chip);
  36. #endif /* USB6FIRE_MIDI_H */