summaryrefslogtreecommitdiff
path: root/src/drumkit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/drumkit.cc')
-rw-r--r--src/drumkit.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/drumkit.cc b/src/drumkit.cc
index 00ab2e2..caceafb 100644
--- a/src/drumkit.cc
+++ b/src/drumkit.cc
@@ -26,13 +26,30 @@
*/
#include "drumkit.h"
+DrumKit::DrumKit()
+{
+ magic = this;
+}
+
DrumKit::~DrumKit()
{
+ magic = NULL;
+ clear();
+}
+
+void DrumKit::clear()
+{
Instruments::iterator i = instruments.begin();
while(i != instruments.end()) {
delete *i;
i++;
}
+ instruments.clear();
+}
+
+bool DrumKit::isValid()
+{
+ return this == magic;
}
std::string DrumKit::name()