summaryrefslogtreecommitdiffstats
path: root/include/ingen/client/SigClientInterface.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 22:41:11 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commitc0f567d3232cbe165e56cb2684cda52df7cfb90f (patch)
tree3ffbe6df3f2056fd579a954e00f0bea49b47104e /include/ingen/client/SigClientInterface.hpp
parent9eadae8edc7a35f87499f58c3e3b9cec68f74a80 (diff)
downloadingen-c0f567d3232cbe165e56cb2684cda52df7cfb90f.tar.gz
ingen-c0f567d3232cbe165e56cb2684cda52df7cfb90f.tar.bz2
ingen-c0f567d3232cbe165e56cb2684cda52df7cfb90f.zip
Move public headers to a separate include directory
This is more conventional and probably best practice (since it avoids polluting the include path with non-headers), and is supported by the clang-tidy llvm-header-guard check.
Diffstat (limited to 'include/ingen/client/SigClientInterface.hpp')
-rw-r--r--include/ingen/client/SigClientInterface.hpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/ingen/client/SigClientInterface.hpp b/include/ingen/client/SigClientInterface.hpp
new file mode 100644
index 00000000..674714a3
--- /dev/null
+++ b/include/ingen/client/SigClientInterface.hpp
@@ -0,0 +1,63 @@
+/*
+ This file is part of Ingen.
+ Copyright 2007-2016 David Robillard <http://drobilla.net/>
+
+ Ingen is free software: you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or any later version.
+
+ Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU Affero General Public License for details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with Ingen. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef INGEN_CLIENT_SIGCLIENTINTERFACE_HPP
+#define INGEN_CLIENT_SIGCLIENTINTERFACE_HPP
+
+#include "ingen/Interface.hpp"
+#include "ingen/client/signal.hpp"
+#include "ingen/ingen.h"
+#include "raul/Path.hpp"
+
+#include <cstdint>
+#include <string>
+
+namespace ingen {
+namespace client {
+
+/** A LibSigC++ signal emitting interface for clients to use.
+ *
+ * This simply emits a signal for every event that comes from the engine.
+ * For a higher level model based view of the engine, use ClientStore.
+ *
+ * The signals here match the calls to ClientInterface exactly. See the
+ * documentation for ClientInterface for meanings of signal parameters.
+ *
+ * @ingroup IngenClient
+ */
+class INGEN_API SigClientInterface : public ingen::Interface,
+ public INGEN_TRACKABLE
+{
+public:
+ SigClientInterface() = default;
+
+ URI uri() const override { return URI("ingen:/clients/sig"); }
+
+ INGEN_SIGNAL(message, void, Message)
+
+ /** Fire pending signals. Only does anything on derived classes (that may queue) */
+ virtual bool emit_signals() { return false; }
+
+protected:
+ void message(const Message& msg) override {
+ _signal_message(msg);
+ }
+};
+
+} // namespace client
+} // namespace ingen
+
+#endif