From 48ec16f3d2a04295767b6bac38aed7bef5180881 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Wed, 29 Jun 2022 18:27:00 +0300 Subject: Added the chip channels allocation mode option --- include/adlmidi.h | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'include/adlmidi.h') diff --git a/include/adlmidi.h b/include/adlmidi.h index 71a67c7..9cf53a8 100644 --- a/include/adlmidi.h +++ b/include/adlmidi.h @@ -125,7 +125,26 @@ enum ADLMIDI_VolumeModels /*! HMI Sound Operating System volume scaling model */ ADLMIDI_VolumeModel_HMI = 10, /*! HMI Sound Operating System volume scaling model, older variant with bugs */ - ADLMIDI_VolumeModel_HMI_OLD = 11 + ADLMIDI_VolumeModel_HMI_OLD = 11, + /*! Count of available volume model modes */ + ADLMIDI_VolumeModel_Count +}; + +/*! + * \brief Algorithms of channel allocation for new notes + */ +enum ADLMIDI_ChannelAlloc +{ + /*! Automatical choise of the method according to the volume model and internal preferrences */ + ADLMIDI_ChanAlloc_AUTO = -1, + /*! Take only channels that has expired sounding delay */ + ADLMIDI_ChanAlloc_OffDelay, + /*! Take any first released channel with the same instrument */ + ADLMIDI_ChanAlloc_SameInst, + /*! Take any first released channel */ + ADLMIDI_ChanAlloc_AnyReleased, + /*! Count of available channel allocation modes */ + ADLMIDI_ChanAlloc_Count }; /** @@ -609,6 +628,20 @@ extern ADLMIDI_DECLSPEC void adl_setVolumeRangeModel(struct ADL_MIDIPlayer *devi */ extern ADLMIDI_DECLSPEC int adl_getVolumeRangeModel(struct ADL_MIDIPlayer *device); +/** + * @brief Set the channel allocation mode + * @param device Instance of the library + * @param chanalloc Channel allocation mode (#ADLMIDI_ChannelAlloc) + */ +extern ADLMIDI_DECLSPEC void adl_setChannelAllocMode(struct ADL_MIDIPlayer *device, int chanalloc); + +/** + * @brief Get the current channel allocation mode + * @param device Instance of the library + * @return Channel allocation mode (#ADLMIDI_ChannelAlloc) + */ +extern ADLMIDI_DECLSPEC int adl_getChannelAllocMode(struct ADL_MIDIPlayer *device); + /** * @brief Load WOPL bank file from File System * -- cgit v1.2.3