midi.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Linux driver for TerraTec DMX 6Fire USB
  3. *
  4. * Author: Torsten Schenk <torsten.schenk@zoho.com>
  5. * Created: Jan 01, 2011
  6. * Version: 0.3.0
  7. * Copyright: (C) Torsten Schenk
  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. #ifndef USB6FIRE_MIDI_H
  15. #define USB6FIRE_MIDI_H
  16. #include "common.h"
  17. enum {
  18. MIDI_BUFSIZE = 64
  19. };
  20. struct midi_runtime {
  21. struct sfire_chip *chip;
  22. struct snd_rawmidi *instance;
  23. struct snd_rawmidi_substream *in;
  24. char in_active;
  25. spinlock_t in_lock;
  26. spinlock_t out_lock;
  27. struct snd_rawmidi_substream *out;
  28. struct urb out_urb;
  29. u8 out_serial; /* serial number of out packet */
  30. u8 out_buffer[MIDI_BUFSIZE];
  31. int buffer_offset;
  32. void (*in_received)(struct midi_runtime *rt, u8 *data, int length);
  33. };
  34. int __devinit usb6fire_midi_init(struct sfire_chip *chip);
  35. void usb6fire_midi_abort(struct sfire_chip *chip);
  36. void usb6fire_midi_destroy(struct sfire_chip *chip);
  37. #endif /* USB6FIRE_MIDI_H */