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.

110 lines
2.7KB

  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. // -----------------------------------------------------------------------
  26. CARLA_BACKEND_START_NAMESPACE
  27. #if 0
  28. } // Fix editor indentation
  29. #endif
  30. // -----------------------------------------------------------------------
  31. struct StateParameter {
  32. bool isInput;
  33. int32_t index;
  34. const char* name;
  35. const char* symbol;
  36. float value;
  37. uint8_t midiChannel;
  38. int16_t midiCC;
  39. StateParameter() noexcept;
  40. ~StateParameter() noexcept;
  41. CARLA_DECLARE_NON_COPY_STRUCT(StateParameter)
  42. };
  43. struct StateCustomData {
  44. const char* type;
  45. const char* key;
  46. const char* value;
  47. StateCustomData() noexcept;
  48. ~StateCustomData() noexcept;
  49. CARLA_DECLARE_NON_COPY_STRUCT(StateCustomData)
  50. };
  51. typedef LinkedList<StateParameter*> StateParameterList;
  52. typedef LinkedList<StateCustomData*> StateCustomDataList;
  53. typedef LinkedList<StateParameter*>::Itenerator StateParameterItenerator;
  54. typedef LinkedList<StateCustomData*>::Itenerator StateCustomDataItenerator;
  55. struct StateSave {
  56. const char* type;
  57. const char* name;
  58. const char* label;
  59. const char* binary;
  60. int64_t uniqueId;
  61. bool active;
  62. float dryWet;
  63. float volume;
  64. float balanceLeft;
  65. float balanceRight;
  66. float panning;
  67. int8_t ctrlChannel;
  68. int32_t currentProgramIndex;
  69. const char* currentProgramName;
  70. int32_t currentMidiBank;
  71. int32_t currentMidiProgram;
  72. const char* chunk;
  73. StateParameterList parameters;
  74. StateCustomDataList customData;
  75. StateSave() noexcept;
  76. ~StateSave() noexcept;
  77. void clear() noexcept;
  78. bool fillFromXmlElement(const juce::XmlElement* const xmlElement);
  79. juce::String toString() const;
  80. CARLA_DECLARE_NON_COPY_STRUCT(StateSave)
  81. };
  82. // -----------------------------------------------------------------------
  83. CARLA_BACKEND_END_NAMESPACE
  84. #endif // CARLA_STATE_UTILS_HPP_INCLUDED