2019-08-30 18:19:03 +00:00
|
|
|
// midi for embedded chips,
|
|
|
|
// Copyright 2010 Alex Norman
|
2015-08-20 04:42:28 +00:00
|
|
|
//
|
2019-08-30 18:19:03 +00:00
|
|
|
// This file is part of avr-midi.
|
2015-08-20 04:42:28 +00:00
|
|
|
//
|
2019-08-30 18:19:03 +00:00
|
|
|
// avr-midi is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
2015-08-20 04:42:28 +00:00
|
|
|
//(at your option) any later version.
|
|
|
|
//
|
2019-08-30 18:19:03 +00:00
|
|
|
// avr-midi is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
2015-08-20 04:42:28 +00:00
|
|
|
//
|
2019-08-30 18:19:03 +00:00
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with avr-midi. If not, see <http://www.gnu.org/licenses/>.
|
2015-08-20 04:42:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @brief Function signature definitions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MIDI_FUNCTION_TYPES_H
|
|
|
|
#define MIDI_FUNCTION_TYPES_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
2019-08-30 18:19:03 +00:00
|
|
|
#endif
|
2015-08-20 04:42:28 +00:00
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2019-08-30 18:19:03 +00:00
|
|
|
// forward declaration
|
2015-08-20 04:42:28 +00:00
|
|
|
typedef struct _midi_device MidiDevice;
|
|
|
|
|
2019-08-30 18:19:03 +00:00
|
|
|
typedef void (*midi_one_byte_func_t)(MidiDevice *device, uint8_t byte);
|
|
|
|
typedef void (*midi_two_byte_func_t)(MidiDevice *device, uint8_t byte0, uint8_t byte1);
|
|
|
|
typedef void (*midi_three_byte_func_t)(MidiDevice *device, uint8_t byte0, uint8_t byte1, uint8_t byte2);
|
|
|
|
// all bytes after count bytes should be ignored
|
|
|
|
typedef void (*midi_var_byte_func_t)(MidiDevice *device, uint16_t count, uint8_t byte0, uint8_t byte1, uint8_t byte2);
|
2015-08-20 04:42:28 +00:00
|
|
|
|
2019-08-30 18:19:03 +00:00
|
|
|
// the start byte tells you how far into the sysex message you are, the data_length tells you how many bytes data is
|
|
|
|
typedef void (*midi_sysex_func_t)(MidiDevice *device, uint16_t start_byte, uint8_t data_length, uint8_t *data);
|
2015-08-20 04:42:28 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2019-08-30 18:19:03 +00:00
|
|
|
#endif
|
2015-08-20 04:42:28 +00:00
|
|
|
|
|
|
|
#endif
|