[PD-cvs] SF.net SVN: pure-data: [9993] trunk/externals/iem/dmx512/src
zmoelnig at users.sourceforge.net
zmoelnig at users.sourceforge.net
Fri Jun 13 15:39:54 CEST 2008
Revision: 9993
http://pure-data.svn.sourceforge.net/pure-data/?rev=9993&view=rev
Author: zmoelnig
Date: 2008-06-13 06:39:54 -0700 (Fri, 13 Jun 2008)
Log Message:
-----------
tell that [dmxin] isn't yet there...
Modified Paths:
--------------
trunk/externals/iem/dmx512/src/dmx4pd.h
trunk/externals/iem/dmx512/src/dmxin.c
trunk/externals/iem/dmx512/src/dmxout.c
Modified: trunk/externals/iem/dmx512/src/dmx4pd.h
===================================================================
--- trunk/externals/iem/dmx512/src/dmx4pd.h 2008-06-13 13:28:08 UTC (rev 9992)
+++ trunk/externals/iem/dmx512/src/dmx4pd.h 2008-06-13 13:39:54 UTC (rev 9993)
@@ -25,8 +25,13 @@
#include "m_pd.h"
+#include <dmx/dmx.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
#define DMX4PD_POSTBANNER \
{ \
post("DMX4PD ("DMX4PD_VERSION"): (c) 2008 IOhannes m zm\xF6lnig - iem @ kug"); \
Modified: trunk/externals/iem/dmx512/src/dmxin.c
===================================================================
--- trunk/externals/iem/dmx512/src/dmxin.c 2008-06-13 13:28:08 UTC (rev 9992)
+++ trunk/externals/iem/dmx512/src/dmxin.c 2008-06-13 13:39:54 UTC (rev 9993)
@@ -17,21 +17,65 @@
#include "dmx4pd.h"
+
static t_class *dmxin_class;
typedef struct _dmxin
{
t_object x_obj;
+ int x_device;
+
+ t_outlet*x_outlet1, *x_outlet2;
} t_dmxin;
+
+
+
+static void dmxin_close(t_dmxin*x)
+{
+ if(x->x_device>=0) {
+ close(x->x_device);
+ }
+ x->x_device=-1;
+}
+
+
+static void dmxin_open(t_dmxin*x, t_symbol*s_devname)
+{
+ int argc=2;
+ const char *args[2] = {"--dmx", s_devname->s_name};
+ const char**argv=args;
+ char*devname="";
+ int fd;
+
+ if(s_devname && s_devname->s_name)
+ devname=s_devname->s_name;
+
+ // strncpy(args[0], "--dmx", MAXPDSTRING);
+ // strncpy(args[1], devname, MAXPDSTRING);
+
+ fd = open (DMXINdev(&argc, argv), O_RDONLY);
+
+ if(fd!=-1) {
+ dmxin_close(x);
+ x->x_device=fd;
+ }
+}
+
+
static void *dmxin_new(void)
{
- t_dmxin *x = (t_dmxin *)pd_new(dmxin_class);
- return (x);
+ if(0) {
+ t_dmxin *x = (t_dmxin *)pd_new(dmxin_class);
+ return (x);
+ } else {
+ error("[dmxin] not yet implemented");
+ return 0;
+ }
}
static void *dmxin_free(t_dmxin*x)
{
-
+ dmxin_close(x);
}
void dmxin_setup(void)
Modified: trunk/externals/iem/dmx512/src/dmxout.c
===================================================================
--- trunk/externals/iem/dmx512/src/dmxout.c 2008-06-13 13:28:08 UTC (rev 9992)
+++ trunk/externals/iem/dmx512/src/dmxout.c 2008-06-13 13:39:54 UTC (rev 9993)
@@ -17,14 +17,9 @@
#include "dmx4pd.h"
-#include <fcntl.h>
-#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
-
-#include <dmx/dmx.h>
-
static t_class *dmxout_class;
typedef struct _dmxout
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Pd-cvs
mailing list