summaryrefslogtreecommitdiff
path: root/src/instrument.h
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-03-29 15:44:55 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2016-03-31 17:44:25 +0200
commit44695ff87966053ae090c2dd43ee6ab0a169775d (patch)
tree2f3c9343e0ef18495f031e1918e6557c834e81ab /src/instrument.h
parentbc4e506e48785ce448f18098b96c0d7333abb801 (diff)
API Refactoring for class Instrument
Diffstat (limited to 'src/instrument.h')
-rw-r--r--src/instrument.h58
1 files changed, 30 insertions, 28 deletions
diff --git a/src/instrument.h b/src/instrument.h
index 62f8d01..5dc656d 100644
--- a/src/instrument.h
+++ b/src/instrument.h
@@ -38,50 +38,52 @@
#include "random.h"
class InstrumentParser;
-class Instrument {
- friend class InstrumentParser;
+class Instrument
+{
+ friend class InstrumentParser;
+
public:
- Instrument();
- ~Instrument();
+ Instrument();
+ ~Instrument();
- Sample *sample(level_t level, size_t pos);
+ Sample* sample(level_t level, size_t pos);
- std::string name();
- std::string description();
- std::string group();
+ std::string getName() const;
+ std::string getDescription() const;
+ std::string getGroup() const;
- void setGroup(std::string group);
+ void setGroup(std::string group);
- // std::map<std::string, std::string> channelmap;
+ // std::map<std::string, std::string> channelmap;
- std::vector<AudioFile*> audiofiles;
+ std::vector<AudioFile*> audiofiles;
- bool isValid();
+ bool isValid() const;
private:
- void *magic;
+ void* magic;
- std::string _group;
- std::string _name;
- std::string _description;
+ std::string _group;
+ std::string _name;
+ std::string _description;
- VersionStr version;
+ VersionStr version;
- RangeMap<level_t, Sample*> samples;
- PowerList powerlist;
+ RangeMap<level_t, Sample*> samples;
+ PowerList powerlist;
- void addSample(level_t a, level_t b, Sample *s);
- void finalise(); ///< Signal instrument that no more samples will be added.
+ void addSample(level_t a, level_t b, Sample* s);
+ void finalise(); ///< Signal instrument that no more samples will be added.
- std::vector<Sample*> samplelist;
+ std::vector<Sample*> samplelist;
- size_t lastpos;
- float mod;
+ size_t lastpos;
+ float mod;
- Random rand;
+ Random rand;
};
-//typedef std::map< std::string, Instrument > Instruments;
-typedef std::vector< Instrument* > Instruments;
+// typedef std::map< std::string, Instrument > Instruments;
+typedef std::vector<Instrument*> Instruments;
-#endif/*__DRUMGIZMO_INSTRUMENT_H__*/
+#endif /*__DRUMGIZMO_INSTRUMENT_H__*/