From 44695ff87966053ae090c2dd43ee6ab0a169775d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gl=C3=B6ckner?= Date: Tue, 29 Mar 2016 15:44:55 +0200 Subject: API Refactoring for class Instrument --- src/instrument.h | 58 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'src/instrument.h') 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 channelmap; + // std::map channelmap; - std::vector audiofiles; + std::vector 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 samples; - PowerList powerlist; + RangeMap 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 samplelist; + std::vector 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 Instruments; -#endif/*__DRUMGIZMO_INSTRUMENT_H__*/ +#endif /*__DRUMGIZMO_INSTRUMENT_H__*/ -- cgit v1.2.3