+ Wavetable: one more wavetable (experimental, will be changed)
[calf.git] / src / calf / osctlnet.h
blob47b298994725fcb2b2a8cfbe3f6272022ae9f1a3
1 /* Calf DSP Library
2 * Open Sound Control UDP support
4 * Copyright (C) 2007 Krzysztof Foltman
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02111-1307, USA.
22 #ifndef __CALF_OSCTLNET_H
23 #define __CALF_OSCTLNET_H
25 #include <arpa/inet.h>
26 #include <sys/socket.h>
27 #include <calf/osctl.h>
29 namespace osctl
32 struct osc_socket
34 int socket, srcid;
35 std::string prefix;
37 osc_socket() : socket(-1), srcid(0) {}
38 void bind(const char *hostaddr = "0.0.0.0", int port = 0);
39 std::string get_uri() const;
40 virtual void on_bind() {}
41 virtual ~osc_socket();
44 struct osc_client: public osc_socket
46 sockaddr_in addr;
48 void set_addr(const char *hostaddr, int port);
49 void set_url(const char *url);
50 bool send(const std::string &address, osctl::osc_typed_strstream &stream);
51 bool send(const std::string &address);
56 #endif