|
hydrogen 1.2.3
|
PatternList is a collection of patterns. More...
#include <PatternList.h>
Public Member Functions | |
| PatternList () | |
| constructor | |
| PatternList (PatternList *other) | |
| copy constructor | |
| ~PatternList () | |
| destructor | |
| void | add (Pattern *pattern, bool bAddVirtuals=false) |
| add a pattern to the list | |
| std::vector< Pattern * >::iterator | begin () |
| Iteration. | |
| bool | check_name (QString patternName, Pattern *ignore=NULL) |
| check if a pattern with name patternName already exists in this list | |
| void | clear () |
| empty the pattern list | |
| Pattern * | del (int idx) |
| remove the pattern at a given index, does not delete it | |
| Pattern * | del (Pattern *pattern) |
| remove a pattern from the list, does not delete it | |
| std::vector< Pattern * >::iterator | end () |
| Pattern * | find (const QString &name) |
| find a pattern within the patterns | |
| QString | find_unused_pattern_name (QString sourceName, Pattern *ignore=NULL) |
| find unused patternName | |
| void | flattened_virtual_patterns_compute () |
| call compute_flattened_virtual_patterns on each pattern | |
| Pattern * | get (int idx) |
| get a pattern from the list | |
| Pattern * | get (int idx) const |
| int | index (const Pattern *pattern) const |
| get the index of the pattern within the patterns | |
| void | insert (int idx, Pattern *pattern) |
| insert a pattern into the list | |
| int | longest_pattern_length (bool bIncludeVirtuals=true) const |
| Get the length of the longest pattern in the list. | |
| void | move (int idx_a, int idx_b) |
| move a pattern from a position to another | |
| void | operator<< (Pattern *new_pattern) |
| add a pattern to the list | |
| Pattern * | operator[] (int idx) |
| get a pattern from the list | |
| Pattern * | replace (int idx, Pattern *pattern) |
| replace the pattern at a given index with a new one | |
| void | save_to (XMLNode *pNode, const std::shared_ptr< Instrument > pInstrumentOnly=nullptr) const |
| void | set_to_old () |
| mark all patterns as old | |
| int | size () const |
| returns the numbers of patterns | |
| void | swap (int idx_a, int idx_b) |
| swap the patterns of two different indexes | |
| QString | toQString (const QString &sPrefix="", bool bShort=true) const override |
| Formatted string version for debugging purposes. | |
| void | virtual_pattern_del (Pattern *pattern) |
| call del_virtual_pattern on each pattern | |
Public Member Functions inherited from Object< PatternList > | |
| Object () | |
| Object (const Object< PatternList > &other) | |
Public Member Functions inherited from Base | |
| Base () | |
| Base (const Base &other) | |
| virtual const char * | class_name () const |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. | |
Public Member Functions inherited from AudioEngineLocking | |
| AudioEngineLocking () | |
| void | setNeedsLock (bool bNeedsLock) |
| The audio processing thread can modify some PatternLists. | |
Static Public Member Functions | |
| static PatternList * | load_from (XMLNode *pNode, std::shared_ptr< InstrumentList > pInstrumentList, bool bSilent=false) |
| load a PatternList from an XMLNode | |
Static Public Member Functions inherited from Base | |
| static const char * | _class_name () |
| return the class name | |
| static QString | base_clock (const QString &sMsg) |
| Measures the current time and stores it in __last_clock. | |
| static QString | base_clock_in (const QString &sMsg) |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! | |
| static bool | count_active () |
| static int | getAliveObjectCount () |
| static object_map_t | getObjectMap () |
| static Logger * | logger () |
| return the logger instance | |
| static int | objects_count () |
| static void | printObjectMapDiff (object_map_t map) |
| Creates the difference between a snapshot of the object map and its current state and prints it to std::cout. | |
| static void | set_count (bool flag) |
| enable/disable class instances counting | |
| static void | write_objects_map_to (std::ostream &out, object_map_t *map=nullptr) |
| output the full objects map to a given ostream | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr | |
Private Attributes | |
| std::vector< Pattern * > | __patterns |
| the list of patterns | |
Additional Inherited Members | |
Static Public Attributes inherited from Base | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. | |
Protected Member Functions inherited from Object< PatternList > | |
| ~Object () | |
Protected Member Functions inherited from Base | |
| ~Base () | |
Protected Member Functions inherited from AudioEngineLocking | |
| void | assertAudioEngineLocked () const |
| Assert that the AudioEngine lock is held if needed. | |
Static Protected Member Functions inherited from Base | |
| static void | registerClass (const char *name, const atomic_obj_cpt_t *counters) |
Static Protected Attributes inherited from Base | |
| static bool | __count = false |
| should we count class instances | |
| static timeval | __last_clock = { 0, 0 } |
| static Logger * | __logger = nullptr |
PatternList is a collection of patterns.
Definition at line 42 of file PatternList.h.
| PatternList | ( | ) |
constructor
Definition at line 36 of file PatternList.cpp.
| ~PatternList | ( | ) |
destructor
Definition at line 48 of file PatternList.cpp.
| PatternList | ( | PatternList * | other | ) |
| void add | ( | Pattern * | pattern, |
| bool | bAddVirtuals = false ) |
add a pattern to the list
| pattern | a pointer to the pattern to add |
| bAddVirtuals | Whether virtual patterns contained in pattern should be added too. |
Definition at line 97 of file PatternList.cpp.
| std::vector< Pattern * >::iterator begin | ( | ) |
Iteration.
Definition at line 373 of file PatternList.cpp.
| bool check_name | ( | QString | patternName, |
| Pattern * | ignore = NULL ) |
check if a pattern with name patternName already exists in this list
| patternName | name of a pattern to check |
| ignore | optional pattern in the list to ignore |
Definition at line 284 of file PatternList.cpp.
|
inline |
empty the pattern list
Definition at line 208 of file PatternList.h.
| Pattern * del | ( | int | idx | ) |
remove the pattern at a given index, does not delete it
| idx | the index |
Definition at line 186 of file PatternList.cpp.
remove a pattern from the list, does not delete it
| pattern | the pattern to be removed |
Definition at line 197 of file PatternList.cpp.
| std::vector< Pattern * >::iterator end | ( | ) |
Definition at line 378 of file PatternList.cpp.
| Pattern * find | ( | const QString & | name | ) |
find a pattern within the patterns
| name | the name of the pattern to find |
Definition at line 237 of file PatternList.cpp.
| QString find_unused_pattern_name | ( | QString | sourceName, |
| Pattern * | ignore = NULL ) |
find unused patternName
| sourceName | base name to start with |
| ignore | optional pattern in the list to ignore |
Definition at line 298 of file PatternList.cpp.
| void flattened_virtual_patterns_compute | ( | ) |
call compute_flattened_virtual_patterns on each pattern
Definition at line 269 of file PatternList.cpp.
| Pattern * get | ( | int | idx | ) |
get a pattern from the list
| idx | the index to get the pattern from |
Definition at line 154 of file PatternList.cpp.
| Pattern * get | ( | int | idx | ) | const |
Definition at line 165 of file PatternList.cpp.
| int index | ( | const Pattern * | pattern | ) | const |
get the index of the pattern within the patterns
| pattern | a pointer to the pattern to find |
Definition at line 176 of file PatternList.cpp.
| void insert | ( | int | idx, |
| Pattern * | pattern ) |
insert a pattern into the list
| idx | the index to insert the pattern at |
| pattern | a pointer to the pattern to add |
Definition at line 141 of file PatternList.cpp.
|
static |
load a PatternList from an XMLNode
| pNode | the XMLDode to read from |
| pInstrumentList | the current instrument list to search instrument into |
| bSilent | Whether infos, warnings, and errors should be logged. |
Definition at line 56 of file PatternList.cpp.
| int longest_pattern_length | ( | bool | bIncludeVirtuals = true | ) | const |
Get the length of the longest pattern in the list.
| bIncludeVirtuals | In case there are virtual patterns present this argument specifies whether to include their contained patterns as well. |
Definition at line 332 of file PatternList.cpp.
| void move | ( | int | idx_a, |
| int | idx_b ) |
move a pattern from a position to another
| idx_a | the start index |
| idx_b | the finish index |
Definition at line 257 of file PatternList.cpp.
|
inline |
add a pattern to the list
| new_pattern | a pointer to the pattern to add |
Definition at line 213 of file PatternList.h.
|
inline |
get a pattern from the list
| idx | the index to get the pattern from |
Definition at line 218 of file PatternList.h.
replace the pattern at a given index with a new one
| idx | the index |
| pattern | the new pattern to insert |
Definition at line 208 of file PatternList.cpp.
| void save_to | ( | XMLNode * | pNode, |
| const std::shared_ptr< Instrument > | pInstrumentOnly = nullptr ) const |
Definition at line 87 of file PatternList.cpp.
| void set_to_old | ( | ) |
mark all patterns as old
Definition at line 230 of file PatternList.cpp.
|
inline |
returns the numbers of patterns
Definition at line 203 of file PatternList.h.
| void swap | ( | int | idx_a, |
| int | idx_b ) |
swap the patterns of two different indexes
| idx_a | the first index |
| idx_b | the second index |
Definition at line 245 of file PatternList.cpp.
|
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 Base.
Definition at line 350 of file PatternList.cpp.
| void virtual_pattern_del | ( | Pattern * | pattern | ) |
call del_virtual_pattern on each pattern
| pattern | the pattern to remove where it's found |
Definition at line 279 of file PatternList.cpp.
|
private |
the list of patterns
Definition at line 197 of file PatternList.h.