VstPresets.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * VstPresets.h
  3. * ------------
  4. * Purpose: Plugin preset / bank handling
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. #include <iosfwd>
  12. #include "../common/FileReaderFwd.h"
  13. OPENMPT_NAMESPACE_BEGIN
  14. class IMixPlugin;
  15. class VSTPresets
  16. {
  17. public:
  18. enum ErrorCode
  19. {
  20. noError,
  21. invalidFile,
  22. wrongPlugin,
  23. wrongParameters,
  24. outOfMemory,
  25. };
  26. #ifndef NO_PLUGINS
  27. static ErrorCode LoadFile(FileReader &file, IMixPlugin &plugin);
  28. static bool SaveFile(std::ostream &, IMixPlugin &plugin, bool bank);
  29. static const char *GetErrorMessage(ErrorCode code);
  30. protected:
  31. static void SaveProgram(std::ostream &f, IMixPlugin &plugin);
  32. #else
  33. static ErrorCode LoadFile(FileReader &, IMixPlugin &) { return invalidFile; }
  34. static bool SaveFile(std::ostream &, IMixPlugin &, bool) { return false; }
  35. static const char *GetErrorMessage(ErrorCode) { return "OpenMPT has been built without plugin support"; }
  36. #endif // NO_PLUGINS
  37. };
  38. OPENMPT_NAMESPACE_END