diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-04-12 14:50:24 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-04-12 14:50:24 +0200 |
commit | 20c5726e9442ebaf3711043cc0f317a600fb9c75 (patch) | |
tree | 43bf21f5ebb987bb2c0af957a959458bf99c42d1 /src/drumkit.cc | |
parent | e61e6df43ab0b9014f524abf76ea033086b7dcdf (diff) |
Make sure that drumkit::clear clear all metadata.
Diffstat (limited to 'src/drumkit.cc')
-rw-r--r-- | src/drumkit.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/drumkit.cc b/src/drumkit.cc index 61fabf6..9df9a33 100644 --- a/src/drumkit.cc +++ b/src/drumkit.cc @@ -43,9 +43,11 @@ void DrumKit::clear() channels.clear(); - _name = ""; - _description = ""; - _samplerate = 44100.0f; + // Set all metadata fields to empty values. + metadata = {}; + + // Explicitly set the samplerate default value, since this cannot be 0 + metadata._samplerate = 44100.0f; } bool DrumKit::isValid() const @@ -60,22 +62,22 @@ std::string DrumKit::getFile() const std::string DrumKit::getName() const { - return _name; + return metadata._name; } std::string DrumKit::getDescription() const { - return _description; + return metadata._description; } VersionStr DrumKit::getVersion() const { - return _version; + return metadata._version; } float DrumKit::getSamplerate() const { - return _samplerate; + return metadata._samplerate; } std::size_t DrumKit::getNumberOfFiles() const |