OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
zeroconf.hpp
1#pragma once
2#include <ossia/detail/config.hpp>
3
4#include <cinttypes>
5#include <memory>
6#include <string>
7#include <vector>
8
9#include <ossia-config.hpp>
10
11namespace servus
12{
13class Servus;
14}
15
16namespace ossia::net
17{
18struct OSSIA_EXPORT minuit_connection_data
19{
20 std::string name;
21 std::string host;
22 int32_t remote_port{};
23 int32_t local_port{};
24};
25
26using osc_connection_data = minuit_connection_data;
27
28struct OSSIA_EXPORT oscquery_connection_data
29{
30 std::string name;
31 std::string host;
32 int32_t port{};
33};
34
35struct OSSIA_EXPORT zeroconf_server
36{
37 zeroconf_server();
38 zeroconf_server(const zeroconf_server&) = delete;
39 zeroconf_server(zeroconf_server&&) noexcept;
40 zeroconf_server& operator=(const zeroconf_server&) = delete;
41 zeroconf_server& operator=(zeroconf_server&&) noexcept;
42 ~zeroconf_server();
43
44 zeroconf_server(std::unique_ptr<servus::Servus> s);
45
46private:
47 std::unique_ptr<servus::Servus> server;
48};
49
54OSSIA_EXPORT bool zeroconf_supported();
55
63OSSIA_EXPORT std::vector<minuit_connection_data> list_minuit_devices();
64
72OSSIA_EXPORT std::vector<oscquery_connection_data> list_oscquery_devices();
73
82OSSIA_EXPORT zeroconf_server make_zeroconf_server(
83 std::string description, std::string service, std::string local_name,
84 int32_t local_port, int32_t remote_port);
85}