2#include <ossia/detail/mutex.hpp>
3#include <ossia/network/base/listening.hpp>
4#include <ossia/network/base/protocol.hpp>
5#include <ossia/network/zeroconf/zeroconf.hpp>
7#include <ossia/detail/hash_map.hpp>
25struct osc_1_0_outbound_stream_visitor;
27class OSSIA_EXPORT OSSIA_DEPRECATED(
"Use make_osc_protocol") osc_protocol final
32 std::string ip, uint16_t remote_port, uint16_t local_port = 0,
33 std::optional<std::string> expose_name = std::nullopt);
35 osc_protocol(
const osc_protocol&) =
delete;
36 osc_protocol(osc_protocol&&) =
delete;
37 osc_protocol& operator=(
const osc_protocol&) =
delete;
38 osc_protocol& operator=(osc_protocol&&) =
delete;
40 ~osc_protocol()
override;
42 const std::string& get_ip()
const;
43 osc_protocol& set_ip(std::string);
45 uint16_t get_remote_port()
const;
46 osc_protocol& set_remote_port(uint16_t);
48 uint16_t get_local_port()
const;
49 osc_protocol& set_local_port(uint16_t);
51 bool learning()
const;
52 osc_protocol& set_learning(
bool);
61 bool push_bundle(
const std::vector<const ossia::net::parameter_base*>&)
override;
62 bool push_raw_bundle(
const std::vector<full_parameter_data>&)
override;
65 bool echo_incoming_message(
69 void enable_buffering(
bool b) { m_buffering = b; }
73 void on_received_message(
74 const oscpack::ReceivedMessage& m,
const oscpack::IpEndpointName& ip);
75 void on_learn(
const oscpack::ReceivedMessage& m);
79 void update_receiver();
80 void update_zeroconf();
82 listened_parameters m_listening;
84 std::unique_ptr<osc::sender<osc_1_0_outbound_stream_visitor>> m_sender;
85 std::unique_ptr<osc::receiver> m_receiver;
87 net::zeroconf_server m_zeroconfServer;
92 uint16_t m_remote_port{};
93 uint16_t m_local_port{};
95 std::atomic_bool m_learning{};
97 std::optional<std::string> m_expose{};
99 message_origin_identifier m_id;
102 std::vector<ossia::net::full_parameter_data> m_buffer;
103 std::mutex m_buffer_mutex;
Root of a device tree.
Definition ossia/network/base/device.hpp:58
The node_base class.
Definition node.hpp:48
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
The protocol_base class.
Definition protocol.hpp:40
The value class.
Definition value.hpp:173
Full information about a parameter.
Definition parameter_data.hpp:61