47 |
class Group; |
class Group; |
48 |
class Instrument; |
class Instrument; |
49 |
class File; |
class File; |
50 |
|
class LookupTable; |
51 |
|
|
52 |
class Sample : public LinuxSampler::SampleFileBase<Region> { |
class Sample : public LinuxSampler::SampleFileBase<Region> { |
53 |
public: |
public: |
298 |
int lovel; int hivel; |
int lovel; int hivel; |
299 |
Array<int> locc; Array<int> hicc; |
Array<int> locc; Array<int> hicc; |
300 |
int lobend; int hibend; |
int lobend; int hibend; |
301 |
int lobpm; int hibpm; |
float lobpm; float hibpm; |
302 |
int lochanaft; int hichanaft; |
int lochanaft; int hichanaft; |
303 |
int lopolyaft; int hipolyaft; |
int lopolyaft; int hipolyaft; |
304 |
int loprog; int hiprog; |
int loprog; int hiprog; |
321 |
trigger_t trigger; |
trigger_t trigger; |
322 |
|
|
323 |
uint group; |
uint group; |
324 |
optional<int> off_by; |
uint off_by; |
325 |
off_mode_t off_mode; |
off_mode_t off_mode; |
326 |
|
|
327 |
Array<int> on_locc; Array<int> on_hicc; |
Array<int> on_locc; Array<int> on_hicc; |
407 |
|
|
408 |
class Query { |
class Query { |
409 |
public: |
public: |
|
Query(const Instrument& instrument); |
|
|
Region* next(); |
|
410 |
uint8_t chan; // MIDI channel |
uint8_t chan; // MIDI channel |
411 |
uint8_t key; // MIDI note TODO: or controller |
uint8_t key; // MIDI note TODO: or controller |
412 |
uint8_t vel; // MIDI velocity |
uint8_t vel; // MIDI velocity |
422 |
bool* sw; // state of region key switches, 128 possible values |
bool* sw; // state of region key switches, 128 possible values |
423 |
uint8_t last_sw_key; // last key pressed in the key switch range |
uint8_t last_sw_key; // last key pressed in the key switch range |
424 |
uint8_t prev_sw_key; // previous note value |
uint8_t prev_sw_key; // previous note value |
425 |
|
|
426 |
|
void search(const Instrument* pInstrument); |
427 |
|
Region* next(); |
428 |
private: |
private: |
429 |
std::vector<Region*>::const_iterator i; |
LinuxSampler::ArrayList<Region*>* pRegionList; |
430 |
std::vector<Region*>::const_iterator regions_end; |
int regionIndex; |
431 |
}; |
}; |
432 |
|
|
433 |
///////////////////////////////////////////////////////////// |
///////////////////////////////////////////////////////////// |
454 |
uint GetLoopEnd(); |
uint GetLoopEnd(); |
455 |
uint GetLoopCount(); |
uint GetLoopCount(); |
456 |
|
|
457 |
/// Return true if region is triggered by key |
/// Return true if region is triggered by key. Region is |
458 |
|
/// assumed to come from a search in the lookup table. |
459 |
bool OnKey(const Query& q); |
bool OnKey(const Query& q); |
460 |
|
|
461 |
/// Return true if region is triggered by control change |
/// Return true if region is triggered by control change |
495 |
/// List of Regions belonging to this Instrument |
/// List of Regions belonging to this Instrument |
496 |
std::vector<Region*> regions; |
std::vector<Region*> regions; |
497 |
|
|
498 |
friend class sfz::File; |
friend class File; |
499 |
|
friend class Query; |
500 |
|
|
501 |
private: |
private: |
502 |
std::string name; |
std::string name; |
503 |
std::vector<bool> KeyBindings; |
std::vector<bool> KeyBindings; |
504 |
std::vector<bool> KeySwitchBindings; |
std::vector<bool> KeySwitchBindings; |
505 |
SampleManager* pSampleManager; |
SampleManager* pSampleManager; |
506 |
|
LookupTable* pLookupTable; |
507 |
}; |
}; |
508 |
|
|
509 |
///////////////////////////////////////////////////////////// |
///////////////////////////////////////////////////////////// |