Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -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)
15 changes: 9 additions & 6 deletions src/dsp1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>(48000)
->check(CLI::IsMember(new set<uint32_t>{41000, 48000}));
->check(CLI::IsMember(new set<uint32_t>{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.")
Expand Down Expand Up @@ -530,4 +530,4 @@ int main(int argc, char* argv[])
}

exit(0);
}
}
Loading