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.

120 lines
3.4KB

  1. /*
  2. * Carla Engine utils
  3. * Copyright (C) 2011-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_ENGINE_UTILS_HPP_INCLUDED
  18. #define CARLA_ENGINE_UTILS_HPP_INCLUDED
  19. #include "CarlaEngine.hpp"
  20. #include "CarlaUtils.hpp"
  21. CARLA_BACKEND_START_NAMESPACE
  22. // -----------------------------------------------------------------------
  23. // Maximum internal pre-allocated events
  24. const ushort kMaxEngineEventInternalCount = 512;
  25. // -----------------------------------------------------------------------
  26. static inline
  27. const char* EngineType2Str(const EngineType type) noexcept
  28. {
  29. switch (type)
  30. {
  31. case kEngineTypeNull:
  32. return "kEngineTypeNull";
  33. case kEngineTypeJack:
  34. return "kEngineTypeJack";
  35. case kEngineTypeJuce:
  36. return "kEngineTypeJuce";
  37. case kEngineTypeRtAudio:
  38. return "kEngineTypeRtAudio";
  39. case kEngineTypePlugin:
  40. return "kEngineTypePlugin";
  41. case kEngineTypeBridge:
  42. return "kEngineTypeBridge";
  43. }
  44. carla_stderr("CarlaBackend::EngineType2Str(%i) - invalid type", type);
  45. return nullptr;
  46. }
  47. static inline
  48. const char* EnginePortType2Str(const EnginePortType type) noexcept
  49. {
  50. switch (type)
  51. {
  52. case kEnginePortTypeNull:
  53. return "kEnginePortTypeNull";
  54. case kEnginePortTypeAudio:
  55. return "kEnginePortTypeAudio";
  56. case kEnginePortTypeCV:
  57. return "kEnginePortTypeCV";
  58. case kEnginePortTypeEvent:
  59. return "kEnginePortTypeEvent";
  60. }
  61. carla_stderr("CarlaBackend::EnginePortType2Str(%i) - invalid type", type);
  62. return nullptr;
  63. }
  64. static inline
  65. const char* EngineEventType2Str(const EngineEventType type) noexcept
  66. {
  67. switch (type)
  68. {
  69. case kEngineEventTypeNull:
  70. return "kEngineEventTypeNull";
  71. case kEngineEventTypeControl:
  72. return "kEngineEventTypeControl";
  73. case kEngineEventTypeMidi:
  74. return "kEngineEventTypeMidi";
  75. }
  76. carla_stderr("CarlaBackend::EngineEventType2Str(%i) - invalid type", type);
  77. return nullptr;
  78. }
  79. static inline
  80. const char* EngineControlEventType2Str(const EngineControlEventType type) noexcept
  81. {
  82. switch (type)
  83. {
  84. case kEngineControlEventTypeNull:
  85. return "kEngineNullEvent";
  86. case kEngineControlEventTypeParameter:
  87. return "kEngineControlEventTypeParameter";
  88. case kEngineControlEventTypeMidiBank:
  89. return "kEngineControlEventTypeMidiBank";
  90. case kEngineControlEventTypeMidiProgram:
  91. return "kEngineControlEventTypeMidiProgram";
  92. case kEngineControlEventTypeAllSoundOff:
  93. return "kEngineControlEventTypeAllSoundOff";
  94. case kEngineControlEventTypeAllNotesOff:
  95. return "kEngineControlEventTypeAllNotesOff";
  96. }
  97. carla_stderr("CarlaBackend::EngineControlEventType2Str(%i) - invalid type", type);
  98. return nullptr;
  99. }
  100. // -----------------------------------------------------------------------
  101. CARLA_BACKEND_END_NAMESPACE
  102. #endif // CARLA_ENGINE_UTILS_HPP_INCLUDED