summaryrefslogtreecommitdiff
path: root/src/instrument.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/instrument.h')
-rw-r--r--src/instrument.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/instrument.h b/src/instrument.h
index 549a5a4..a531aec 100644
--- a/src/instrument.h
+++ b/src/instrument.h
@@ -24,8 +24,7 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __DRUMGIZMO_INSTRUMENT_H__
-#define __DRUMGIZMO_INSTRUMENT_H__
+#pragma once
#include <string>
#include <vector>
@@ -35,32 +34,33 @@
#include "sample.h"
#include "versionstr.h"
+#include "random.h"
#include "settings.h"
-class InstrumentParser;
-class Instrument {
+class Instrument
+{
friend class InstrumentParser;
public:
Instrument(Settings& settings);
~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(const std::string& group);
// std::map<std::string, std::string> channelmap;
std::vector<AudioFile*> audiofiles;
- bool isValid();
+ bool isValid() const;
private:
- void *magic;
+ void* magic;
std::string _group;
std::string _name;
@@ -71,18 +71,16 @@ private:
RangeMap<level_t, Sample*> samples;
PowerList powerlist;
- void addSample(level_t a, level_t b, Sample *s);
+ 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;
size_t lastpos;
float mod;
-
Settings& settings;
+ Random rand;
};
-//typedef std::map< std::string, Instrument > Instruments;
-typedef std::vector< Instrument* > Instruments;
-
-#endif/*__DRUMGIZMO_INSTRUMENT_H__*/
+// typedef std::map< std::string, Instrument > Instruments;
+typedef std::vector<Instrument*> Instruments;