|
hydrogen 1.2.3
|
This class holds information about all installed soundlibrary items. More...
#include <SoundLibraryDatabase.h>
Public Member Functions | |
| SoundLibraryDatabase () | |
| ~SoundLibraryDatabase () | |
| std::shared_ptr< Drumkit > | getDrumkit (const QString &sDrumkitPath, bool bLoad=true) |
| Retrieve a drumkit from the database. | |
| const std::map< QString, std::shared_ptr< Drumkit > > | getDrumkitDatabase () const |
| QStringList | getPatternCategories () const |
| std::vector< std::shared_ptr< SoundLibraryInfo > > | getPatternInfoVector () const |
| bool | isPatternInstalled (const QString &sPatternName) const |
| void | loadPatternFromDirectory (const QString &path) |
| void | printPatterns () const |
| QString | toQString (const QString &sPrefix="", bool bShort=true) const override |
| Formatted string version for debugging purposes. | |
| void | update () |
| void | updateDrumkit (const QString &sDrumkitPath, bool bTriggerEvent=true) |
| void | updateDrumkits (bool bTriggerEvent=true) |
| void | updatePatterns (bool bTriggerEvent=true) |
Public Member Functions inherited from Object< SoundLibraryDatabase > | |
| Object () | |
| Object (const Object< SoundLibraryDatabase > &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. | |
Private Attributes | |
| QStringList | m_customDrumkitPaths |
| List of drumkits the user supplied via CLI or OSC command but couldn't be found in either the system's or user's drumkit folders. | |
| std::map< QString, std::shared_ptr< Drumkit > > | m_drumkitDatabase |
| QStringList | m_patternCategories |
| std::vector< std::shared_ptr< SoundLibraryInfo > > | m_patternInfoVector |
Additional Inherited Members | |
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 | |
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< SoundLibraryDatabase > | |
| ~Object () | |
Protected Member Functions inherited from Base | |
| ~Base () | |
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 |
This class holds information about all installed soundlibrary items.
This class organizes the metadata of all locally installed soundlibrary items.
Definition at line 47 of file SoundLibraryDatabase.h.
Definition at line 32 of file SoundLibraryDatabase.cpp.
| ~SoundLibraryDatabase | ( | ) |
Definition at line 37 of file SoundLibraryDatabase.cpp.
| std::shared_ptr< Drumkit > getDrumkit | ( | const QString & | sDrumkitPath, |
| bool | bLoad = true ) |
Retrieve a drumkit from the database.
| sDrumkitPath | Absolute path to the drumkit directory (containing a drumkit.xml) file as unique identifier. |
| bLoad | Whether the drumkit should be loaded into the datebase in case it is not present yet. |
Definition at line 135 of file SoundLibraryDatabase.cpp.
|
inline |
Definition at line 74 of file SoundLibraryDatabase.h.
|
inline |
Definition at line 57 of file SoundLibraryDatabase.h.
|
inline |
Definition at line 54 of file SoundLibraryDatabase.h.
| bool isPatternInstalled | ( | const QString & | sPatternName | ) | const |
Definition at line 52 of file SoundLibraryDatabase.cpp.
| void loadPatternFromDirectory | ( | const QString & | path | ) |
Definition at line 208 of file SoundLibraryDatabase.cpp.
| void printPatterns | ( | ) | const |
Definition at line 41 of file SoundLibraryDatabase.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 229 of file SoundLibraryDatabase.cpp.
| void update | ( | ) |
Definition at line 62 of file SoundLibraryDatabase.cpp.
| void updateDrumkit | ( | const QString & | sDrumkitPath, |
| bool | bTriggerEvent = true ) |
Definition at line 120 of file SoundLibraryDatabase.cpp.
| void updateDrumkits | ( | bool | bTriggerEvent = true | ) |
Definition at line 71 of file SoundLibraryDatabase.cpp.
| void updatePatterns | ( | bool | bTriggerEvent = true | ) |
Definition at line 191 of file SoundLibraryDatabase.cpp.
|
private |
List of drumkits the user supplied via CLI or OSC command but couldn't be found in either the system's or user's drumkit folders.
This drumkit might still be present an valid. But it would be lost upon updating when just checking the aforementioned folders.
Definition at line 106 of file SoundLibraryDatabase.h.
|
private |
Definition at line 94 of file SoundLibraryDatabase.h.
|
private |
Definition at line 97 of file SoundLibraryDatabase.h.
|
private |
Definition at line 96 of file SoundLibraryDatabase.h.