aboutsummaryrefslogtreecommitdiff
path: root/include/adlmidi.h
diff options
context:
space:
mode:
authorJP Cimalando <jpcima@users.noreply.github.com>2018-04-10 12:55:03 +0200
committerJP Cimalando <jpcima@users.noreply.github.com>2018-04-11 18:14:34 +0200
commit0bd662b2d7fc11c0b4c02372f97cf6062940c570 (patch)
tree378dd9714b6496f4f3a28424a468098c63cdf7d3 /include/adlmidi.h
parent47e2f73719ab55075d2d479daea3e9269370d421 (diff)
downloadlibADLMIDI-0bd662b2d7fc11c0b4c02372f97cf6062940c570.tar.gz
libADLMIDI-0bd662b2d7fc11c0b4c02372f97cf6062940c570.tar.bz2
libADLMIDI-0bd662b2d7fc11c0b4c02372f97cf6062940c570.zip
support for 32 bit mixing, and multiple sample formats
Diffstat (limited to 'include/adlmidi.h')
-rw-r--r--include/adlmidi.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/adlmidi.h b/include/adlmidi.h
index b21df2c..8ba8939 100644
--- a/include/adlmidi.h
+++ b/include/adlmidi.h
@@ -65,6 +65,22 @@ enum ADLMIDI_VolumeModels
ADLMIDI_VolumeModel_9X
};
+enum ADLMIDI_SampleType
+{
+ ADLMIDI_SampleType_S16 = 0, /* signed PCM 16-bit */
+ ADLMIDI_SampleType_S8, /* signed PCM 8-bit */
+ ADLMIDI_SampleType_F32, /* float 32-bit */
+ ADLMIDI_SampleType_F64, /* float 64-bit */
+ ADLMIDI_SampleType_Count,
+};
+
+struct ADLMIDI_AudioFormat
+{
+ enum ADLMIDI_SampleType type; /* type of sample */
+ unsigned containerSize; /* size in bytes of the storage type */
+ unsigned sampleOffset; /* distance in bytes between consecutive samples */
+};
+
struct ADL_MIDIPlayer
{
void *adl_midiPlayer;
@@ -237,8 +253,14 @@ extern struct Adl_MarkerEntry adl_metaMarker(struct ADL_MIDIPlayer *device, size
/*Take a sample buffer and iterate MIDI timers */
extern int adl_play(struct ADL_MIDIPlayer *device, int sampleCount, short out[]);
+/*Take a sample buffer and iterate MIDI timers */
+extern int adl_playFormat(struct ADL_MIDIPlayer *device, int sampleCount, ADL_UInt8 left[], ADL_UInt8 right[], const struct ADLMIDI_AudioFormat *format);
+
+/*Generate audio output from chip emulators without iteration of MIDI timers.*/
+extern int adl_generate(struct ADL_MIDIPlayer *device, int sampleCount, short out[]);
+
/*Generate audio output from chip emulators without iteration of MIDI timers.*/
-extern int adl_generate(struct ADL_MIDIPlayer *device, int sampleCount, short *out);
+extern int adl_generateFormat(struct ADL_MIDIPlayer *device, int sampleCount, ADL_UInt8 left[], ADL_UInt8 right[], const struct ADLMIDI_AudioFormat *format);
/**
* @brief Periodic tick handler.