Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.3KB

  1. #pragma once
  2. #include <string>
  3. #include <vector>
  4. #include <map>
  5. namespace zyncarla {
  6. struct BankEntry
  7. {
  8. BankEntry(void);
  9. std::string file;
  10. std::string bank;
  11. std::string name;
  12. std::string comments;
  13. std::string author;
  14. std::string type;
  15. int id;
  16. bool add;
  17. bool pad;
  18. bool sub;
  19. int time;//last update
  20. typedef std::vector<std::string> svec;
  21. svec tags(void) const;
  22. bool match(std::string) const;
  23. bool operator<(const BankEntry &b) const;
  24. };
  25. class BankDb
  26. {
  27. public:
  28. typedef std::vector<std::string> svec;
  29. typedef std::vector<BankEntry> bvec;
  30. typedef std::map<std::string,BankEntry> bmap;
  31. //search for banks
  32. //uses a space separated list of keywords and
  33. //finds something that matches ALL keywords
  34. bvec search(std::string) const;
  35. //fully qualified paths only
  36. void addBankDir(std::string);
  37. //clear all known entries and banks
  38. void clear(void);
  39. //List of all tags
  40. svec tags(void) const;
  41. //scan banks
  42. void scanBanks(void);
  43. private:
  44. BankEntry processXiz(std::string, std::string, bmap&) const;
  45. bvec fields;
  46. svec banks;
  47. };
  48. }