Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 1 | /* |
Chris Rorvick | c078a4a | 2015-01-20 02:20:50 -0600 | [diff] [blame] | 2 | * Line 6 Linux USB driver |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 3 | * |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 4 | * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at) |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 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 | |
| 12 | #ifndef MIDIBUF_H |
| 13 | #define MIDIBUF_H |
| 14 | |
Stefan Hajnoczi | 269edc8 | 2013-01-11 23:08:09 +0100 | [diff] [blame] | 15 | struct midi_buffer { |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 16 | unsigned char *buf; |
| 17 | int size; |
| 18 | int split; |
| 19 | int pos_read, pos_write; |
| 20 | int full; |
| 21 | int command_prev; |
| 22 | }; |
| 23 | |
Stefan Hajnoczi | 269edc8 | 2013-01-11 23:08:09 +0100 | [diff] [blame] | 24 | extern int line6_midibuf_bytes_used(struct midi_buffer *mb); |
| 25 | extern int line6_midibuf_bytes_free(struct midi_buffer *mb); |
| 26 | extern void line6_midibuf_destroy(struct midi_buffer *mb); |
| 27 | extern int line6_midibuf_ignore(struct midi_buffer *mb, int length); |
| 28 | extern int line6_midibuf_init(struct midi_buffer *mb, int size, int split); |
| 29 | extern int line6_midibuf_read(struct midi_buffer *mb, unsigned char *data, |
Markus Grabner | e1a164d | 2010-08-23 01:08:25 +0200 | [diff] [blame] | 30 | int length); |
Stefan Hajnoczi | 269edc8 | 2013-01-11 23:08:09 +0100 | [diff] [blame] | 31 | extern void line6_midibuf_reset(struct midi_buffer *mb); |
Stefan Hajnoczi | 269edc8 | 2013-01-11 23:08:09 +0100 | [diff] [blame] | 32 | extern int line6_midibuf_write(struct midi_buffer *mb, unsigned char *data, |
Markus Grabner | 1027f47 | 2010-08-12 01:35:30 +0200 | [diff] [blame] | 33 | int length); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 34 | |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 35 | #endif |