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.

105 lines
2.6KB

  1. /*
  2. * Carla State utils
  3. * Copyright (C) 2012-2014 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifndef CARLA_STATE_UTILS_HPP_INCLUDED
  18. #define CARLA_STATE_UTILS_HPP_INCLUDED
  19. #include "CarlaBackend.h"
  20. #include "LinkedList.hpp"
  21. namespace juce {
  22. class String;
  23. class XmlElement;
  24. }
  25. CARLA_BACKEND_START_NAMESPACE
  26. // -----------------------------------------------------------------------
  27. struct StateParameter {
  28. bool isInput;
  29. int32_t index;
  30. const char* name;
  31. const char* symbol;
  32. float value;
  33. uint8_t midiChannel;
  34. int16_t midiCC;
  35. StateParameter() noexcept;
  36. ~StateParameter() noexcept;
  37. CARLA_DECLARE_NON_COPY_STRUCT(StateParameter)
  38. };
  39. struct StateCustomData {
  40. const char* type;
  41. const char* key;
  42. const char* value;
  43. StateCustomData() noexcept;
  44. ~StateCustomData() noexcept;
  45. CARLA_DECLARE_NON_COPY_STRUCT(StateCustomData)
  46. };
  47. typedef LinkedList<StateParameter*> StateParameterList;
  48. typedef LinkedList<StateCustomData*> StateCustomDataList;
  49. typedef LinkedList<StateParameter*>::Itenerator StateParameterItenerator;
  50. typedef LinkedList<StateCustomData*>::Itenerator StateCustomDataItenerator;
  51. struct StateSave {
  52. const char* type;
  53. const char* name;
  54. const char* label;
  55. const char* binary;
  56. int64_t uniqueId;
  57. bool active;
  58. float dryWet;
  59. float volume;
  60. float balanceLeft;
  61. float balanceRight;
  62. float panning;
  63. int8_t ctrlChannel;
  64. uint options;
  65. int32_t currentProgramIndex;
  66. const char* currentProgramName;
  67. int32_t currentMidiBank;
  68. int32_t currentMidiProgram;
  69. const char* chunk;
  70. StateParameterList parameters;
  71. StateCustomDataList customData;
  72. StateSave() noexcept;
  73. ~StateSave() noexcept;
  74. void clear() noexcept;
  75. bool fillFromXmlElement(const juce::XmlElement* const xmlElement);
  76. juce::String toString() const;
  77. CARLA_DECLARE_NON_COPY_STRUCT(StateSave)
  78. };
  79. // -----------------------------------------------------------------------
  80. CARLA_BACKEND_END_NAMESPACE
  81. #endif // CARLA_STATE_UTILS_HPP_INCLUDED