Skip to content

Commit

Permalink
Merge pull request #3513 from Digitalone1/eeqt
Browse files Browse the repository at this point in the history
Fix plugin credit and check level minimums
  • Loading branch information
wwmm authored Nov 20, 2024
2 parents 66d1572 + 509bf05 commit 579820e
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/contents/ui/Autogain.qml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ Kirigami.ScrollablePage {

footer: RowLayout {
Controls.Label {
text: i18n("Using") + EEtagsPluginPackage.ebur128
text: i18n("Using %1", EEtagsPluginPackage.ebur128)
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: false
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/BassEnhancer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Kirigami.ScrollablePage {

footer: RowLayout {
Controls.Label {
text: i18n("Using") + EEtagsPluginPackage.calf
text: i18n("Using %1", EEtagsPluginPackage.calf)
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: false
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/Compressor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ Kirigami.ScrollablePage {

footer: RowLayout {
Controls.Label {
text: i18n("Using") + EEtagsPluginPackage.lsp
text: i18n("Using %1", EEtagsPluginPackage.lsp)
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: false
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/Crystalizer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Kirigami.ScrollablePage {

footer: RowLayout {
Controls.Label {
text: i18n("Using") + EEtagsPluginPackage.zita
text: i18n("Using %1", EEtagsPluginPackage.zita)
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: false
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/Exciter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Kirigami.ScrollablePage {

footer: RowLayout {
Controls.Label {
text: i18n("Using") + EEtagsPluginPackage.calf
text: i18n("Using %1", EEtagsPluginPackage.calf)
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: false
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/Gate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ Kirigami.ScrollablePage {

footer: RowLayout {
Controls.Label {
text: i18n("Using") + EEtagsPluginPackage.lsp
text: i18n("Using %1", EEtagsPluginPackage.lsp)
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: false
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/Limiter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ Kirigami.ScrollablePage {

footer: RowLayout {
Controls.Label {
text: i18n("Using") + EEtagsPluginPackage.lsp
text: i18n("Using %1", EEtagsPluginPackage.lsp)
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: false
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/Maximizer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Kirigami.ScrollablePage {

footer: RowLayout {
Controls.Label {
text: i18n("Using") + EEtagsPluginPackage.zam
text: i18n("Using %1", EEtagsPluginPackage.zam)
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: false
Expand Down
20 changes: 15 additions & 5 deletions src/contents/ui/PageStreamsEffects.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Kirigami.Page {
required property var pluginsDB
required property var pipelineInstance
property string logTag: "PageStreamsEffects"
property int minLeftLevel: -99
property int minRightLevel: -99

padding: 0
Component.onCompleted: {
Expand Down Expand Up @@ -415,11 +417,19 @@ Kirigami.Page {
id: footerFrameAnimation

onTriggered: {
let left = Number(pipelineInstance.getOutputLevelLeft()).toLocaleString(Qt.locale(), 'f', 0);
let right = Number(pipelineInstance.getOutputLevelRight()).toLocaleString(Qt.locale(), 'f', 0);
let latency = Number(pipelineInstance.getPipeLineLatency()).toLocaleString(Qt.locale(), 'f', 1);
let rate = Number(pipelineInstance.getPipeLineRate()).toLocaleString(Qt.locale(), 'f', 1);
actionLevelValue.text = `${left} ${right} dB`;
let left = Number(pipelineInstance.getOutputLevelLeft());
let right = Number(pipelineInstance.getOutputLevelRight());
if (isNaN(left) || left < minLeftLevel)
left = minLeftLevel;

if (isNaN(right) || right < minRightLevel)
right = minRightLevel;

const localeLeft = left.toLocaleString(Qt.locale(), 'f', 0);
const localeRight = right.toLocaleString(Qt.locale(), 'f', 0);
const latency = Number(pipelineInstance.getPipeLineLatency()).toLocaleString(Qt.locale(), 'f', 1);
const rate = Number(pipelineInstance.getPipeLineRate()).toLocaleString(Qt.locale(), 'f', 1);
actionLevelValue.text = `${localeLeft} ${localeRight} dB`;
actionLatencyValue.text = `${latency} ms`;
actionRateValue.text = `${rate} kHz`;
}
Expand Down
9 changes: 6 additions & 3 deletions src/plugin_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ class PluginBase : public QObject {

float latency_value = 0.0F; // seconds

float input_peak_left = util::minimum_linear_level, input_peak_right = util::minimum_linear_level;
float output_peak_left = util::minimum_linear_level, output_peak_right = util::minimum_linear_level;
// Even if it would be reasonable to initialize the peaks to `util::minimum_db_level`,
// we want the plugins UI and the output level to report 0 db in the initial stage
// (when nothing is playing), so 0.0F is more suitable for this purpose.
float input_peak_left = 0.0F, input_peak_right = 0.0F;
float output_peak_left = 0.0F, output_peak_right = 0.0F;

std::chrono::time_point<std::chrono::system_clock> clock_start;

Expand Down Expand Up @@ -193,4 +196,4 @@ class PluginBase : public QObject {
uint node_id = 0U;

QTimer* native_ui_timer = nullptr;
};
};
8 changes: 2 additions & 6 deletions src/tags_plugin_name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ QList<QString> Model::getBaseNames() {
auto get_id(const QString& name) -> QString {
QRegularExpressionMatch match = id_regex.match(name);

if (match.hasMatch()) {
return match.captured(1);
}

return "";
return match.hasMatch() ? match.captured(1) : "";
}

} // namespace tags::plugin_name
} // namespace tags::plugin_name
26 changes: 13 additions & 13 deletions src/tags_plugin_name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ class Package : public QObject {
Q_OBJECT

public:
CREATE_PROPERTY(QString, bs2b, QStringLiteral(" bs2b"));
CREATE_PROPERTY(QString, calf, QStringLiteral(" Calf Studio Gear"));
CREATE_PROPERTY(QString, deepfilternet, QStringLiteral(" DeepFilterNet"));
CREATE_PROPERTY(QString, ebur128, QStringLiteral(" libebur128"));
CREATE_PROPERTY(QString, ee, QStringLiteral(" Easy Effects"));
CREATE_PROPERTY(QString, lsp, QStringLiteral(" Linux Studio Plugins"));
CREATE_PROPERTY(QString, mda, QStringLiteral(" MDA"));
CREATE_PROPERTY(QString, rnnoise, QStringLiteral(" RNNoise"));
CREATE_PROPERTY(QString, soundTouch, QStringLiteral(" SoundTouch"));
CREATE_PROPERTY(QString, speex, QStringLiteral(" SpeexDSP"));
CREATE_PROPERTY(QString, zam, QStringLiteral(" ZamAudio"));
CREATE_PROPERTY(QString, zita, QStringLiteral(" Zita"));
CREATE_PROPERTY(QString, bs2b, QStringLiteral("bs2b"));
CREATE_PROPERTY(QString, calf, QStringLiteral("Calf Studio Gear"));
CREATE_PROPERTY(QString, deepfilternet, QStringLiteral("DeepFilterNet"));
CREATE_PROPERTY(QString, ebur128, QStringLiteral("libebur128"));
CREATE_PROPERTY(QString, ee, QStringLiteral("Easy Effects"));
CREATE_PROPERTY(QString, lsp, QStringLiteral("Linux Studio Plugins"));
CREATE_PROPERTY(QString, mda, QStringLiteral("MDA"));
CREATE_PROPERTY(QString, rnnoise, QStringLiteral("RNNoise"));
CREATE_PROPERTY(QString, soundTouch, QStringLiteral("SoundTouch"));
CREATE_PROPERTY(QString, speex, QStringLiteral("SpeexDSP"));
CREATE_PROPERTY(QString, zam, QStringLiteral("ZamAudio"));
CREATE_PROPERTY(QString, zita, QStringLiteral("Zita"));
};

} // namespace tags::plugin_package
Expand Down Expand Up @@ -136,4 +136,4 @@ auto get_id(const QString& name) -> QString;

} // namespace tags::plugin_name

#undef CREATE_PROPERTY
#undef CREATE_PROPERTY

0 comments on commit 579820e

Please sign in to comment.