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.

56 lines
1.2KB

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