2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file access library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2007 by Christian Schoenebeck * |
* Copyright (C) 2003-2009 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
639 |
friend class Instrument; |
friend class Instrument; |
640 |
}; |
}; |
641 |
|
|
642 |
|
/** Abstract base class for all MIDI rules. */ |
643 |
|
class MidiRule { |
644 |
|
public: |
645 |
|
virtual ~MidiRule() { } |
646 |
|
}; |
647 |
|
|
648 |
|
/** MIDI rule for triggering notes by control change events. */ |
649 |
|
class MidiRuleCtrlTrigger : public MidiRule { |
650 |
|
public: |
651 |
|
uint8_t ControllerNumber; ///< MIDI controller number. |
652 |
|
uint8_t Triggers; ///< Number of triggers. |
653 |
|
struct trigger_t { |
654 |
|
uint8_t TriggerPoint; ///< The CC value to pass for the note to be triggered. |
655 |
|
bool Descending; ///< If the change in CC value should be downwards. |
656 |
|
uint8_t VelSensitivity; ///< How sensitive the velocity should be to the speed of the controller change. |
657 |
|
uint8_t Key; ///< Key to trigger. |
658 |
|
bool NoteOff; ///< If a note off should be triggered instead of a note on. |
659 |
|
uint8_t Velocity; ///< Velocity of the note to trigger. 255 means that velocity should depend on the speed of the controller change. |
660 |
|
bool OverridePedal; ///< If a note off should be triggered even if the sustain pedal is down. |
661 |
|
} pTriggers[32]; |
662 |
|
|
663 |
|
protected: |
664 |
|
MidiRuleCtrlTrigger(RIFF::Chunk* _3ewg); |
665 |
|
friend class Instrument; |
666 |
|
}; |
667 |
|
|
668 |
/** Provides all neccessary information for the synthesis of an <i>Instrument</i>. */ |
/** Provides all neccessary information for the synthesis of an <i>Instrument</i>. */ |
669 |
class Instrument : protected DLS::Instrument { |
class Instrument : protected DLS::Instrument { |
670 |
public: |
public: |
697 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(); |
698 |
// own methods |
// own methods |
699 |
Region* GetRegion(unsigned int Key); |
Region* GetRegion(unsigned int Key); |
700 |
|
MidiRule* GetMidiRule(int i); |
701 |
protected: |
protected: |
702 |
Region* RegionKeyTable[128]; ///< fast lookup for the corresponding Region of a MIDI key |
Region* RegionKeyTable[128]; ///< fast lookup for the corresponding Region of a MIDI key |
703 |
|
|
706 |
void UpdateRegionKeyTable(); |
void UpdateRegionKeyTable(); |
707 |
friend class File; |
friend class File; |
708 |
friend class Region; // so Region can call UpdateRegionKeyTable() |
friend class Region; // so Region can call UpdateRegionKeyTable() |
709 |
|
private: |
710 |
|
MidiRule** pMidiRules; |
711 |
}; |
}; |
712 |
|
|
713 |
/** @brief Group of Gigasampler objects |
/** @brief Group of Gigasampler objects |
778 |
Group* AddGroup(); |
Group* AddGroup(); |
779 |
void DeleteGroup(Group* pGroup); |
void DeleteGroup(Group* pGroup); |
780 |
void DeleteGroupOnly(Group* pGroup); |
void DeleteGroupOnly(Group* pGroup); |
781 |
|
void SetAutoLoad(bool b); |
782 |
|
bool GetAutoLoad(); |
783 |
virtual ~File(); |
virtual ~File(); |
784 |
virtual void UpdateChunks(); |
virtual void UpdateChunks(); |
785 |
protected: |
protected: |
795 |
friend class Sample; |
friend class Sample; |
796 |
friend class Group; // so Group can access protected member pRIFF |
friend class Group; // so Group can access protected member pRIFF |
797 |
private: |
private: |
|
static const DLS::Info::FixedStringLength FixedStringLengths[]; |
|
798 |
std::list<Group*>* pGroups; |
std::list<Group*>* pGroups; |
799 |
std::list<Group*>::iterator GroupsIterator; |
std::list<Group*>::iterator GroupsIterator; |
800 |
|
bool bAutoLoad; |
801 |
}; |
}; |
802 |
|
|
803 |
/** |
/** |