diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-03-23 21:57:41 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-03-29 22:43:32 +0200 |
commit | 6ac5946767ba41d7eff9eb8521519007fdc58750 (patch) | |
tree | 3ea70169dfe7568fa97c54c19a6f2de5189ef249 /src/drumkit.cc | |
parent | ef1d7e4478649296ccb17900acc949a604097d66 (diff) |
More cleanup.
Diffstat (limited to 'src/drumkit.cc')
-rw-r--r-- | src/drumkit.cc | 53 |
1 files changed, 18 insertions, 35 deletions
diff --git a/src/drumkit.cc b/src/drumkit.cc index d8596c7..e41bd49 100644 --- a/src/drumkit.cc +++ b/src/drumkit.cc @@ -28,69 +28,52 @@ DrumKit::DrumKit() { - magic = this; + magic = this; } DrumKit::~DrumKit() { - magic = NULL; - clear(); + magic = NULL; + clear(); } void DrumKit::clear() { - Instruments::iterator i = instruments.begin(); - while(i != instruments.end()) { - delete *i; - i++; - } - instruments.clear(); + for(auto& instrument : instruments) + { + delete instrument; + } - channels.clear(); + instruments.clear(); - _name = ""; - _description = ""; - _samplerate = 44100; + channels.clear(); + + _name = ""; + _description = ""; + _samplerate = 44100; } bool DrumKit::isValid() { - return this == magic; + return this == magic; } std::string DrumKit::file() { - return _file; + return _file; } std::string DrumKit::name() { - return _name; + return _name; } std::string DrumKit::description() { - return _description; + return _description; } size_t DrumKit::samplerate() { - return _samplerate; + return _samplerate; } - -#ifdef TEST_DRUMKIT -//Additional dependency files -//deps: -//Required cflags (autoconf vars may be used) -//cflags: -//Required link options (autoconf vars may be used) -//libs: -#include "test.h" - -TEST_BEGIN; - -// TODO: Put some testcode here (see test.h for usable macros). - -TEST_END; - -#endif/*TEST_DRUMKIT*/ |