From 22350acc1f699f70cbdac6b5facadd0d6ccc8a7f Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Tue, 7 Nov 2017 01:12:01 +0300 Subject: New API, classic ADLMIDI, and CMake - Attempt to support hardware OPL and add build of classic ADLMIDI into CMake - Added new API functions - Added C++ Extras are needed for classic ADLMIDI player - Error string is no more static. Static variant is kept for initialization errors only. --- include/adlmidi.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'include/adlmidi.h') diff --git a/include/adlmidi.h b/include/adlmidi.h index 24fa4c9..1073721 100644 --- a/include/adlmidi.h +++ b/include/adlmidi.h @@ -104,9 +104,15 @@ extern int adl_openBankData(struct ADL_MIDIPlayer *device, void *mem, long size) /*Returns name of currently used OPL3 emulator*/ extern const char *adl_emulatorName(); -/*Returns string which contains last error message*/ +/*Returns string which contains a version number*/ +extern const char *adl_linkedLibraryVersion(); + +/*Returns string which contains last error message of initialization*/ extern const char *adl_errorString(); +/*Returns string which contains last error message on specific device*/ +extern const char *adl_errorInfo(ADL_MIDIPlayer *device); + /*Initialize ADLMIDI Player device*/ extern struct ADL_MIDIPlayer *adl_init(long sample_rate); @@ -181,6 +187,18 @@ extern int adl_play(struct ADL_MIDIPlayer *device, int sampleCount, short out[] /*Generate audio output from chip emulators without iteration of MIDI timers. 512 samples per channel is a maximum*/ extern int adl_generate(ADL_MIDIPlayer *device, int sampleCount, short *out); +/** + * @brief Periodic tick handler. + * @param device + * @param seconds seconds since last call + * @param granularity don't expect intervals smaller than this, in seconds + * @return desired number of seconds until next call + * + * Use it for Hardware OPL3 mode or when you want to process events differently from adl_play() function. + * DON'T USE IT TOGETHER WITH adl_play()!!! + */ +extern double adl_tickEvents(ADL_MIDIPlayer *device, double seconds, double granuality); + /**Hooks**/ typedef void (*ADL_RawEventHook)(void *userdata, ADL_UInt8 type, ADL_UInt8 subtype, ADL_UInt8 channel, ADL_UInt8 *data, size_t len); -- cgit v1.2.3