|
hydrogen 1.1.1
|
InstrumentList is a collection of instruments used within a song, a drumkit, ... More...
#include <InstrumentList.h>
Public Member Functions | |
| InstrumentList () | |
| constructor More... | |
| ~InstrumentList () | |
| destructor More... | |
| InstrumentList (InstrumentList *other) | |
| copy constructor More... | |
| int | size () const |
| returns the numbers of instruments More... | |
| void | operator<< (Instrument *instrument) |
| add an instrument to the list More... | |
| Instrument * | operator[] (int idx) |
| get an instrument from the list More... | |
| void | add (Instrument *instrument) |
| add an instrument to the list More... | |
| void | insert (int idx, Instrument *instrument) |
| insert an instrument into the list More... | |
| bool | is_valid_index (int idx) const |
| check if there is a idx is a valid index for this list without throwing an error messaage More... | |
| Instrument * | get (int idx) |
| get an instrument from the list More... | |
| Instrument * | del (int idx) |
| remove the instrument at a given index, does not delete it More... | |
| Instrument * | del (Instrument *instrument) |
| remove an instrument from the list, does not delete it More... | |
| int | index (Instrument *instrument) |
| get the index of an instrument within the instruments More... | |
| Instrument * | find (const int i) |
| find an instrument within the instruments More... | |
| Instrument * | find (const QString &name) |
| find an instrument within the instruments More... | |
| Instrument * | findMidiNote (const int note) |
| find an instrument which play the given midi note More... | |
| void | swap (int idx_a, int idx_b) |
| swap the instruments of two different indexes More... | |
| void | move (int idx_a, int idx_b) |
| move an instrument from a position to another More... | |
| void | load_samples () |
| Calls the Instrument::load_samples() member function of all Instruments in __instruments. More... | |
| void | unload_samples () |
| Calls the Instrument::unload_samples() member function of all Instruments in __instruments. More... | |
| void | save_to (XMLNode *node, int component_id) |
| save the instrument list within the given XMLNode More... | |
| void | fix_issue_307 () |
| Fix GitHub issue #307, so called "Hi Bongo fiasco". More... | |
| bool | has_all_midi_notes_same () const |
| Check if all instruments have assigned the same MIDI out note. More... | |
| void | set_default_midi_out_notes () |
| Set each instrument consecuteve MIDI out notes, starting from 36. More... | |
| QString | toQString (const QString &sPrefix, bool bShort=true) const override |
| Formatted string version for debugging purposes. More... | |
Public Member Functions inherited from Object | |
| ~Object () | |
| destructor More... | |
| Object (const Object &obj) | |
| copy constructor More... | |
| Object (const char *class_name) | |
| constructor More... | |
| const char * | class_name () const |
| return the class name More... | |
| virtual QString | toQString (const QString &sPrefix, bool bShort=true) const |
| Formatted string version for debugging purposes. More... | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. More... | |
Static Public Member Functions | |
| static InstrumentList * | load_from (XMLNode *node, const QString &dk_path, const QString &dk_name) |
| load an instrument list from an XMLNode More... | |
Static Public Member Functions inherited from Object | |
| static void | set_count (bool flag) |
| enable/disable class instances counting More... | |
| static bool | count_active () |
| return true if class instances counting is enabled More... | |
| static unsigned | objects_count () |
| return the number of objects More... | |
| static void | write_objects_map_to (std::ostream &out) |
| output the full objects map to a given ostream More... | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr More... | |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! More... | |
| static Logger * | logger () |
| return the logger instance More... | |
Private Attributes | |
| std::vector< Instrument * > | __instruments |
| the list of instruments More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Object | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. More... | |
Static Protected Attributes inherited from Object | |
| static Logger * | __logger = nullptr |
| logger instance pointer More... | |
InstrumentList is a collection of instruments used within a song, a drumkit, ...
| InstrumentList | ( | ) |
constructor
| ~InstrumentList | ( | ) |
destructor
| InstrumentList | ( | InstrumentList * | other | ) |
copy constructor
| other |
| void add | ( | Instrument * | instrument | ) |
add an instrument to the list
| instrument | a pointer to the instrument to add |
| Instrument * del | ( | Instrument * | instrument | ) |
remove an instrument from the list, does not delete it
| instrument | the instrument to be removed |
| Instrument * del | ( | int | idx | ) |
remove the instrument at a given index, does not delete it
| idx | the index |
| Instrument * find | ( | const int | i | ) |
find an instrument within the instruments
| i | the id of the instrument to find |
| Instrument * find | ( | const QString & | name | ) |
find an instrument within the instruments
| name | the name of the instrument to find |
| Instrument * findMidiNote | ( | const int | note | ) |
find an instrument which play the given midi note
| note | the Midi note of the instrument to find |
| void fix_issue_307 | ( | ) |
Fix GitHub issue #307, so called "Hi Bongo fiasco".
Check whether the same MIDI note is assignedto every instrument - that condition makes MIDI export unusable. When so, assign each instrument consecutive MIDI note starting from 36.
| Instrument * get | ( | int | idx | ) |
get an instrument from the list
| idx | the index to get the instrument from |
| bool has_all_midi_notes_same | ( | ) | const |
Check if all instruments have assigned the same MIDI out note.
| int index | ( | Instrument * | instrument | ) |
get the index of an instrument within the instruments
| instrument | a pointer to the instrument to find |
| void insert | ( | int | idx, |
| Instrument * | instrument | ||
| ) |
insert an instrument into the list
| idx | the index to insert the instrument at |
| instrument | a pointer to the instrument to add |
| bool is_valid_index | ( | int | idx | ) | const |
check if there is a idx is a valid index for this list without throwing an error messaage
| idx | the index of the instrument |
|
static |
load an instrument list from an XMLNode
| node | the XMLDode to read from |
| dk_path | the directory holding the drumkit data |
| dk_name |
| void load_samples | ( | ) |
Calls the Instrument::load_samples() member function of all Instruments in __instruments.
| void move | ( | int | idx_a, |
| int | idx_b | ||
| ) |
move an instrument from a position to another
| idx_a | the start index |
| idx_b | the finish index |
| void operator<< | ( | Instrument * | instrument | ) |
add an instrument to the list
| instrument | a pointer to the instrument to add |
| Instrument * operator[] | ( | int | idx | ) |
get an instrument from the list
| idx | the index to get the instrument from |
| void save_to | ( | XMLNode * | node, |
| int | component_id | ||
| ) |
| void set_default_midi_out_notes | ( | ) |
Set each instrument consecuteve MIDI out notes, starting from 36.
|
inline |
returns the numbers of instruments
| void swap | ( | int | idx_a, |
| int | idx_b | ||
| ) |
swap the instruments of two different indexes
| idx_a | the first index |
| idx_b | the second index |
|
overridevirtual |
Formatted string version for debugging purposes.
| sPrefix | String prefix which will be added in front of every new line |
| bShort | Instead of the whole content of all classes stored as members just a single unique identifier will be displayed without line breaks. |
Reimplemented from Object.
| void unload_samples | ( | ) |
Calls the Instrument::unload_samples() member function of all Instruments in __instruments.
|
private |
the list of instruments