From 7dfaf2d44bc8a551604ebd3dab4702d4b8bd3f7a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 14 Jan 2014 23:33:49 +0100 Subject: [PATCH] Added volumeToMidi() helper function --- include/volume.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/volume.h b/include/volume.h index e393dd8f5..aeb1daf1c 100644 --- a/include/volume.h +++ b/include/volume.h @@ -29,6 +29,7 @@ #include "lmmsconfig.h" #include "lmms_basics.h" +#include "midi.h" const volume_t MinVolume = 0; const volume_t MaxVolume = 200; @@ -50,4 +51,9 @@ typedef struct } surroundVolumeVector; +inline int volumeToMidi( volume_t vol ) +{ + return vol * MidiMaxVelocity / DefaultVolume; +} + #endif