Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
OscSender.h
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 #include <string>
6 
7 class UdpClient;
8 class AuxTaskNonRT;
9 namespace oscpkt{
10  class Message;
11  class PacketWriter;
12 }
13 
23 class OscSender{
24  public:
25  OscSender();
26  OscSender(int port, std::string ip_address=std::string("127.0.0.1"));
27  ~OscSender();
28 
40  void setup(int port, std::string ip_address=std::string("127.0.0.1"));
41 
48  OscSender &newMessage(std::string address);
57  OscSender &add(int payload);
66  OscSender &add(float payload);
75  OscSender &add(std::string payload);
84  OscSender &add(bool payload);
95  OscSender &add(void *ptr, size_t num_bytes);
104  void send();
111  void send(const oscpkt::Message& extMsg);
112 
113  std::unique_ptr<UdpClient> socket;
114 
115  std::unique_ptr<oscpkt::Message> msg;
116  std::unique_ptr<oscpkt::PacketWriter> pw;
117 
118  std::unique_ptr<AuxTaskNonRT> send_task;
119  void send_task_func(void* buf, int size);
120 };
void send()
Sends the message.
Definition: OscSender.cpp:61
OscSender & newMessage(std::string address)
Creates a new OSC message.
Definition: OscSender.cpp:35
OscSender & add(int payload)
Adds an int argument to a message.
Definition: OscSender.cpp:40
void setup(int port, std::string ip_address=std::string("127.0.0.1"))
Initialises OscSender.
Definition: OscSender.cpp:22
Definition: UdpClient.h:5
Definition: AuxTaskNonRT.h:20
OscSender provides functions for sending OSC messages from Bela.
Definition: OscSender.h:23