summaryrefslogtreecommitdiff
path: root/src/drumkit.cc
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-03-29 15:36:53 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2016-03-31 17:35:47 +0200
commitbc4e506e48785ce448f18098b96c0d7333abb801 (patch)
tree1f282fe53493fe0292ef51a791c8f61283e44542 /src/drumkit.cc
parent1a8361a1f6a1bf442d474cf5baf2e9a09f511777 (diff)
API Refactoring for class Drumkit
Diffstat (limited to 'src/drumkit.cc')
-rw-r--r--src/drumkit.cc65
1 files changed, 33 insertions, 32 deletions
diff --git a/src/drumkit.cc b/src/drumkit.cc
index d8596c7..1b95c87 100644
--- a/src/drumkit.cc
+++ b/src/drumkit.cc
@@ -28,63 +28,64 @@
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();
-
- channels.clear();
-
- _name = "";
- _description = "";
- _samplerate = 44100;
+ Instruments::iterator i = instruments.begin();
+ while(i != instruments.end())
+ {
+ delete *i;
+ i++;
+ }
+ instruments.clear();
+
+ channels.clear();
+
+ _name = "";
+ _description = "";
+ _samplerate = 44100;
}
-bool DrumKit::isValid()
+bool DrumKit::isValid() const
{
- return this == magic;
+ return this == magic;
}
-std::string DrumKit::file()
+std::string DrumKit::getFile() const
{
- return _file;
+ return _file;
}
-std::string DrumKit::name()
+std::string DrumKit::getName() const
{
- return _name;
+ return _name;
}
-std::string DrumKit::description()
+std::string DrumKit::getDescription() const
{
- return _description;
+ return _description;
}
-size_t DrumKit::samplerate()
+size_t DrumKit::getSamplerate() const
{
- 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:
+// 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;
@@ -93,4 +94,4 @@ TEST_BEGIN;
TEST_END;
-#endif/*TEST_DRUMKIT*/
+#endif /*TEST_DRUMKIT*/