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-23 21:57:41 +0100 |
commit | 91b3683ad0b6228bf85eefdb32e2ac3f717bd41c (patch) | |
tree | 8bdfae1492f2a658992d79faf85fab95a645c8bc /src/drumkit.cc | |
parent | 5c04b951ffe53e1a31182bb0814908af8d7f0a6f (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 9590930..b088cb6 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*/ |