[SCM] calf/master: + OSC: move things to their correct places
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:38:55 UTC 2013
The following commit has been merged in the master branch:
commit 355fa42ebdc39beddd5e44895fb1cf4523a2cec8
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Wed Jan 21 00:23:43 2009 +0000
+ OSC: move things to their correct places
diff --git a/src/Makefile.am b/src/Makefile.am
index b9fe93d..c198b36 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,7 +66,7 @@ calflv2gui_la_LDFLAGS = -rpath $(lv2dir) -avoid-version -module -lexpat -export-
endif
endif
-libcalfstatic_la_SOURCES = modules.cpp modules_dsp.cpp modules_small.cpp giface.cpp monosynth.cpp organ.cpp osctl.cpp preset.cpp synth.cpp utils.cpp
+libcalfstatic_la_SOURCES = modules.cpp modules_dsp.cpp modules_small.cpp giface.cpp monosynth.cpp organ.cpp osctl.cpp osctlnet.cpp preset.cpp synth.cpp utils.cpp
libcalfstatic_la_LDFLAGS = -static -lexpat -disable-shared
if USE_GUI
diff --git a/src/calf/osctlnet.h b/src/calf/osctlnet.h
index 62382ff..6d90012 100644
--- a/src/calf/osctlnet.h
+++ b/src/calf/osctlnet.h
@@ -22,6 +22,10 @@
#ifndef __CALF_OSCTLNET_H
#define __CALF_OSCTLNET_H
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <calf/osctl.h>
+
namespace osctl
{
diff --git a/src/osctlnet.cpp b/src/osctlnet.cpp
index d9a682d..d1cc1d6 100644
--- a/src/osctlnet.cpp
+++ b/src/osctlnet.cpp
@@ -29,6 +29,43 @@
using namespace osctl;
using namespace std;
+void osc_socket::bind(const char *hostaddr, int port)
+{
+ socket = ::socket(PF_INET, SOCK_DGRAM, 0);
+ if (socket < 0)
+ throw osc_net_exception("socket");
+
+ sockaddr_in sadr;
+ sadr.sin_family = AF_INET;
+ sadr.sin_port = htons(port);
+ inet_aton(hostaddr, &sadr.sin_addr);
+ if (::bind(socket, (sockaddr *)&sadr, sizeof(sadr)) < 0)
+ throw osc_net_exception("bind");
+ on_bind();
+}
+
+std::string osc_socket::get_uri() const
+{
+ sockaddr_in sadr;
+ socklen_t len = sizeof(sadr);
+ if (getsockname(socket, (sockaddr *)&sadr, &len) < 0)
+ throw osc_net_exception("getsockname");
+
+ char name[INET_ADDRSTRLEN], buf[32];
+
+ inet_ntop(AF_INET, &sadr.sin_addr, name, INET_ADDRSTRLEN);
+ sprintf(buf, "%d", ntohs(sadr.sin_port));
+
+ return string("osc.udp://") + name + ":" + buf + prefix;
+}
+
+osc_socket::~osc_socket()
+{
+ close(socket);
+}
+
+//////////////////////////////////////////////////////////////
+
void osc_client::set_addr(const char *hostaddr, int port)
{
addr.sin_family = AF_INET;
diff --git a/src/osctlserv.cpp b/src/osctlserv.cpp
index 7d12e0e..11bc693 100644
--- a/src/osctlserv.cpp
+++ b/src/osctlserv.cpp
@@ -45,41 +45,6 @@ void osc_server::parse_message(const char *buffer, int len)
}
}
-void osc_socket::bind(const char *hostaddr, int port)
-{
- socket = ::socket(PF_INET, SOCK_DGRAM, 0);
- if (socket < 0)
- throw osc_net_exception("socket");
-
- sockaddr_in sadr;
- sadr.sin_family = AF_INET;
- sadr.sin_port = htons(port);
- inet_aton(hostaddr, &sadr.sin_addr);
- if (::bind(socket, (sockaddr *)&sadr, sizeof(sadr)) < 0)
- throw osc_net_exception("bind");
- on_bind();
-}
-
-std::string osc_socket::get_uri() const
-{
- sockaddr_in sadr;
- socklen_t len = sizeof(sadr);
- if (getsockname(socket, (sockaddr *)&sadr, &len) < 0)
- throw osc_net_exception("getsockname");
-
- char name[INET_ADDRSTRLEN], buf[32];
-
- inet_ntop(AF_INET, &sadr.sin_addr, name, INET_ADDRSTRLEN);
- sprintf(buf, "%d", ntohs(sadr.sin_port));
-
- return string("osc.udp://") + name + ":" + buf + prefix;
-}
-
-osc_socket::~osc_socket()
-{
- close(socket);
-}
-
void osc_server::on_bind()
{
ioch = g_io_channel_unix_new(socket);
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list