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.

273 lines
11KB

  1. /*
  2. * DISTRHO Cardinal Plugin
  3. * Copyright (C) 2021 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 3 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 LICENSE file.
  16. */
  17. #define PRIVATE
  18. #include <common.hpp>
  19. #undef PRIVATE
  20. #include <rack.hpp>
  21. using namespace rack;
  22. namespace rack {
  23. namespace settings {
  24. bool cpuMeter = false;
  25. }
  26. Exception::Exception(const char* format, ...)
  27. {
  28. va_list args;
  29. va_start(args, format);
  30. msg = string::fV(format, args);
  31. va_end(args);
  32. }
  33. namespace asset {
  34. std::string plugin(plugin::Plugin* plugin, std::string filename) { return {}; }
  35. std::string system(std::string filename) { return {}; }
  36. }
  37. namespace engine {
  38. float Engine::getParamValue(Module* module, int paramId) { return 0.0f; }
  39. float Engine::getParamSmoothValue(Module* module, int paramId) { return 0.0f; }
  40. void Engine::setParamValue(Module* module, int paramId, float value) {}
  41. void Engine::setParamSmoothValue(Module* module, int paramId, float value) {}
  42. }
  43. }
  44. namespace rack {
  45. namespace app {
  46. Knob::Knob() {}
  47. Knob::~Knob() {}
  48. void Knob::initParamQuantity() {}
  49. void Knob::onHover(const HoverEvent& e) {}
  50. void Knob::onButton(const ButtonEvent& e) {}
  51. void Knob::onDragStart(const DragStartEvent& e) {}
  52. void Knob::onDragEnd(const DragEndEvent& e) {}
  53. void Knob::onDragMove(const DragMoveEvent& e) {}
  54. void Knob::onDragLeave(const DragLeaveEvent& e) {}
  55. void Knob::onHoverScroll(const HoverScrollEvent& e) {}
  56. void Knob::onLeave(const LeaveEvent& e) {}
  57. void LightWidget::draw(const DrawArgs& args) {}
  58. void LightWidget::drawLayer(const DrawArgs& args, int layer) {}
  59. void LightWidget::drawBackground(const DrawArgs& args) {}
  60. void LightWidget::drawLight(const DrawArgs& args) {}
  61. void LightWidget::drawHalo(const DrawArgs& args) {}
  62. ModuleLightWidget::~ModuleLightWidget() {}
  63. engine::Light* ModuleLightWidget::getLight(int colorId) { return nullptr; }
  64. engine::LightInfo* ModuleLightWidget::getLightInfo() { return nullptr; }
  65. void ModuleLightWidget::createTooltip() {}
  66. void ModuleLightWidget::destroyTooltip() {}
  67. void ModuleLightWidget::step() {}
  68. void ModuleLightWidget::onHover(const HoverEvent& e) {}
  69. void ModuleLightWidget::onEnter(const EnterEvent& e) {}
  70. void ModuleLightWidget::onLeave(const LeaveEvent& e) {}
  71. ModuleWidget::ModuleWidget() {}
  72. ModuleWidget::~ModuleWidget() {}
  73. plugin::Model* ModuleWidget::getModel() { return nullptr; }
  74. void ModuleWidget::setModel(plugin::Model* model) {}
  75. engine::Module* ModuleWidget::getModule() { return nullptr; }
  76. void ModuleWidget::setModule(engine::Module* module) {}
  77. widget::Widget* ModuleWidget::getPanel() { return nullptr; }
  78. void ModuleWidget::setPanel(widget::Widget* panel) {}
  79. void ModuleWidget::setPanel(std::shared_ptr<window::Svg> svg) {}
  80. void ModuleWidget::addParam(ParamWidget* param) {}
  81. void ModuleWidget::addInput(PortWidget* input) {}
  82. void ModuleWidget::addOutput(PortWidget* output) {}
  83. ParamWidget* ModuleWidget::getParam(int paramId) { return nullptr; }
  84. PortWidget* ModuleWidget::getInput(int portId) { return nullptr; }
  85. PortWidget* ModuleWidget::getOutput(int portId) { return nullptr; }
  86. std::vector<ParamWidget*> ModuleWidget::getParams() { return {}; }
  87. std::vector<PortWidget*> ModuleWidget::getPorts() { return {}; }
  88. std::vector<PortWidget*> ModuleWidget::getInputs() { return {}; }
  89. std::vector<PortWidget*> ModuleWidget::getOutputs() { return {}; }
  90. void ModuleWidget::draw(const DrawArgs& args) {}
  91. void ModuleWidget::drawLayer(const DrawArgs& args, int layer) {}
  92. void ModuleWidget::onHover(const HoverEvent& e) {}
  93. void ModuleWidget::onHoverKey(const HoverKeyEvent& e) {}
  94. void ModuleWidget::onButton(const ButtonEvent& e) {}
  95. void ModuleWidget::onDragStart(const DragStartEvent& e) {}
  96. void ModuleWidget::onDragEnd(const DragEndEvent& e) {}
  97. void ModuleWidget::onDragMove(const DragMoveEvent& e) {}
  98. void ModuleWidget::onDragHover(const DragHoverEvent& e) {}
  99. json_t* ModuleWidget::toJson() { return nullptr; }
  100. void ModuleWidget::fromJson(json_t* rootJ) {}
  101. bool ModuleWidget::pasteJsonAction(json_t* rootJ) { return false; }
  102. void ModuleWidget::copyClipboard() {}
  103. bool ModuleWidget::pasteClipboardAction() { return false; }
  104. void ModuleWidget::load(std::string filename) {}
  105. void ModuleWidget::loadAction(std::string filename) {}
  106. void ModuleWidget::loadTemplate() {}
  107. void ModuleWidget::loadDialog() {}
  108. void ModuleWidget::save(std::string filename) {}
  109. void ModuleWidget::saveTemplate() {}
  110. void ModuleWidget::saveTemplateDialog() {}
  111. bool ModuleWidget::hasTemplate() { return false; }
  112. void ModuleWidget::clearTemplate() {}
  113. void ModuleWidget::clearTemplateDialog() {}
  114. void ModuleWidget::saveDialog() {}
  115. void ModuleWidget::disconnect() {}
  116. void ModuleWidget::resetAction() {}
  117. void ModuleWidget::randomizeAction() {}
  118. void ModuleWidget::appendDisconnectActions(history::ComplexAction* complexAction) {}
  119. void ModuleWidget::disconnectAction() {}
  120. void ModuleWidget::cloneAction(bool cloneCables) {}
  121. void ModuleWidget::bypassAction(bool bypassed) {}
  122. void ModuleWidget::removeAction() {}
  123. void ModuleWidget::createContextMenu() {}
  124. math::Vec& ModuleWidget::dragOffset() { static math::Vec r; return r; }
  125. bool& ModuleWidget::dragEnabled() { static bool r; return r; }
  126. math::Vec& ModuleWidget::oldPos() { static math::Vec r; return r; }
  127. engine::Module* ModuleWidget::releaseModule() { return nullptr; }
  128. int MultiLightWidget::getNumColors() { return 0; }
  129. void MultiLightWidget::addBaseColor(NVGcolor baseColor) {}
  130. void MultiLightWidget::setBrightnesses(const std::vector<float>& brightnesses) {}
  131. ParamWidget::ParamWidget() {}
  132. ParamWidget::~ParamWidget() {}
  133. engine::ParamQuantity* ParamWidget::getParamQuantity() { return nullptr; }
  134. void ParamWidget::createTooltip() {}
  135. void ParamWidget::destroyTooltip() {}
  136. void ParamWidget::step() {}
  137. void ParamWidget::draw(const DrawArgs& args) {}
  138. void ParamWidget::onButton(const ButtonEvent& e) {}
  139. void ParamWidget::onDoubleClick(const DoubleClickEvent& e) {}
  140. void ParamWidget::onEnter(const EnterEvent& e) {}
  141. void ParamWidget::onLeave(const LeaveEvent& e) {}
  142. void ParamWidget::createContextMenu() {}
  143. void ParamWidget::resetAction() {}
  144. PortWidget::PortWidget() {}
  145. PortWidget::~PortWidget() {}
  146. engine::Port* PortWidget::getPort() { return nullptr; }
  147. engine::PortInfo* PortWidget::getPortInfo() { return nullptr; }
  148. void PortWidget::createTooltip() {}
  149. void PortWidget::destroyTooltip() {}
  150. void PortWidget::createContextMenu() {}
  151. void PortWidget::deleteTopCableAction() {}
  152. void PortWidget::step() {}
  153. void PortWidget::draw(const DrawArgs& args) {}
  154. void PortWidget::onButton(const ButtonEvent& e) {}
  155. void PortWidget::onEnter(const EnterEvent& e) {}
  156. void PortWidget::onLeave(const LeaveEvent& e) {}
  157. void PortWidget::onDragStart(const DragStartEvent& e) {}
  158. void PortWidget::onDragEnd(const DragEndEvent& e) {}
  159. void PortWidget::onDragDrop(const DragDropEvent& e) {}
  160. void PortWidget::onDragEnter(const DragEnterEvent& e) {}
  161. void PortWidget::onDragLeave(const DragLeaveEvent& e) {}
  162. SliderKnob::SliderKnob() {}
  163. void SliderKnob::onHover(const HoverEvent& e) {}
  164. void SliderKnob::onButton(const ButtonEvent& e) {}
  165. SvgKnob::SvgKnob() {}
  166. void SvgKnob::setSvg(std::shared_ptr<window::Svg> svg) {}
  167. void SvgKnob::onChange(const ChangeEvent& e) {}
  168. SvgPort::SvgPort() {}
  169. void SvgPort::setSvg(std::shared_ptr<window::Svg> svg) {}
  170. SvgScrew::SvgScrew() {}
  171. void SvgScrew::setSvg(std::shared_ptr<window::Svg> svg) {}
  172. SvgSlider::SvgSlider() {}
  173. void SvgSlider::setBackgroundSvg(std::shared_ptr<window::Svg> svg) {}
  174. void SvgSlider::setHandleSvg(std::shared_ptr<window::Svg> svg) {}
  175. void SvgSlider::setHandlePos(math::Vec minHandlePos, math::Vec maxHandlePos) {}
  176. void SvgSlider::setHandlePosCentered(math::Vec minHandlePosCentered, math::Vec maxHandlePosCentered) {}
  177. void SvgSlider::onChange(const ChangeEvent& e) {}
  178. }
  179. namespace engine {
  180. std::string LightInfo::getName() { return name; }
  181. std::string LightInfo::getDescription() { return description; }
  182. }
  183. namespace widget {
  184. FramebufferWidget::FramebufferWidget() {}
  185. FramebufferWidget::~FramebufferWidget() {}
  186. void FramebufferWidget::setDirty(bool dirty) {}
  187. int FramebufferWidget::getImageHandle() { return 0; }
  188. NVGLUframebuffer* FramebufferWidget::getFramebuffer() { return nullptr; }
  189. math::Vec FramebufferWidget::getFramebufferSize() { return {}; }
  190. void FramebufferWidget::deleteFramebuffer() {}
  191. void FramebufferWidget::step() {}
  192. void FramebufferWidget::draw(const DrawArgs& args) {}
  193. void FramebufferWidget::render(math::Vec scale, math::Vec offsetF, math::Rect clipBox) {}
  194. void FramebufferWidget::drawFramebuffer() {}
  195. void FramebufferWidget::onDirty(const DirtyEvent& e) {}
  196. void FramebufferWidget::onContextCreate(const ContextCreateEvent& e) {}
  197. void FramebufferWidget::onContextDestroy(const ContextDestroyEvent& e) {}
  198. SvgWidget::SvgWidget() {}
  199. void SvgWidget::wrap() {}
  200. void SvgWidget::setSvg(std::shared_ptr<window::Svg> svg) {}
  201. void SvgWidget::draw(const DrawArgs& args) {}
  202. Widget::~Widget() {}
  203. math::Rect Widget::getBox() { return {}; }
  204. void Widget::setBox(math::Rect box) {}
  205. math::Vec Widget::getPosition() { return {}; }
  206. void Widget::setPosition(math::Vec pos) {}
  207. math::Vec Widget::getSize() { return {}; }
  208. void Widget::setSize(math::Vec size) {}
  209. widget::Widget* Widget::getParent() { return nullptr; }
  210. bool Widget::isVisible() { return false; }
  211. void Widget::setVisible(bool visible) {}
  212. void Widget::requestDelete() {}
  213. math::Rect Widget::getChildrenBoundingBox() { return {}; }
  214. math::Rect Widget::getVisibleChildrenBoundingBox() { return {}; }
  215. bool Widget::isDescendantOf(Widget* ancestor) { return false; }
  216. math::Vec Widget::getRelativeOffset(math::Vec v, Widget* ancestor) { return {}; }
  217. float Widget::getRelativeZoom(Widget* ancestor) { return 0.0f; }
  218. math::Rect Widget::getViewport(math::Rect r) { return {}; }
  219. bool Widget::hasChild(Widget* child) { return false; }
  220. void Widget::addChild(Widget* child) {}
  221. void Widget::addChildBottom(Widget* child) {}
  222. void Widget::addChildBelow(Widget* child, Widget* sibling) {}
  223. void Widget::addChildAbove(Widget* child, Widget* sibling) {}
  224. void Widget::removeChild(Widget* child) {}
  225. void Widget::clearChildren() {}
  226. void Widget::step() {}
  227. void Widget::draw(const DrawArgs& args) {}
  228. void Widget::drawLayer(const DrawArgs& args, int layer) {}
  229. void Widget::drawChild(Widget* child, const DrawArgs& args, int layer) {}
  230. }
  231. namespace window {
  232. Svg::~Svg() {}
  233. void Svg::loadFile(const std::string& filename) {}
  234. void Svg::loadString(const std::string& str) {}
  235. math::Vec Svg::getSize() { return {}; }
  236. int Svg::getNumShapes() { return 0; }
  237. int Svg::getNumPaths() { return 0; }
  238. int Svg::getNumPoints() { return 0; }
  239. void Svg::draw(NVGcontext* vg) {}
  240. std::shared_ptr<Svg> Svg::load(const std::string& filename) { return {}; }
  241. }
  242. }