-
Notifications
You must be signed in to change notification settings - Fork 0
/
OscTransmitter.h
46 lines (37 loc) · 1.06 KB
/
OscTransmitter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* OscTransmitter.h
*
* Created on: Mar 12, 2014
* Author: edwinrietmeijer
*/
#ifndef OSCTRANSMITTER_H_
#define OSCTRANSMITTER_H_
#include <string>
#include <iostream>
#include "osc/OscReceivedElements.h"
#include "osc/OscPacketListener.h"
#include "osc/OscOutboundPacketStream.h"
#include "ip/IpEndpointName.h"
#include "ip/UdpSocket.h"
#define ADDRESS "127.0.0.1"
#define SENDPORT 7001
#define OUTPUT_BUFFER_SIZE 1024
// OSC Transmitter, sends out note data in the form /note, pitch, duration, velocity
// Modelled as singleton class
namespace osctransmitter {
class OscTransmitter {
public:
static OscTransmitter * Instance();
void transmit( std::string, double, double, double );
// void transmitFake( std::string, double, double, double );
private:
bool isTransmitting;
UdpTransmitSocket transmitSocket;
char buffer[OUTPUT_BUFFER_SIZE];
osc::OutboundPacketStream p;
OscTransmitter();
OscTransmitter( const OscTransmitter& );
OscTransmitter& operator=( OscTransmitter const& );
};
} /* namespace osctransmitter */
#endif /* OSCTRANSMITTER_H_ */