summaryrefslogtreecommitdiff
path: root/src/instrumentparser.cc
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-05-27 09:25:32 +0200
committerChristian Glöckner <cgloeckner@freenet.de>2016-05-27 09:25:32 +0200
commit66bfac5a0ae1068908639dd0190433f5ab430473 (patch)
tree0f95d007c9bc06697cc6f2588a52717417e6611f /src/instrumentparser.cc
parent3846acf047ff9a37d0cb7bedf7fb7faa46473111 (diff)
Instrument holds AudioFile via unique_ptr
Diffstat (limited to 'src/instrumentparser.cc')
-rw-r--r--src/instrumentparser.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/instrumentparser.cc b/src/instrumentparser.cc
index 1e42cc3..b42accd 100644
--- a/src/instrumentparser.cc
+++ b/src/instrumentparser.cc
@@ -31,6 +31,7 @@
#include <hugin.hpp>
+#include "cpp11fix.h"
#include "path.h"
#include "nolocale.h"
@@ -141,18 +142,17 @@ void InstrumentParser::startTag(const std::string& name, const attr_t& attr)
filechannel = filechannel - 1; // 1-based in file but zero-based internally.
- AudioFile *audio_file =
- new AudioFile(path + "/" + attr.at("file"), filechannel);
+ auto audio_file = std::make_unique<AudioFile>(path + "/" + attr.at("file"), filechannel);
// TODO: This is not deleted anywhere...
InstrumentChannel *instrument_channel =
new InstrumentChannel(attr.at("channel"));
channellist.push_back(instrument_channel);
- sample->addAudioFile(instrument_channel, audio_file);
+ sample->addAudioFile(instrument_channel, audio_file.get());
// Transfer audio_file ownership to the instrument.
- instrument.audiofiles.push_back(audio_file);
+ instrument.audiofiles.push_back(std::move(audio_file));
}
if(name == "velocities")