GeezerVison is showing github.com — Update opendspx using stdc::JsonValue · diffscope/diffscope-project@4b7e0aa
File treeExpand file treeCollapse file tree Open diff view settings audio/internal/waveformsinger importexportmanager/internal/fileconverters libresvipformatconverter/internal maintenance/internal/addons midiformatconverter/internal
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard Collapse file Copy file name to clipboardExpand all lines: scripts/vcpkg-manifest/vcpkg.json -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 28 | 28 | "platform": "linux" | 29 | 29 | }, | 30 | 30 | "wolf-midi", | 31 | | - "nlohmann-json", | 32 | 31 | "zstd", | 33 | 32 | "opendspx", | 34 | 33 | { | |
Collapse file Copy file name to clipboard Collapse file Copy file name to clipboard Collapse file Copy file name to clipboardExpand all lines: src/plugins/CMakeLists.txt -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,6 @@ qm_find_qt(LinguistTools) | 8 | 8 | set(CURRENT_PLUGIN_DESC "${APPLICATION_NAME} Application Plugin") | 9 | 9 |
| 10 | 10 | find_package(ExtensionSystem CONFIG REQUIRED) | 11 | | -find_package(nlohmann_json CONFIG REQUIRED) | 12 | 11 | find_package(opendspx CONFIG REQUIRED) | 13 | 12 |
| 14 | 13 | function(diffscope_add_builtin_plugin _target) | |
Collapse file Copy file name to clipboardExpand all lines: src/plugins/audio/internal/waveformsinger/WaveformSingerModel.h +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 |
| 14 | 14 | #include <opendspx/anchornode.h> | 15 | 15 | #include <opendspx/vibrato.h> | 16 | | -#include <opendspxinterpolator/parameterinterpolator.h> | 17 | | -#include <opendspxinterpolator/vibratocurve.h> | | 16 | +#include <opendspx/interpolator/parameterinterpolator.h> | | 17 | +#include <opendspx/interpolator/vibratocurve.h> | 18 | 18 |
| 19 | 19 | namespace Audio::Internal { | 20 | 20 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/plugins/coreplugin/core/CoreInterface.cpp +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 38 | 38 |
| 39 | 39 | #include <extensionsystem/pluginmanager.h> | 40 | 40 |
| | 41 | +#include <stdcorelib/support/json.h> | | 42 | + | 41 | 43 | #include <opendspx/model.h> | 42 | 44 |
| 43 | 45 | #include <SVSCraftCore/SVSCraftNamespace.h> | @@ -348,14 +350,14 @@ namespace Core { | 348 | 350 | } | 349 | 351 | }, | 350 | 352 | .workspace = { | 351 | | - {"diffscope", nlohmann::json::object({ | 352 | | - {"keySignatures", nlohmann::json::array({ | 353 | | - nlohmann::json::object({ | | 353 | + {"diffscope", stdc::JsonObject({ | | 354 | + {"keySignatures", stdc::JsonArray({ | | 355 | + stdc::JsonValue(stdc::JsonObject({ | 354 | 356 | {"pos", 0}, | 355 | 357 | {"mode", 2741}, | 356 | 358 | {"tonality", 0}, | 357 | 359 | {"accidentalType", 1} | 358 | | - }) | | 360 | + })) | 359 | 361 | })} | 360 | 362 | })} | 361 | 363 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/plugins/coreplugin/internal/jsonutils.h +16-16Lines changed: 16 additions & 16 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 |
| 7 | 7 | #include <algorithm> | 8 | 8 |
| 9 | | -#include <nlohmann/json.hpp> | | 9 | +#include <stdcorelib/support/json.h> | 10 | 10 |
| 11 | 11 | #include <QJsonArray> | 12 | 12 | #include <QJsonObject> | @@ -16,7 +16,7 @@ namespace Core::Internal { | 16 | 16 |
| 17 | 17 | class JsonUtils { | 18 | 18 | public: | 19 | | - static nlohmann::json fromQJsonValue(const QJsonValue &value) { | | 19 | + static stdc::JsonValue fromQJsonValue(const QJsonValue &value) { | 20 | 20 | if (value.isString()) | 21 | 21 | return value.toString().toStdString(); | 22 | 22 |
| @@ -27,13 +27,13 @@ namespace Core::Internal { | 27 | 27 | return value.toDouble(); | 28 | 28 |
| 29 | 29 | if (value.isArray()) { | 30 | | - nlohmann::json ret = nlohmann::json::array(); | | 30 | + stdc::JsonArray ret; | 31 | 31 | std::ranges::transform(value.toArray(), std::back_inserter(ret), &JsonUtils::fromQJsonValue); | 32 | 32 | return ret; | 33 | 33 | } | 34 | 34 |
| 35 | 35 | if (value.isObject()) { | 36 | | - nlohmann::json ret = nlohmann::json::object(); | | 36 | + stdc::JsonObject ret; | 37 | 37 | for (auto [key, item] : value.toObject().asKeyValueRange()) { | 38 | 38 | ret[key.toString().toStdString()] = fromQJsonValue(item); | 39 | 39 | } | @@ -43,26 +43,26 @@ namespace Core::Internal { | 43 | 43 | return {}; | 44 | 44 | } | 45 | 45 |
| 46 | | - static QJsonValue toQJsonValue(const nlohmann::json &value) { | 47 | | - if (value.is_string()) | 48 | | - return QString::fromStdString(value.get<std::string>()); | | 46 | + static QJsonValue toQJsonValue(const stdc::JsonValue &value) { | | 47 | + if (value.isString()) | | 48 | + return QString::fromStdString(value.toString()); | 49 | 49 |
| 50 | | - if (value.is_boolean()) | 51 | | - return value.get<bool>(); | | 50 | + if (value.isBool()) | | 51 | + return value.toBool(); | 52 | 52 |
| 53 | | - if (value.is_number()) | 54 | | - return value.get<double>(); | | 53 | + if (value.isNumber()) | | 54 | + return value.toDouble(); | 55 | 55 |
| 56 | | - if (value.is_array()) { | | 56 | + if (value.isArray()) { | 57 | 57 | QJsonArray ret; | 58 | | - std::ranges::transform(value, std::back_inserter(ret), &JsonUtils::toQJsonValue); | | 58 | + std::ranges::transform(value.toArray(), std::back_inserter(ret), &JsonUtils::toQJsonValue); | 59 | 59 | return ret; | 60 | 60 | } | 61 | 61 |
| 62 | | - if (value.is_object()) { | | 62 | + if (value.isObject()) { | 63 | 63 | QJsonObject ret; | 64 | | - for (auto it = value.begin(); it != value.end(); ++it) { | 65 | | - ret[it.key().c_str()] = toQJsonValue(it.value()); | | 64 | + for (const auto &[key, item] : value.toObject()) { | | 65 | + ret[QString::fromStdString(key)] = toQJsonValue(item); | 66 | 66 | } | 67 | 67 | return ret; | 68 | 68 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/plugins/coreplugin/project/clipboard/DspxClipboardData.cpp +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 7 | 7 | #include <QJsonObject> | 8 | 8 | #include <QJsonArray> | 9 | 9 |
| 10 | | -#include <opendspxserializer/serializer.h> | 11 | | -#include <opendspxserializer/jsonconverterv1.h> | | 10 | +#include <opendspx/serializer/serializer.h> | | 11 | +#include <opendspx/serializer/jsonconverterv1.h> | 12 | 12 |
| 13 | 13 | #include <coreplugin/internal/jsonutils.h> | 14 | 14 |
| |
Collapse file Copy file name to clipboardExpand all lines: src/plugins/coreplugin/project/clipboard/DspxClipboardData.h +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 |
| 9 | 9 | #include <QList> | 10 | 10 |
| | 11 | +#include <stdcorelib/support/json.h> | | 12 | + | 11 | 13 | #include <opendspx/model.h> | 12 | 14 |
| 13 | 15 | #include <coreplugin/coreglobal.h> | @@ -47,11 +49,11 @@ namespace Core { | 47 | 49 | return std::get<Label>(m_data); | 48 | 50 | } | 49 | 51 |
| 50 | | - void setKeySignatures(const QList<nlohmann::json> &keySignatures) { | | 52 | + void setKeySignatures(const QList<stdc::JsonValue> &keySignatures) { | 51 | 53 | m_data = keySignatures; | 52 | 54 | } | 53 | 55 |
| 54 | | - QList<nlohmann::json> keySignatures() const { | | 56 | + QList<stdc::JsonValue> keySignatures() const { | 55 | 57 | return std::get<KeySignature>(m_data); | 56 | 58 | } | 57 | 59 |
| @@ -120,7 +122,7 @@ namespace Core { | 120 | 122 | std::variant< | 121 | 123 | QList<opendspx::Tempo>, | 122 | 124 | QList<opendspx::Label>, | 123 | | - QList<nlohmann::json>, | | 125 | + QList<stdc::JsonValue>, | 124 | 126 | QList<opendspx::Track>, | 125 | 127 | QList<std::vector<opendspx::ClipRef>>, | 126 | 128 | QList<opendspx::Note>, | |
|