Skip to content

Commit 9d0a7f5

Browse files
committed
Fix control gain
1 parent f8f71bc commit 9d0a7f5

5 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/libs/application/dspxmodel/src/BusControl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <opendspx/buscontrol.h>
44

5+
#include <SVSCraftCore/DecibelLinearizer.h>
6+
57
namespace dspx {
68

79
BusControl::BusControl(Handle handle, Model *model) : Control(handle, model) {
@@ -11,14 +13,14 @@ namespace dspx {
1113

1214
opendspx::BusControl BusControl::toOpenDspx() const {
1315
return {
14-
.gain = gain(),
16+
.gain = SVS::DecibelLinearizer::gainToDecibels(gain()),
1517
.pan = pan(),
1618
.mute = mute()
1719
};
1820
}
1921

2022
void BusControl::fromOpenDspx(const opendspx::BusControl &control) {
21-
setGain(control.gain);
23+
setGain(SVS::DecibelLinearizer::decibelsToGain(control.gain));
2224
setPan(control.pan);
2325
setMute(control.mute);
2426
}

src/libs/application/dspxmodel/src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
1515
qm_configure_target(${PROJECT_NAME}
1616
SOURCES ${_src}
1717
LINKS opendspx::model
18+
LINKS_PRIVATE svscraft::Core
1819
QT_LINKS Core Gui Qml
1920
QT_INCLUDE_PRIVATE Core Gui Qml
2021
INCLUDE_PRIVATE *

src/libs/application/dspxmodel/src/TrackControl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <opendspx/trackcontrol.h>
44

5+
#include <SVSCraftCore/DecibelLinearizer.h>
6+
57
#include <dspxmodel/ModelStrategy.h>
68
#include <dspxmodel/private/Model_p.h>
79

@@ -48,14 +50,14 @@ namespace dspx {
4850

4951
opendspx::TrackControl TrackControl::toOpenDspx() const {
5052
return {
51-
.gain = gain(),
53+
.gain = SVS::DecibelLinearizer::gainToDecibels(gain()),
5254
.pan = pan(),
5355
.mute = mute(),
5456
.solo = solo()
5557
};
5658
}
5759
void TrackControl::fromOpenDspx(const opendspx::TrackControl &trackControl) {
58-
setGain(trackControl.gain);
60+
setGain(SVS::DecibelLinearizer::decibelsToGain(trackControl.gain));
5961
setPan(trackControl.pan);
6062
setMute(trackControl.mute);
6163
setSolo(trackControl.solo);
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
add_subdirectory(dspx)
1+
# TODO obsolete, update it
2+
# add_subdirectory(dspx)

0 commit comments

Comments
 (0)