Move the manufacturer and model to Config
This commit is contained in:
parent
30b579feb4
commit
633159c5e1
2 changed files with 9 additions and 6 deletions
|
|
@ -12,6 +12,7 @@
|
||||||
#endif
|
#endif
|
||||||
#define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
|
#define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
|
||||||
#endif
|
#endif
|
||||||
|
#include "absl/strings/string_view.h"
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
|
@ -62,6 +63,11 @@ namespace config {
|
||||||
modulated filter. The lower, the more CPU resources are consumed.
|
modulated filter. The lower, the more CPU resources are consumed.
|
||||||
*/
|
*/
|
||||||
constexpr int filterControlInterval { 16 };
|
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
|
} // namespace config
|
||||||
|
|
||||||
// Enable or disable SIMD accelerators by default
|
// Enable or disable SIMD accelerators by default
|
||||||
|
|
|
||||||
|
|
@ -581,13 +581,10 @@ int sfz::Synth::getNumCurves() const noexcept
|
||||||
std::string sfz::Synth::exportMidnam(absl::string_view model) const
|
std::string sfz::Synth::exportMidnam(absl::string_view model) const
|
||||||
{
|
{
|
||||||
pugi::xml_document doc;
|
pugi::xml_document doc;
|
||||||
|
absl::string_view manufacturer = config::midnamManufacturer;
|
||||||
// TODO: perhaps define this somewhere, or use some metadata from the SFZ
|
|
||||||
const char *manufacturer = "Paul Ferrand";
|
|
||||||
const char *defaultModel = "Sfizz";
|
|
||||||
|
|
||||||
if (model.empty())
|
if (model.empty())
|
||||||
model = defaultModel;
|
model = config::midnamModel;
|
||||||
|
|
||||||
doc.append_child(pugi::node_doctype).set_value(
|
doc.append_child(pugi::node_doctype).set_value(
|
||||||
"MIDINameDocument PUBLIC"
|
"MIDINameDocument PUBLIC"
|
||||||
|
|
@ -603,7 +600,7 @@ std::string sfz::Synth::exportMidnam(absl::string_view model) const
|
||||||
|
|
||||||
pugi::xml_node device = root.append_child("MasterDeviceNames");
|
pugi::xml_node device = root.append_child("MasterDeviceNames");
|
||||||
device.append_child("Manufacturer")
|
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")
|
device.append_child("Model")
|
||||||
.append_child(pugi::node_pcdata).set_value(std::string(model).c_str());
|
.append_child(pugi::node_pcdata).set_value(std::string(model).c_str());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue