|
hydrogen 1.1.1
|
#include <Drumkit.h>
Public Member Functions | |
| Drumkit () | |
| drumkit constructor, does nothing More... | |
| Drumkit (Drumkit *other) | |
| copy constructor More... | |
| ~Drumkit () | |
| drumkit destructor, delete __instruments More... | |
| void | load_samples () |
| Calls the InstrumentList::load_samples() member function of __instruments. More... | |
| void | unload_samples () |
| Calls the InstrumentList::unload_samples() member function of __instruments. More... | |
| bool | save (bool overwrite=false) |
| save a drumkit, xml file and samples More... | |
| bool | save (const QString &dk_dir, bool overwrite=false) |
| save a drumkit, xml file and samples neither __path nor __name are updated More... | |
| bool | save_file (const QString &dk_path, bool overwrite=false, int component_id=-1) |
| save a drumkit into an xml file More... | |
| bool | save_samples (const QString &dk_dir, bool overwrite=false) |
| save a drumkit instruments samples into a directory More... | |
| bool | save_image (const QString &dk_dir, bool overwrite=false) |
| save the drumkit image into the new directory More... | |
| void | set_instruments (InstrumentList *instruments) |
| set __instruments, delete existing one More... | |
| InstrumentList * | get_instruments () const |
| returns __instruments More... | |
| void | set_path (const QString &path) |
| __path setter More... | |
| const QString & | get_path () const |
| __path accessor More... | |
| void | set_name (const QString &name) |
| __name setter More... | |
| const QString & | get_name () const |
| __name accessor More... | |
| void | set_author (const QString &author) |
| __author setter More... | |
| const QString & | get_author () const |
| __author accessor More... | |
| void | set_info (const QString &info) |
| __info setter More... | |
| const QString & | get_info () const |
| __info accessor More... | |
| void | set_license (const QString &license) |
| __license setter More... | |
| const QString & | get_license () const |
| __license accessor More... | |
| void | set_image (const QString &image) |
| __image setter More... | |
| const QString & | get_image () const |
| __image accessor More... | |
| void | set_image_license (const QString &imageLicense) |
| __imageLicense setter More... | |
| const QString & | get_image_license () const |
| __imageLicense accessor More... | |
| const bool | samples_loaded () const |
| return true if the samples are loaded More... | |
| void | dump () |
| bool | isUserDrumkit () const |
| std::vector< DrumkitComponent * > * | get_components () |
| void | set_components (std::vector< DrumkitComponent * > *components) |
| 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 Drumkit * | load (const QString &dk_dir, const bool load_samples=false) |
| Load drumkit information from a directory. More... | |
| static Drumkit * | load_by_name (const QString &dk_name, const bool load_samples=false, Filesystem::Lookup lookup=Filesystem::Lookup::stacked) |
| Simple wrapper for load() used with the drumkit's name instead of its directory. More... | |
| static Drumkit * | load_file (const QString &dk_path, const bool load_samples=false) |
| Load a Drumkit from a file. More... | |
| static void | upgrade_drumkit (Drumkit *pDrumkit, const QString &dk_path) |
| Saves the current drumkit to dk_path, but makes a backup. More... | |
| static bool | user_drumkit_exists (const QString &dk_path) |
| check if a user drumkit with the given name already exists More... | |
| static bool | save (const QString &sName, const QString &sAuthor, const QString &sInfo, const QString &sLicense, const QString &sImage, const QString &sImageLicense, InstrumentList *pInstruments, std::vector< DrumkitComponent * > *pComponents, bool bOverwrite=false) |
| save a drumkit using given parameters and an instrument list More... | |
| static bool | install (const QString &path) |
| install a drumkit from a filename More... | |
| static bool | remove (const QString &dk_name, Filesystem::Lookup lookup) |
| remove a drumkit from the disk 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 Member Functions | |
| void | save_to (XMLNode *node, int component_id=-1) |
Static Private Member Functions | |
| static Drumkit * | load_from (XMLNode *node, const QString &dk_path) |
| load a drumkit from an XMLNode More... | |
Private Attributes | |
| QString | __path |
| absolute drumkit path More... | |
| QString | __name |
| drumkit name More... | |
| QString | __author |
| drumkit author More... | |
| QString | __info |
| drumkit free text More... | |
| QString | __license |
| drumkit license description More... | |
| QString | __image |
| drumkit image filename More... | |
| QString | __imageLicense |
| drumkit image license More... | |
| bool | __samples_loaded |
| true if the instrument samples are loaded More... | |
| InstrumentList * | __instruments |
| the list of instruments More... | |
| std::vector< DrumkitComponent * > * | __components |
| list of drumkit component 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... | |
Drumkit info.
| Drumkit | ( | ) |
drumkit constructor, does nothing
| ~Drumkit | ( | ) |
drumkit destructor, delete __instruments
| void dump | ( | ) |
|
inline |
__author accessor
|
inline |
|
inline |
__image accessor
|
inline |
__imageLicense accessor
|
inline |
__info accessor
|
inline |
returns __instruments
|
inline |
__license accessor
|
inline |
__name accessor
|
inline |
__path accessor
|
static |
install a drumkit from a filename
| path | the path to the new drumkit archive |
| bool isUserDrumkit | ( | ) | const |
|
static |
Load drumkit information from a directory.
This function is a wrapper around load_file(). The provided drumkit directory dk_dir is converted by Filesystem::drumkit_file() internally.
| dk_dir | A directory containing a drumkit, like those returned by Filesystem::drumkit_dir_search(). |
| load_samples | Automatically load sample data if set to true. |
|
static |
Simple wrapper for load() used with the drumkit's name instead of its directory.
Uses Filesystem::drumkit_path_search() to determine the directory of the Drumkit from dk_name.
| dk_name | Name of the Drumkit. |
| load_samples | Automatically load sample data if set to true. |
| lookup | Where to search (system/user folder or both) for the drumkit. |
|
static |
Load a Drumkit from a file.
If the drumkit in dk_name can not be validated against the current XML Schema definition in Filesystem::drumkit_xsd_path(), it will be loaded using Legacy::load_drumkit() and, if successful, saved again using save_file() to update the drumkit file to the newest version. If, instead, the Drumkit is valid, it is loaded using load_from() and load_samples() is triggered if load_samples is true.
| dk_path | is a path to an xml file |
| load_samples | automatically load sample data if set to true |
load a drumkit from an XMLNode
| node | the XMLDode to read from |
| dk_path | the directory holding the drumkit data |
| void load_samples | ( | ) |
Calls the InstrumentList::load_samples() member function of __instruments.
|
static |
remove a drumkit from the disk
| dk_name | the drumkit name |
| lookup | Where to search (system/user folder or both) for the drumkit. |
|
inline |
return true if the samples are loaded
| bool save | ( | bool | overwrite = false | ) |
save a drumkit, xml file and samples
| overwrite | allows to write over existing drumkit files |
| bool save | ( | const QString & | dk_dir, |
| bool | overwrite = false |
||
| ) |
|
static |
save a drumkit using given parameters and an instrument list
| sName | the name of the drumkit |
| sAuthor | the author of the drumkit |
| sInfo | the info of the drumkit |
| sLicense | the license of the drumkit |
| sImage | the image filename (with full path) of the drumkit |
| sImageLicense | license of the supplied image |
| pInstruments | the instruments to be saved within the drumkit |
| pComponents | |
| bOverwrite | allows to write over existing drumkit files |
| bool save_file | ( | const QString & | dk_path, |
| bool | overwrite = false, |
||
| int | component_id = -1 |
||
| ) |
save a drumkit into an xml file
| dk_path | the path to save the drumkit into |
| overwrite | allows to write over existing drumkit file |
| component_id | to chose the component to save or -1 for all |
| bool save_image | ( | const QString & | dk_dir, |
| bool | overwrite = false |
||
| ) |
save the drumkit image into the new directory
| dk_dir | the directory to save the image into |
| overwrite | allows to write over existing drumkit image file |
| bool save_samples | ( | const QString & | dk_dir, |
| bool | overwrite = false |
||
| ) |
save a drumkit instruments samples into a directory
| dk_dir | the directory to save the samples into |
| overwrite | allows to write over existing drumkit samples files |
|
private |
|
inline |
__author setter
| void set_components | ( | std::vector< DrumkitComponent * > * | components | ) |
|
inline |
__image setter
|
inline |
__imageLicense setter
|
inline |
__info setter
| void set_instruments | ( | InstrumentList * | instruments | ) |
set __instruments, delete existing one
|
inline |
__license setter
|
inline |
__name setter
|
inline |
__path setter
|
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 InstrumentList::unload_samples() member function of __instruments.
|
static |
Saves the current drumkit to dk_path, but makes a backup.
This is used when the drumkit did not comply to our xml schema.
|
static |
check if a user drumkit with the given name already exists
| dk_path | Drumkit path |
|
private |
drumkit author
|
private |
list of drumkit component
|
private |
drumkit image filename
|
private |
drumkit image license
|
private |
drumkit free text
|
private |
the list of instruments
|
private |
drumkit license description
|
private |
drumkit name
|
private |
absolute drumkit path
|
private |
true if the instrument samples are loaded