aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/adlmidi.h21
-rw-r--r--src/adlmidi.cpp24
-rw-r--r--src/adlmidi_opl3.cpp18
-rw-r--r--src/adlmidi_private.hpp5
4 files changed, 68 insertions, 0 deletions
diff --git a/include/adlmidi.h b/include/adlmidi.h
index e2bc035..eb3edf4 100644
--- a/include/adlmidi.h
+++ b/include/adlmidi.h
@@ -362,6 +362,13 @@ extern ADLMIDI_DECLSPEC void adl_setPercMode(struct ADL_MIDIPlayer *device, int
extern ADLMIDI_DECLSPEC void adl_setHVibrato(struct ADL_MIDIPlayer *device, int hvibro);
/**
+ * @brief Get the deep vibrato state.
+ * @param device Instance of the library
+ * @return deep vibrato state on success, <0 when any error has occurred
+ */
+extern ADLMIDI_DECLSPEC int adl_getHVibrato(struct ADL_MIDIPlayer *device);
+
+/**
* @brief Override Enable(1) or Disable(0) deep tremolo state. -1 - use bank default tremolo state
* @param device Instance of the library
* @param htremo 0 - disabled, 1 - enabled
@@ -369,6 +376,13 @@ extern ADLMIDI_DECLSPEC void adl_setHVibrato(struct ADL_MIDIPlayer *device, int
extern ADLMIDI_DECLSPEC void adl_setHTremolo(struct ADL_MIDIPlayer *device, int htremo);
/**
+ * @brief Get the deep tremolo state.
+ * @param device Instance of the library
+ * @return deep tremolo state on success, <0 when any error has occurred
+ */
+extern ADLMIDI_DECLSPEC int adl_getHTremolo(struct ADL_MIDIPlayer *device);
+
+/**
* @brief Override Enable(1) or Disable(0) scaling of modulator volumes. -1 - use bank default scaling of modulator volumes
* @param device Instance of the library
* @param smod 0 - disabled, 1 - enabled
@@ -416,6 +430,13 @@ extern ADLMIDI_DECLSPEC void adl_setLogarithmicVolumes(struct ADL_MIDIPlayer *de
extern ADLMIDI_DECLSPEC void adl_setVolumeRangeModel(struct ADL_MIDIPlayer *device, int volumeModel);
/**
+ * @brief Get the volume range model
+ * @param device Instance of the library
+ * @return volume model on success, <0 when any error has occurred
+ */
+extern ADLMIDI_DECLSPEC int adl_getVolumeRangeModel(struct ADL_MIDIPlayer *device);
+
+/**
* @brief Load WOPL bank file from File System
*
* Is recommended to call adl_reset() to apply changes to already-loaded file player or real-time.
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index 26a21e4..2d7b672 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -403,6 +403,13 @@ ADLMIDI_EXPORT void adl_setHVibrato(ADL_MIDIPlayer *device, int hvibro)
play->m_synth.commitDeepFlags();
}
+ADLMIDI_EXPORT int adl_getHVibrato(struct ADL_MIDIPlayer *device)
+{
+ if(!device) return -1;
+ MidiPlayer *play = GET_MIDI_PLAYER(device);
+ return play->m_synth.m_deepVibratoMode;
+}
+
ADLMIDI_EXPORT void adl_setHTremolo(ADL_MIDIPlayer *device, int htremo)
{
if(!device) return;
@@ -414,6 +421,13 @@ ADLMIDI_EXPORT void adl_setHTremolo(ADL_MIDIPlayer *device, int htremo)
play->m_synth.commitDeepFlags();
}
+ADLMIDI_EXPORT int adl_getHTremolo(struct ADL_MIDIPlayer *device)
+{
+ if(!device) return -1;
+ MidiPlayer *play = GET_MIDI_PLAYER(device);
+ return play->m_synth.m_deepTremoloMode;
+}
+
ADLMIDI_EXPORT void adl_setScaleModulators(ADL_MIDIPlayer *device, int smod)
{
if(!device)
@@ -490,6 +504,16 @@ ADLMIDI_EXPORT void adl_setVolumeRangeModel(struct ADL_MIDIPlayer *device, int v
play->m_synth.setVolumeScaleModel(static_cast<ADLMIDI_VolumeModels>(volumeModel));
}
+ADLMIDI_EXPORT int adl_getVolumeRangeModel(struct ADL_MIDIPlayer *device)
+{
+ if(!device)
+ return -1;
+ MidiPlayer *play = GET_MIDI_PLAYER(device);
+ if(!play)
+ return -1;
+ return play->m_synth.getVolumeScaleModel();
+}
+
ADLMIDI_EXPORT int adl_openBankFile(struct ADL_MIDIPlayer *device, const char *filePath)
{
if(device && device->adl_midiPlayer)
diff --git a/src/adlmidi_opl3.cpp b/src/adlmidi_opl3.cpp
index aff879a..e486dd6 100644
--- a/src/adlmidi_opl3.cpp
+++ b/src/adlmidi_opl3.cpp
@@ -631,6 +631,24 @@ void OPL3::setVolumeScaleModel(ADLMIDI_VolumeModels volumeModel)
}
}
+ADLMIDI_VolumeModels OPL3::getVolumeScaleModel()
+{
+ switch(m_volumeScale)
+ {
+ default:
+ case OPL3::VOLUME_Generic:
+ return ADLMIDI_VolumeModel_Generic;
+ case OPL3::VOLUME_NATIVE:
+ return ADLMIDI_VolumeModel_NativeOPL3;
+ case OPL3::VOLUME_DMX:
+ return ADLMIDI_VolumeModel_DMX;
+ case OPL3::VOLUME_APOGEE:
+ return ADLMIDI_VolumeModel_APOGEE;
+ case OPL3::VOLUME_9X:
+ return ADLMIDI_VolumeModel_9X;
+ }
+}
+
#ifndef ADLMIDI_HW_OPL
void OPL3::clearChips()
{
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp
index 2fc12a4..d179d72 100644
--- a/src/adlmidi_private.hpp
+++ b/src/adlmidi_private.hpp
@@ -448,6 +448,11 @@ public:
*/
void setVolumeScaleModel(ADLMIDI_VolumeModels volumeModel);
+ /**
+ * @brief Get the volume scaling model
+ */
+ ADLMIDI_VolumeModels getVolumeScaleModel();
+
#ifndef ADLMIDI_HW_OPL
/**
* @brief Clean up all running emulated chip instances