wavelength 1.0.0
Loading...
Searching...
No Matches
InstrumentWin.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
6#include "synth/SampleWin.h"
7#include "utl/Str.h"
9
17public:
24 explicit InstrumentWin(unsigned short program);
25
32
41 int AttachSample(SampleWin *iSampleWin);
42
52
60 int DeleteSampleDescription(int sampleDescID);
61
71 int RemoveSample(SampleWin *sampleWin, std::map<int, int> &removed);
72
78 int GetID() const {
79 return mID;
80 }
81
88 return mName;
89 }
90
96 void SetName(const String &name) {
97 if (name.size() > 0) {
98 mName = name;
99 }
100 }
101
108 return mInstrument;
109 }
110
116 std::map<int, SampleDescWin *> &GetSampleDescs() {
117 return mSampleDescs;
118 }
119
120private:
121 int mID;
122 String mName;
123 Instrument mInstrument;
124 std::map<int, SampleDescWin *> mSampleDescs;
125};
int DeleteSampleDescription(int sampleDescID)
Remove and delete a sample description.
int GetID() const
Report the identifier.
Definition InstrumentWin.h:78
int SetDefaultKeymap(SampleDescWin *sdw)
Put a sample description on the key after the highest base key of the instrument, or on key zero when...
~InstrumentWin()
Delete the sample descriptions.
Instrument & GetInstrument()
Report the program settings.
Definition InstrumentWin.h:107
InstrumentWin(unsigned short program)
Create an instrument, named after its identifier.
String & GetName()
Report the name.
Definition InstrumentWin.h:87
std::map< int, SampleDescWin * > & GetSampleDescs()
Report the sample descriptions.
Definition InstrumentWin.h:116
int AttachSample(SampleWin *iSampleWin)
Add a sample description that plays a sample, named after the sample, on the key after the highest ba...
int RemoveSample(SampleWin *sampleWin, std::map< int, int > &removed)
Remove and delete every sample description that plays a sample.
void SetName(const String &name)
Rename the instrument, unless the new name is empty.
Definition InstrumentWin.h:96
Program settings of one instrument of a bank, shared with the synthesiser on the IOP.
Definition Instrument.h:10
Editor view of one sample description of an instrument.
Definition SampleDescWin.h:12
Editor view of one sample of a bank, tied to the WAV file it was made from.
Definition SampleWin.h:14
Growable text buffer that is also a PrnStream.
Definition string.h:19
unsigned int size() const
Definition Str.h:226