1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2007 Grigor Iliev * |
* Copyright (C) 2007, 2008 Grigor Iliev * |
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
20 |
|
|
21 |
#include "../common/global.h" |
#include "../common/global.h" |
22 |
|
|
|
#if HAVE_SQLITE3 |
|
|
|
|
23 |
#ifndef __LS_INSTRUMENTSDB_H__ |
#ifndef __LS_INSTRUMENTSDB_H__ |
24 |
#define __LS_INSTRUMENTSDB_H__ |
#define __LS_INSTRUMENTSDB_H__ |
25 |
|
|
435 |
StringListPtr FindInstruments(String Dir, SearchQuery* pQuery, bool Recursive); |
StringListPtr FindInstruments(String Dir, SearchQuery* pQuery, bool Recursive); |
436 |
|
|
437 |
/** |
/** |
438 |
|
* Removes the old instruments datbase and re-creates |
439 |
|
* the instruments database from scratch. |
440 |
|
*/ |
441 |
|
void Format(); |
442 |
|
|
443 |
|
/** |
444 |
* All '\0' chars in the string are replaced with "\x2f"; |
* All '\0' chars in the string are replaced with "\x2f"; |
445 |
* ', ", \ are escaped with backslash and |
* ', ", \ are escaped with backslash and |
446 |
* <CR> and <LF> are replaced with \r and \n. |
* <CR> and <LF> are replaced with \r and \n. |
453 |
*/ |
*/ |
454 |
static String toEscapedText(String text); |
static String toEscapedText(String text); |
455 |
|
|
|
/** |
|
|
* Closes the database connection if opened and deletes |
|
|
* the InstrumentsDb instance. |
|
|
*/ |
|
|
static void Destroy(); |
|
|
|
|
456 |
JobList Jobs; |
JobList Jobs; |
457 |
|
|
458 |
private: |
private: |
459 |
sqlite3* db; |
sqlite3* db; |
460 |
String DbFile; |
String DbFile; |
461 |
static InstrumentsDb* pInstrumentsDb; |
static InstrumentsDb instance; |
462 |
Mutex DbInstrumentsMutex; |
Mutex DbInstrumentsMutex; |
463 |
ListenerList<InstrumentsDb::Listener*> llInstrumentsDbListeners; |
ListenerList<InstrumentsDb::Listener*> llInstrumentsDbListeners; |
464 |
bool InTransaction; |
bool InTransaction; |
859 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |
860 |
|
|
861 |
#endif // __LS_INSTRUMENTSDB_H__ |
#endif // __LS_INSTRUMENTSDB_H__ |
|
|
|
|
#endif // HAVE_SQLITE3 |
|