Skip to content

Commit

Permalink
implementing the compressor
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmm committed Nov 14, 2024
1 parent bde5599 commit 8c4f1ea
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 45 deletions.
12 changes: 4 additions & 8 deletions src/compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,20 @@ Compressor::Compressor(const std::string& tag, pw::Manager* pipe_manager, Pipeli
BIND_LV2_PORT("slpm", lpfMode, setLpfMode, db::Compressor::lpfModeChanged);
BIND_LV2_PORT("shpf", hpfFrequency, setHpfFrequency, db::Compressor::hpfFrequencyChanged);
BIND_LV2_PORT("slpf", lpfFrequency, setLpfFrequency, db::Compressor::lpfFrequencyChanged);
BIND_LV2_PORT("cr", ratio, setRatio, db::Compressor::ratioChanged);
BIND_LV2_PORT_DB("scp", sidechainPreamp, setSidechainPreamp, db::Compressor::sidechainPreampChanged, true);
BIND_LV2_PORT_DB("cdr", dry, setDry, db::Compressor::dryChanged, true);
BIND_LV2_PORT_DB("cwt", wet, setWet, db::Compressor::wetChanged, true);
BIND_LV2_PORT_DB("bth", boostThreshold, setBoostThreshold, db::Compressor::boostThresholdChanged, true);
BIND_LV2_PORT_DB("bsa", boostAmount, setBoostAmount, db::Compressor::boostAmountChanged, true);
BIND_LV2_PORT_DB("kn", knee, setKnee, db::Compressor::kneeChanged, true);

// lv2_wrapper->bind_key_double<"at", "attack">(settings);

// lv2_wrapper->bind_key_double<"rt", "release">(settings);

// lv2_wrapper->bind_key_double<"cr", "ratio">(settings);

// lv2_wrapper->bind_key_double_db<"bth", "boost-threshold">(settings);

// lv2_wrapper->bind_key_double_db<"bsa", "boost-amount">(settings);

// lv2_wrapper->bind_key_double_db<"al", "threshold">(settings);

// lv2_wrapper->bind_key_double_db<"kn", "knee">(settings);

// lv2_wrapper->bind_key_double_db<"mk", "makeup">(settings);

// The following controls can assume -inf
Expand Down
2 changes: 0 additions & 2 deletions src/contents/kcfg/easyeffects_db_compressor.kcfgc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ Notifiers=true
DefaultValueGetters=true
Singleton=false
GenerateProperties=true
MemberVariables=public
ItemAccessors=true
104 changes: 69 additions & 35 deletions src/contents/ui/Compressor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,42 @@ Kirigami.ScrollablePage {
}

contentItem: Column {
EeSpinBox {
id: threshold
FormCard.FormComboBoxDelegate {
id: mode

text: i18n("Mode")
displayMode: FormCard.FormComboBoxDelegate.ComboBox
currentIndex: pluginDB.mode
editable: false
model: [i18n("Downward"), i18n("Upward"), i18n("Boosting")]
onActivated: (idx) => {
pluginDB.mode = idx;
}

label: i18n("Threshold")
from: -48
to: 0
value: pluginDB.threshold
anchors {
left: parent.left
right: parent.right
}

}

EeSpinBox {
id: boostThreshold

label: i18n("Boost Threshold")
labelAbove: true
spinboxLayoutFillWidth: true
from: pluginDB.getMinValue("boostThreshold")
to: pluginDB.getMaxValue("boostThreshold")
value: pluginDB.boostThreshold
decimals: 2
stepSize: 0.01
unit: "dB"
minusInfinityMode: true
enabled: mode.currentIndex === 1
visible: mode.currentIndex === 1
onValueModified: (v) => {
pluginDB.threshold = v;
pluginDB.boostThreshold = v;
}

anchors {
Expand All @@ -75,17 +99,22 @@ Kirigami.ScrollablePage {
}

EeSpinBox {
id: attack

label: i18n("Attack")
from: 0.25
to: 20
value: pluginDB.attack
id: boostAmount

label: i18n("Boost Amount")
labelAbove: true
spinboxLayoutFillWidth: true
from: pluginDB.getMinValue("boostAmount")
to: pluginDB.getMaxValue("boostAmount")
value: pluginDB.boostAmount
decimals: 2
stepSize: 0.01
unit: "ms"
unit: "dB"
minusInfinityMode: true
enabled: mode.currentIndex === 2
visible: mode.currentIndex === 2
onValueModified: (v) => {
pluginDB.attack = v;
pluginDB.boostAmount = v;
}

anchors {
Expand All @@ -96,17 +125,19 @@ Kirigami.ScrollablePage {
}

EeSpinBox {
id: release

label: i18n("Release")
from: 0.25
to: 20
value: pluginDB.release
decimals: 2
stepSize: 0.01
unit: "ms"
id: ratio

label: i18n("Ratio")
labelAbove: true
spinboxLayoutFillWidth: true
from: pluginDB.getMinValue("ratio")
to: pluginDB.getMaxValue("ratio")
value: pluginDB.ratio
decimals: 0
stepSize: 1
minusInfinityMode: true
onValueModified: (v) => {
pluginDB.release = v;
pluginDB.ratio = v;
}

anchors {
Expand All @@ -117,17 +148,20 @@ Kirigami.ScrollablePage {
}

EeSpinBox {
id: stereoLink

label: i18n("Stereo Link")
from: pluginDB.getMinValue("stereoLink")
to: pluginDB.getMaxValue("stereoLink")
value: pluginDB.stereoLink
decimals: 1
stepSize: 0.1
unit: "%"
id: knee

label: i18n("Knee")
labelAbove: true
spinboxLayoutFillWidth: true
from: pluginDB.getMinValue("knee")
to: pluginDB.getMaxValue("knee")
value: pluginDB.knee
decimals: 2
stepSize: 0.01
unit: "dB"
minusInfinityMode: true
onValueModified: (v) => {
pluginDB.stereoLink = v;
pluginDB.knee = v;
}

anchors {
Expand Down

0 comments on commit 8c4f1ea

Please sign in to comment.