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.

CarlaBackendDummy.cpp 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. /*
  2. * Carla Tests
  3. * Copyright (C) 2013 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. #include "CarlaPlugin.hpp"
  18. #include "CarlaEngine.hpp"
  19. CARLA_BACKEND_START_NAMESPACE
  20. // 1 - utils
  21. // 2 - engine
  22. // 3 - plugin
  23. // 4 - standalone
  24. #define ANSI_TEST_N 2
  25. #if ANSI_TEST_N != 3
  26. struct SaveState {};
  27. // -----------------------------------------------------------------------
  28. // Fallback data
  29. static const ParameterData kParameterDataNull;
  30. static const ParameterRanges kParameterRangesNull;
  31. static const MidiProgramData kMidiProgramDataNull;
  32. static const CustomData kCustomDataNull;
  33. // -----------------------------------------------------------------------
  34. // CarlaPlugin
  35. CarlaPlugin::CarlaPlugin(CarlaEngine* const, const unsigned int id)
  36. : fId(id), pData(nullptr) {}
  37. CarlaPlugin::~CarlaPlugin() {}
  38. uint32_t CarlaPlugin::getLatencyInFrames() const noexcept { return 0; }
  39. uint32_t CarlaPlugin::getAudioInCount() const noexcept { return 0; }
  40. uint32_t CarlaPlugin::getAudioOutCount() const noexcept { return 0; }
  41. uint32_t CarlaPlugin::getMidiInCount() const noexcept { return 0; }
  42. uint32_t CarlaPlugin::getMidiOutCount() const noexcept { return 0; }
  43. uint32_t CarlaPlugin::getParameterCount() const noexcept { return 0; }
  44. uint32_t CarlaPlugin::getParameterScalePointCount(const uint32_t) const { return 0; }
  45. uint32_t CarlaPlugin::getProgramCount() const noexcept { return 0; }
  46. uint32_t CarlaPlugin::getMidiProgramCount() const noexcept { return 0; }
  47. uint32_t CarlaPlugin::getCustomDataCount() const noexcept { return 0; }
  48. int32_t CarlaPlugin::getCurrentProgram() const noexcept { return 0; }
  49. int32_t CarlaPlugin::getCurrentMidiProgram() const noexcept { return 0; }
  50. const ParameterData& CarlaPlugin::getParameterData(const uint32_t) const { return kParameterDataNull; }
  51. const ParameterRanges& CarlaPlugin::getParameterRanges(const uint32_t) const { return kParameterRangesNull; }
  52. bool CarlaPlugin::isParameterOutput(const uint32_t) const { return false; }
  53. const MidiProgramData& CarlaPlugin::getMidiProgramData(const uint32_t) const { return kMidiProgramDataNull; }
  54. const CustomData& CarlaPlugin::getCustomData(const uint32_t) const { return kCustomDataNull; }
  55. int32_t CarlaPlugin::getChunkData(void** const) const { return 0; }
  56. unsigned int CarlaPlugin::getAvailableOptions() const { return 0x0; }
  57. float CarlaPlugin::getParameterValue(const uint32_t) const { return 0.0f; }
  58. float CarlaPlugin::getParameterScalePointValue(const uint32_t, const uint32_t) const { return 0.0f; }
  59. void CarlaPlugin::getLabel(char* const) const noexcept {}
  60. void CarlaPlugin::getMaker(char* const) const noexcept {}
  61. void CarlaPlugin::getCopyright(char* const) const noexcept {}
  62. void CarlaPlugin::getRealName(char* const) const noexcept {}
  63. void CarlaPlugin::getParameterName(const uint32_t, char* const) const {}
  64. void CarlaPlugin::getParameterSymbol(const uint32_t, char* const) const {}
  65. void CarlaPlugin::getParameterText(const uint32_t, char* const) const {}
  66. void CarlaPlugin::getParameterUnit(const uint32_t, char* const) const {}
  67. void CarlaPlugin::getParameterScalePointLabel(const uint32_t, const uint32_t, char* const) const {}
  68. void CarlaPlugin::getProgramName(const uint32_t, char* const) const {}
  69. void CarlaPlugin::getMidiProgramName(const uint32_t, char* const) const {}
  70. void CarlaPlugin::getParameterCountInfo(uint32_t* const, uint32_t* const, uint32_t* const) const {}
  71. void CarlaPlugin::prepareForSave() {}
  72. const SaveState& CarlaPlugin::getSaveState() { static SaveState saveState; return saveState; }
  73. void CarlaPlugin::loadSaveState(const SaveState&) {}
  74. bool CarlaPlugin::saveStateToFile(const char* const) { return false; }
  75. bool CarlaPlugin::loadStateFromFile(const char* const) { return false; }
  76. void CarlaPlugin::setId(const unsigned int newId) noexcept { fId = newId; }
  77. void CarlaPlugin::setName(const char* const newName) { fName = newName; }
  78. void CarlaPlugin::setEnabled(const bool yesNo) { fEnabled = yesNo; }
  79. void CarlaPlugin::setOption(const unsigned int, const bool) {}
  80. void CarlaPlugin::setActive(const bool, const bool, const bool) {}
  81. void CarlaPlugin::setDryWet(const float, const bool, const bool) {}
  82. void CarlaPlugin::setVolume(const float, const bool, const bool) {}
  83. void CarlaPlugin::setBalanceLeft(const float, const bool, const bool) {}
  84. void CarlaPlugin::setBalanceRight(const float, const bool, const bool) {}
  85. void CarlaPlugin::setPanning(const float, const bool, const bool) {}
  86. void CarlaPlugin::setCtrlChannel(const int8_t, const bool, const bool) {}
  87. void CarlaPlugin::setParameterValue(const uint32_t, const float, const bool, const bool, const bool) {}
  88. void CarlaPlugin::setParameterValueByRealIndex(const int32_t, const float, const bool, const bool, const bool) {}
  89. void CarlaPlugin::setParameterMidiChannel(const uint32_t, uint8_t, const bool, const bool) {}
  90. void CarlaPlugin::setParameterMidiCC(const uint32_t, int16_t, const bool, const bool) {}
  91. void CarlaPlugin::setCustomData(const char* const, const char* const, const char* const, const bool) {}
  92. void CarlaPlugin::setChunkData(const char* const) {}
  93. void CarlaPlugin::setProgram(int32_t, const bool, const bool, const bool) {}
  94. void CarlaPlugin::setMidiProgram(int32_t, const bool, const bool, const bool) {}
  95. void CarlaPlugin::setMidiProgramById(const uint32_t, const uint32_t, const bool, const bool, const bool) {}
  96. void CarlaPlugin::showGui(const bool) {}
  97. void CarlaPlugin::idleGui() {}
  98. void CarlaPlugin::reloadPrograms(const bool) {}
  99. void CarlaPlugin::activate() {}
  100. void CarlaPlugin::deactivate() {}
  101. void CarlaPlugin::bufferSizeChanged(const uint32_t) {}
  102. void CarlaPlugin::sampleRateChanged(const double) {}
  103. void CarlaPlugin::offlineModeChanged(const bool) {}
  104. bool CarlaPlugin::tryLock() { return false; }
  105. void CarlaPlugin::unlock() {}
  106. void CarlaPlugin::initBuffers() {}
  107. void CarlaPlugin::clearBuffers() {}
  108. void CarlaPlugin::registerToOscClient() {}
  109. void CarlaPlugin::updateOscData(const lo_address&, const char* const) {}
  110. //void CarlaPlugin::freeOscData() {}
  111. bool CarlaPlugin::waitForOscGuiShow() { return false; }
  112. void CarlaPlugin::sendMidiSingleNote(const uint8_t, const uint8_t, const uint8_t, const bool, const bool, const bool) {}
  113. void CarlaPlugin::sendMidiAllNotesOffToCallback() {}
  114. void CarlaPlugin::postRtEventsRun() {}
  115. void CarlaPlugin::uiParameterChange(const uint32_t, const float) {}
  116. void CarlaPlugin::uiProgramChange(const uint32_t) {}
  117. void CarlaPlugin::uiMidiProgramChange(const uint32_t) {}
  118. void CarlaPlugin::uiNoteOn(const uint8_t, const uint8_t, const uint8_t) {}
  119. void CarlaPlugin::uiNoteOff(const uint8_t, const uint8_t) {}
  120. size_t CarlaPlugin::getNativePluginCount() { return 0; }
  121. const PluginDescriptor* CarlaPlugin::getNativePluginDescriptor(const size_t) { return nullptr; }
  122. #endif
  123. #if ANSI_TEST_N != 2
  124. // -----------------------------------------------------------------------
  125. // CarlaEngine
  126. CarlaEngine::CarlaEngine()
  127. : fBufferSize(0),
  128. fSampleRate(0.0),
  129. pData(nullptr) {}
  130. CarlaEngine::~CarlaEngine() {}
  131. unsigned int CarlaEngine::getDriverCount() { return 0; }
  132. const char* CarlaEngine::getDriverName(const unsigned int) { return nullptr; }
  133. const char** CarlaEngine::getDriverDeviceNames(const unsigned int) { return nullptr; }
  134. CarlaEngine* CarlaEngine::newDriverByName(const char* const) { return nullptr; }
  135. unsigned int CarlaEngine::getMaxClientNameSize() const noexcept { return 0; }
  136. unsigned int CarlaEngine::getMaxPortNameSize() const noexcept { return 0; }
  137. unsigned int CarlaEngine::getCurrentPluginCount() const noexcept { return 0; }
  138. unsigned int CarlaEngine::getMaxPluginNumber() const noexcept { return 0; }
  139. bool CarlaEngine::init(const char* const) { return false; }
  140. bool CarlaEngine::close() { return false; }
  141. void CarlaEngine::idle() {}
  142. CarlaEngineClient* CarlaEngine::addClient(CarlaPlugin* const) { return nullptr; }
  143. void CarlaEngine::removeAllPlugins() {}
  144. bool CarlaEngine::addPlugin(const BinaryType, const PluginType, const char* const, const char* const, const char* const,
  145. const void* const) { return false; }
  146. bool CarlaEngine::removePlugin(const unsigned int) { return false; }
  147. bool CarlaEngine::clonePlugin(const unsigned int) { return false; }
  148. bool CarlaEngine::replacePlugin(const unsigned int) { return false; }
  149. bool CarlaEngine::switchPlugins(const unsigned int, const unsigned int) { return false; }
  150. const char* CarlaEngine::renamePlugin(const unsigned int, const char* const) { return nullptr; }
  151. CarlaPlugin* CarlaEngine::getPlugin(const unsigned int) const { return nullptr; }
  152. CarlaPlugin* CarlaEngine::getPluginUnchecked(const unsigned int) const noexcept { return nullptr; }
  153. const char* CarlaEngine::getUniquePluginName(const char* const) { return nullptr; }
  154. bool CarlaEngine::loadFilename(const char* const) { return false; }
  155. bool CarlaEngine::loadProject(const char* const) { return false; }
  156. bool CarlaEngine::saveProject(const char* const) { return false; }
  157. float CarlaEngine::getInputPeak(const unsigned int, const unsigned short) const { return 0.0f; }
  158. float CarlaEngine::getOutputPeak(const unsigned int, const unsigned short) const { return 0.0f; }
  159. void CarlaEngine::callback(const CallbackType, const unsigned int, const int, const int, const float, const char* const) {}
  160. void CarlaEngine::setCallback(const CallbackFunc, void* const) {}
  161. bool CarlaEngine::patchbayConnect(int, int) { return false; }
  162. bool CarlaEngine::patchbayDisconnect(int) { return false; }
  163. void CarlaEngine::patchbayRefresh() {}
  164. void CarlaEngine::transportPlay() {}
  165. void CarlaEngine::transportPause() {}
  166. void CarlaEngine::transportRelocate(const uint32_t) {}
  167. const char* CarlaEngine::getLastError() const noexcept { return nullptr; }
  168. void CarlaEngine::setLastError(const char* const) {}
  169. void CarlaEngine::setAboutToClose() {}
  170. void CarlaEngine::setOption(const OptionsType, const int, const char* const) {}
  171. bool CarlaEngine::isOscControlRegistered() const noexcept { return false; }
  172. void CarlaEngine::idleOsc() {}
  173. const char* CarlaEngine::getOscServerPathTCP() const noexcept { return nullptr; }
  174. const char* CarlaEngine::getOscServerPathUDP() const noexcept { return nullptr; }
  175. #endif
  176. // -----------------------------------------------------------------------
  177. CARLA_BACKEND_END_NAMESPACE