aboutsummaryrefslogtreecommitdiff
path: root/src/midi_sequencer.h
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-06-23 01:45:02 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-06-23 01:45:02 +0300
commit12f0c3565a0d7b59629dbb2800df5e887ff6fde3 (patch)
treeb72a8bf5003742d76f4a5c5d55fc363d85b11c73 /src/midi_sequencer.h
parent9c69b10a7a7e7de196db45ab8f39e8be014e2fba (diff)
downloadlibADLMIDI-12f0c3565a0d7b59629dbb2800df5e887ff6fde3.tar.gz
libADLMIDI-12f0c3565a0d7b59629dbb2800df5e887ff6fde3.tar.bz2
libADLMIDI-12f0c3565a0d7b59629dbb2800df5e887ff6fde3.zip
Added little documentation for the sequencer event hooks
Diffstat (limited to 'src/midi_sequencer.h')
-rw-r--r--src/midi_sequencer.h55
1 files changed, 49 insertions, 6 deletions
diff --git a/src/midi_sequencer.h b/src/midi_sequencer.h
index 2a2b543..afbffed 100644
--- a/src/midi_sequencer.h
+++ b/src/midi_sequencer.h
@@ -33,55 +33,98 @@ extern "C" {
#include <stddef.h>
#include <stdint.h>
+/**
+ \brief Real-Time MIDI interface between Sequencer and the Synthesizer
+ */
typedef struct
{
- //! Raw MIDI event hook
+ /*! Raw MIDI event hook */
typedef void (*RawEventHook)(void *userdata, uint8_t type, uint8_t subtype, uint8_t channel, const uint8_t *data, size_t len);
+ /*! MIDI event hook which catches all MIDI events */
RawEventHook onEvent;
+ /*! User data which will be passed through On-Event hook */
void *onEvent_userData;
- //! Library internal debug messages
+ /*! Library internal debug messages */
typedef void (*DebugMessageHook)(void *userdata, const char *fmt, ...);
+ /*! Debug message hook */
DebugMessageHook onDebugMessage;
+ /*! User data which will be passed through Debug Message hook */
void *onDebugMessage_userData;
+ /*! MIDI Run Time event calls user data */
void *rtUserData;
- /* Standard MIDI events. All of them are required! */
+
+ /***************************************************
+ * Standard MIDI events. All of them are required! *
+ ***************************************************/
+
+ /*! Note-On MIDI event */
typedef void (*RtNoteOn)(void *userdata, uint8_t channel, uint8_t note, uint8_t velocity);
+ /*! Note-On MIDI event hook */
RtNoteOn rt_noteOn;
+ /*! Note-Off MIDI event */
typedef void (*RtNoteOff)(void *userdata, uint8_t channel, uint8_t note);
+ /*! Note-Off MIDI event hook */
RtNoteOff rt_noteOff;
+ /*! Note aftertouch MIDI event */
typedef void (*RtNoteAfterTouch)(void *userdata, uint8_t channel, uint8_t note, uint8_t atVal);
+ /*! Note aftertouch MIDI event hook */
RtNoteAfterTouch rt_noteAfterTouch;
+ /*! Channel aftertouch MIDI event */
typedef void (*RtChannelAfterTouch)(void *userdata, uint8_t channel, uint8_t atVal);
+ /*! Channel aftertouch MIDI event hook */
RtChannelAfterTouch rt_channelAfterTouch;
+ /*! Controller change MIDI event */
typedef void (*RtControlerChange)(void *userdata, uint8_t channel, uint8_t type, uint8_t value);
+ /*! Controller change MIDI event hook */
RtControlerChange rt_controllerChange;
+ /*! Patch change MIDI event */
typedef void (*RtPatchChange)(void *userdata, uint8_t channel, uint8_t patch);
+ /*! Patch change MIDI event hook */
RtPatchChange rt_patchChange;
+ /*! Pitch bend MIDI event */
typedef void (*RtPitchBend)(void *userdata, uint8_t channel, uint8_t msb, uint8_t lsb);
+ /*! Pitch bend MIDI event hook */
RtPitchBend rt_pitchBend;
+ /*! System Exclusive MIDI event */
typedef void (*RtSysEx)(void *userdata, const uint8_t *msg, size_t size);
+ /*! System Exclusive MIDI event hook */
RtSysEx rt_systemExclusive;
- /* NonStandard events. There are optional */
- typedef void (*RtRawOPL)(void *userdata, uint8_t reg, uint8_t value);
- RtRawOPL rt_rawOPL;
+ /*******************
+ * Optional events *
+ *******************/
+ /*! Device Switch MIDI event */
typedef void (*RtDeviceSwitch)(void *userdata, size_t track, const char *data, size_t length);
+ /*! Device Switch MIDI event hook */
RtDeviceSwitch rt_deviceSwitch;
+ /*! Get the channels offset for current MIDI device */
typedef uint64_t (*RtCurrentDevice)(void *userdata, size_t track);
+ /*! Get the channels offset for current MIDI device hook. Returms multiple to 16 value. */
RtCurrentDevice rt_currentDevice;
+
+
+ /******************************************
+ * NonStandard events. There are optional *
+ ******************************************/
+
+ /*! [Non-Standard] Pass raw OPL3 data to the chip (when playing IMF files) */
+ typedef void (*RtRawOPL)(void *userdata, uint8_t reg, uint8_t value);
+ /*! [Non-Standard] Pass raw OPL3 data to the chip hook */
+ RtRawOPL rt_rawOPL;
+
} BW_MidiRtInterface;
#ifdef __cplusplus