23#ifndef H2C_PATTERN_LIST_H
24#define H2C_PATTERN_LIST_H
34class AudioEngineLocking;
65 void save_to(
XMLNode* pNode,
const std::shared_ptr<Instrument> pInstrumentOnly =
nullptr )
const;
86 void add(
Pattern* pattern,
bool bAddVirtuals =
false );
143 void swap(
int idx_a,
int idx_b );
149 void move(
int idx_a,
int idx_b );
190 QString
toQString(
const QString& sPrefix =
"",
bool bShort =
true )
const override;
193 std::vector<Pattern*>::iterator
begin();
194 std::vector<Pattern*>::iterator
end();
PatternList is a collection of patterns.
void operator<<(Pattern *new_pattern)
add a pattern to the list
void save_to(XMLNode *pNode, const std::shared_ptr< Instrument > pInstrumentOnly=nullptr) const
bool check_name(QString patternName, Pattern *ignore=NULL)
check if a pattern with name patternName already exists in this list
void add(Pattern *pattern, bool bAddVirtuals=false)
add a pattern to the list
std::vector< Pattern * >::iterator end()
static PatternList * load_from(XMLNode *pNode, std::shared_ptr< InstrumentList > pInstrumentList, bool bSilent=false)
load a PatternList from an XMLNode
int index(const Pattern *pattern) const
get the index of the pattern within the patterns
void set_to_old()
mark all patterns as old
Pattern * replace(int idx, Pattern *pattern)
replace the pattern at a given index with a new one
Pattern * operator[](int idx)
get a pattern from the list
void move(int idx_a, int idx_b)
move a pattern from a position to another
QString find_unused_pattern_name(QString sourceName, Pattern *ignore=NULL)
find unused patternName
Pattern * del(int idx)
remove the pattern at a given index, does not delete it
void flattened_virtual_patterns_compute()
call compute_flattened_virtual_patterns on each pattern
std::vector< Pattern * >::iterator begin()
Iteration.
int longest_pattern_length(bool bIncludeVirtuals=true) const
Get the length of the longest pattern in the list.
std::vector< Pattern * > __patterns
the list of patterns
void swap(int idx_a, int idx_b)
swap the patterns of two different indexes
Pattern * find(const QString &name)
find a pattern within the patterns
QString toQString(const QString &sPrefix="", bool bShort=true) const override
Formatted string version for debugging purposes.
void clear()
empty the pattern list
void virtual_pattern_del(Pattern *pattern)
call del_virtual_pattern on each pattern
int size() const
returns the numbers of patterns
void insert(int idx, Pattern *pattern)
insert a pattern into the list
Pattern * get(int idx)
get a pattern from the list
Pattern class is a Note container.
XMLNode is a subclass of QDomNode with read and write values methods.