Skip to content

Commit 3021f84

Browse files
committed
Add parameter editor
1 parent af5a6de commit 3021f84

36 files changed

Lines changed: 3950 additions & 57 deletions

src/plugins/audio/internal/waveformsinger/WaveformSingerMetadata.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,33 @@ namespace Audio::Internal {
2424
.showDefaultValue = false,
2525
.showDivision = true,
2626
.normalize = [](const Core::ParameterInfo &self, int value) {
27-
return 1.0 - std::pow((self.topValue - value) / (self.topValue - self.bottomValue), 1.25);
27+
return 1.0 - std::pow(1.0 * (self.topValue - value) / (self.topValue - self.bottomValue), 1.25);
2828
},
2929
.denormalize = [](const Core::ParameterInfo &self, double value) {
3030
return static_cast<int>(self.topValue - std::pow(1.0 - value, 0.8) * (self.topValue - self.bottomValue));
3131
},
32-
.toDisplayString = [](const Core::ParameterInfo &self, int value) {
33-
return QLocale().toString(value / 1000.0, 'f', 3) + QStringLiteral(" dB");
32+
.toDisplayValue = [](const Core::ParameterInfo &, int value) {
33+
return value / 1000.0;
34+
},
35+
.fromDisplayValue = [](const Core::ParameterInfo &, double value) {
36+
return static_cast<int>(value * 1000.0);
37+
},
38+
.toDisplayString = [](const Core::ParameterInfo &, int value) {
39+
return QLocale().toString(value / 1000.0, 'f', 3) + tr(" dB");
40+
}
41+
});
42+
parameters.insert(QStringLiteral("tone_shift"), {
43+
.displayName = tr("Tone shift"),
44+
.bottomValue = -1200,
45+
.topValue = 1200,
46+
.defaultValue = 0,
47+
.fillMode = Core::ParameterInfo::FillMode::BaselineFill,
48+
.valueType = Core::ParameterInfo::ValueType::Relative,
49+
.divisionValue = 0,
50+
.showDefaultValue = true,
51+
.showDivision = false,
52+
.toDisplayString = [](const Core::ParameterInfo &, int value) {
53+
return tr("%Ln cent(s)", nullptr, value);
3454
}
3555
});
3656
info.setParameters(parameters);

src/plugins/coreplugin/internal/CorePlugin.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include <QAKCore/actionregistry.h>
3030

31+
#include <SVSCraftFluentSystemIcons/FluentSystemIcons.h>
3132
#include <SVSCraftQuick/MessageBox.h>
3233
#include <SVSCraftQuick/Theme.h>
3334

@@ -250,8 +251,11 @@ namespace Core::Internal {
250251
}
251252

252253
void CorePlugin::initializeActions() {
253-
CoreInterface::actionRegistry()->addExtension(::getCoreActionExtension());
254-
CoreInterface::actionRegistry()->addIconManifest(":/diffscope/coreplugin/icons/config.json");
254+
auto actionRegistry = CoreInterface::actionRegistry();
255+
actionRegistry->addExtension(::getCoreActionExtension());
256+
for (const auto &iconName : SVS::FluentSystemIcons::getAllIconNames()) {
257+
actionRegistry->addIcon({}, iconName, QUrl(QStringLiteral("image://fluent-system-icons/") + iconName));
258+
}
255259
}
256260

257261
void CorePlugin::initializeSettings() {
@@ -410,6 +414,8 @@ namespace Core::Internal {
410414

411415
f("KeySignaturePropertyEditor", "org.diffscope.core.propertyeditor.keysignature");
412416

417+
f("AnchorNodeParameterPropertyEditor", "org.diffscope.core.propertyeditor.anchornode");
418+
413419
}
414420

415421
void CorePlugin::checkLastRun() {

0 commit comments

Comments
 (0)