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.

PipeServer.cpp 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Carla Pipe Tests
  3. * Copyright (C) 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. #include "CarlaPipeUtils.hpp"
  18. static bool gStopNow = false;
  19. class ExternalPluginUI : public CarlaPipeServer
  20. {
  21. public:
  22. ExternalPluginUI()
  23. {
  24. }
  25. void fail(const char* const error) override
  26. {
  27. carla_stderr2(error);
  28. }
  29. bool msgReceived(const char* const msg) noexcept override
  30. {
  31. carla_stderr("msgReceived : %s", msg);
  32. if (std::strcmp(msg, "exiting") == 0)
  33. {
  34. waitChildClose();
  35. gStopNow = true;
  36. }
  37. return false;
  38. }
  39. };
  40. int main()
  41. {
  42. ExternalPluginUI ui;
  43. if (! ui.start("/home/falktx/FOSS/GIT-mine/Carla/bin/resources/carla-plugin", "44100.0", "Ui title here"))
  44. {
  45. carla_stderr("failed to start");
  46. return 1;
  47. }
  48. ui.writeMsg("show\n", 5);
  49. for (int i=0; i < 500 && ! gStopNow; ++i)
  50. {
  51. ui.idle();
  52. carla_msleep(10);
  53. }
  54. return 0;
  55. }