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.

CarlaEngineUtils.hpp 3.3KB

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