diff --git a/src/sfizz/Config.h b/src/sfizz/Config.h index 52029fbe..b9e62514 100644 --- a/src/sfizz/Config.h +++ b/src/sfizz/Config.h @@ -12,6 +12,7 @@ #endif #define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING #endif +#include "absl/strings/string_view.h" #include #include @@ -62,6 +63,11 @@ namespace config { modulated filter. The lower, the more CPU resources are consumed. */ constexpr int filterControlInterval { 16 }; + /** + Default metadata for MIDIName documents + */ + const absl::string_view midnamManufacturer { "The Sfizz authors" }; + const absl::string_view midnamModel { "Sfizz" }; } // namespace config // Enable or disable SIMD accelerators by default diff --git a/src/sfizz/Synth.cpp b/src/sfizz/Synth.cpp index ce59e159..8e17b7e2 100644 --- a/src/sfizz/Synth.cpp +++ b/src/sfizz/Synth.cpp @@ -581,13 +581,10 @@ int sfz::Synth::getNumCurves() const noexcept std::string sfz::Synth::exportMidnam(absl::string_view model) const { pugi::xml_document doc; - - // TODO: perhaps define this somewhere, or use some metadata from the SFZ - const char *manufacturer = "Paul Ferrand"; - const char *defaultModel = "Sfizz"; + absl::string_view manufacturer = config::midnamManufacturer; if (model.empty()) - model = defaultModel; + model = config::midnamModel; doc.append_child(pugi::node_doctype).set_value( "MIDINameDocument PUBLIC" @@ -603,7 +600,7 @@ std::string sfz::Synth::exportMidnam(absl::string_view model) const pugi::xml_node device = root.append_child("MasterDeviceNames"); device.append_child("Manufacturer") - .append_child(pugi::node_pcdata).set_value(manufacturer); + .append_child(pugi::node_pcdata).set_value(std::string(manufacturer).c_str()); device.append_child("Model") .append_child(pugi::node_pcdata).set_value(std::string(model).c_str());