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.

71 lines
2.0KB

  1. /*
  2. ZynAddSubFX - a software synthesizer
  3. PresetsStore.cpp - Presets and Clipboard store
  4. Copyright (C) 2002-2005 Nasca Octavian Paul
  5. Author: Nasca Octavian Paul
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of version 2 of the GNU General Public License
  8. as published by the Free Software Foundation.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License (version 2 or later) for more details.
  13. You should have received a copy of the GNU General Public License (version 2)
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. #ifndef PRESETSTORE_H
  18. #define PRESETSTORE_H
  19. #include <string>
  20. #include <vector>
  21. #include "../Misc/XMLwrapper.h"
  22. #include "../Misc/Config.h"
  23. #define MAX_PRESETTYPE_SIZE 30
  24. class PresetsStore
  25. {
  26. public:
  27. PresetsStore();
  28. ~PresetsStore();
  29. //Clipboard stuff
  30. void copyclipboard(XMLwrapper *xml, char *type);
  31. bool pasteclipboard(XMLwrapper *xml);
  32. bool checkclipboardtype(const char *type);
  33. //presets stuff
  34. void copypreset(XMLwrapper *xml, char *type, std::string name);
  35. bool pastepreset(XMLwrapper *xml, unsigned int npreset);
  36. void deletepreset(unsigned int npreset);
  37. struct presetstruct {
  38. presetstruct(std::string _file, std::string _name)
  39. :file(_file), name(_name) {}
  40. bool operator<(const presetstruct &b) const;
  41. std::string file;
  42. std::string name;
  43. };
  44. std::vector<presetstruct> presets;
  45. void rescanforpresets(const std::string &type);
  46. private:
  47. struct {
  48. char *data;
  49. char type[MAX_PRESETTYPE_SIZE];
  50. } clipboard;
  51. void clearpresets();
  52. };
  53. extern PresetsStore presetsstore;
  54. #endif