diff --git a/compile.sh b/compile.sh new file mode 100755 index 0000000..d2faaf4 --- /dev/null +++ b/compile.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +if [ $# -eq 0 ]; then + echo "No arguments supplied!" + echo "Possible Arguments: $0 [TARGET_XM32, TARGET_WING, TARGET_PC_SDL2]" + exit +fi +BUILD_TARGET=$1 + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +BUILD_DIR="${ROOT_DIR}/build" + +LIB_EXT_DIR="${ROOT_DIR}/lib_ext" + +LVGL_DIR="${LIB_EXT_DIR}/lvgl" +GLAZE_DIR="${LIB_EXT_DIR}/glaze" +LIBARTNET_DIR="${LIB_EXT_DIR}/libartnet" +DOCTEST_DIR="${LIB_EXT_DIR}/doctest" +OSC_DIR="${LIB_EXT_DIR}/small-osc" + +mkdir -p "${BUILD_DIR}" + +# create folder if not present +if [ ! -d "$LIB_EXT_DIR" ]; then + mkdir -p "$LIB_EXT_DIR" +fi + +# acquire external libraries +git clone --depth 1 --single-branch --branch v9.5.0 https://github.com/lvgl/lvgl.git ${LVGL_DIR} || git -C ${LVGL_DIR} reset --hard HEAD +git clone --depth 1 --single-branch --branch v7.7.1 https://github.com/stephenberry/glaze.git ${GLAZE_DIR} || git -C ${GLAZE_DIR} reset --hard HEAD +git clone --depth 1 --single-branch https://github.com/OpenLightingProject/libartnet.git ${LIBARTNET_DIR} || git -C ${LIBARTNET_DIR} reset --hard HEAD +git clone --depth 1 --single-branch --branch v2.5.2 https://github.com/doctest/doctest.git ${DOCTEST_DIR} || git -C ${DOCTEST_DIR} reset --hard HEAD +git clone --depth 1 --single-branch https://github.com/OpenMixerProject/SmallOSC.git ${OSC_DIR} || git -C ${OSC_DIR} reset --hard HEAD + +make ROOT_DIR=${ROOT_DIR} BUILD_TARGET=${BUILD_TARGET} -j$(nproc) diff --git a/src/dsp1.cpp b/src/dsp1.cpp index d6f303b..f14a1d4 100644 --- a/src/dsp1.cpp +++ b/src/dsp1.cpp @@ -107,19 +107,22 @@ void DSP1::SendChannelVolume(uint chanIndex) float volumeSub_pu; // check if current channel has an adjustable gain. If not, apply GAIN as TRIM - if (!ChannelHasAdjustableGain(chanIndex)) + if (ChannelHasAdjustableGain(chanIndex)) { - float trim = config->GetFloat(CHANNEL_GAIN, chanIndex); - float trim_pu = pow(10.0f, trim/20.0f); - volumeLR_pu = pow(10.0f, volumeLR/20.0f) * trim_pu; - volumeSub_pu = pow(10.0f, volumeSub/20.0f) * trim_pu; - }else{ // apply digital gain to increase gain-resolution as hardware supports 2.5dB-steps "only" float volumeLR_new = CompensateGainAndVolume(config->GetFloat(CHANNEL_GAIN, chanIndex), volumeLR); float volumeSub_new = CompensateGainAndVolume(config->GetFloat(CHANNEL_GAIN, chanIndex), volumeSub); volumeLR_pu = pow(10.0f, volumeLR_new/20.0f); volumeSub_pu = pow(10.0f, volumeSub_new/20.0f); } + else + { + // GAIN as TRIM + float trim = config->GetFloat(CHANNEL_GAIN, chanIndex); + float trim_pu = pow(10.0f, trim/20.0f); + volumeLR_pu = pow(10.0f, volumeLR/20.0f) * trim_pu; + volumeSub_pu = pow(10.0f, volumeSub/20.0f) * trim_pu; + } // apply DCAs if enabled // loop through all DCA groups diff --git a/src/main.cpp b/src/main.cpp index 067bc0b..133d25a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -327,7 +327,7 @@ int main(int argc, char* argv[]) ->configurable(false); app->add_option("--samplerate", "Set Samplerate to 44100 or 48000 kHz") ->default_val(48000) - ->check(CLI::IsMember(new set{41000, 48000})); + ->check(CLI::IsMember(new set{44100, 48000})); // debugging commandline option app->add_flag("-b,--bodyless", state->bodyless, "Enables a special mode to run omc in a different enviroment than a X32 mixer.") @@ -530,4 +530,4 @@ int main(int argc, char* argv[]) } exit(0); -} \ No newline at end of file +}