hydrogen 1.2.3
SoundLibraryDatabase.h
Go to the documentation of this file.
1/*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 * Copyright(c) 2008-2024 The hydrogen development team [hydrogen-devel@lists.sourceforge.net]
5 *
6 * http://www.hydrogen-music.org
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY, without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see https://www.gnu.org/licenses
20 *
21 */
22
23#ifndef SOUNDLIBRARYDATASTRUCTURES_H
24#define SOUNDLIBRARYDATASTRUCTURES_H
25
26#include <core/Basics/Drumkit.h>
28#include <core/Object.h>
29#include <map>
30#include <memory>
31#include <vector>
32
33namespace H2Core
34{
47class SoundLibraryDatabase : public H2Core::Object<SoundLibraryDatabase>
48{
50 public:
53
54 std::vector<std::shared_ptr<SoundLibraryInfo>> getPatternInfoVector() const {
56 }
57 QStringList getPatternCategories() const {
59 }
60
61 void update();
62
63 void updateDrumkits( bool bTriggerEvent = true );
64 void updateDrumkit( const QString& sDrumkitPath, bool bTriggerEvent = true );
73 std::shared_ptr<Drumkit> getDrumkit( const QString& sDrumkitPath, bool bLoad = true );
74 const std::map<QString,std::shared_ptr<Drumkit>> getDrumkitDatabase() const {
75 return m_drumkitDatabase;
76 }
77
78 void updatePatterns( bool bTriggerEvent = true );
79 void printPatterns() const;
80 void loadPatternFromDirectory( const QString& path );
81 bool isPatternInstalled( const QString& sPatternName ) const;
82
91 QString toQString( const QString& sPrefix = "", bool bShort = true ) const override;
92
93private:
94 std::map<QString,std::shared_ptr<Drumkit>> m_drumkitDatabase;
95
96 std::vector<std::shared_ptr<SoundLibraryInfo>> m_patternInfoVector;
98
107};
108}; // namespace H2Core
109
110#endif // SOUNDLIBRARYDATASTRUCTURES_H
#define H2_OBJECT(name)
Definition Object.h:224
This class holds information about all installed soundlibrary items.
QStringList getPatternCategories() const
std::map< QString, std::shared_ptr< Drumkit > > m_drumkitDatabase
void updateDrumkits(bool bTriggerEvent=true)
std::vector< std::shared_ptr< SoundLibraryInfo > > getPatternInfoVector() const
void loadPatternFromDirectory(const QString &path)
bool isPatternInstalled(const QString &sPatternName) const
void updateDrumkit(const QString &sDrumkitPath, bool bTriggerEvent=true)
void updatePatterns(bool bTriggerEvent=true)
const std::map< QString, std::shared_ptr< Drumkit > > getDrumkitDatabase() const
QStringList m_customDrumkitPaths
List of drumkits the user supplied via CLI or OSC command but couldn't be found in either the system'...
QString toQString(const QString &sPrefix="", bool bShort=true) const override
Formatted string version for debugging purposes.
std::vector< std::shared_ptr< SoundLibraryInfo > > m_patternInfoVector
std::shared_ptr< Drumkit > getDrumkit(const QString &sDrumkitPath, bool bLoad=true)
Retrieve a drumkit from the database.