Fix last commit
[carla.git] / source / tests.old / PipeServer.cpp
blobb199d6c3ef64ee1215fb2ad437c0ab8d16873327
1 /*
2 * Carla Pipe Tests
3 * Copyright (C) 2014 Filipe Coelho <falktx@falktx.com>
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.
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.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #include "CarlaPipeUtils.hpp"
20 static bool gStopNow = false;
22 class ExternalPluginUI : public CarlaPipeServer
24 public:
25 ExternalPluginUI()
29 void fail(const char* const error) override
31 carla_stderr2(error);
34 bool msgReceived(const char* const msg) noexcept override
36 carla_stderr("msgReceived : %s", msg);
38 if (std::strcmp(msg, "exiting") == 0)
40 waitChildClose();
41 gStopNow = true;
44 return false;
48 int main()
50 ExternalPluginUI ui;
52 if (! ui.start("/home/falktx/FOSS/GIT-mine/Carla/bin/resources/carla-plugin", "44100.0", "Ui title here"))
54 carla_stderr("failed to start");
55 return 1;
58 ui.writeMsg("show\n", 5);
60 for (int i=0; i < 500 && ! gStopNow; ++i)
62 ui.idle();
63 carla_msleep(10);
66 return 0;