aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2008-06-30 11:13:10 +0000
committerIOhannes m zmölnig <zmoelnig@iem.at>2015-10-14 15:08:24 +0200
commitf272f82bd7d8f6ec25e292e8ac92b81d4623901a (patch)
tree4f63d767b5bdad33aeec45dd6cbfd09b1f5f20d9
parent0743593e7adec852e293e5e42d851256c225cd74 (diff)
added "open"-mess (not functional yet) to change the device...
svn path=/trunk/externals/iem/dmx512/; revision=10119
-rw-r--r--dmx512/src/dmx4pd.h4
-rw-r--r--dmx512/src/dmxout.c12
2 files changed, 11 insertions, 5 deletions
diff --git a/dmx512/src/dmx4pd.h b/dmx512/src/dmx4pd.h
index cc6fe66..059c794 100644
--- a/dmx512/src/dmx4pd.h
+++ b/dmx512/src/dmx4pd.h
@@ -33,9 +33,9 @@
#define DMX4PD_POSTBANNER \
- { \
+ do { \
post("DMX4PD ("DMX4PD_VERSION"): (c) 2008 IOhannes m zmlnig - iem @ kug"); \
- }
+ } while(0)
#endif /* INCLUDE_DMX4PD_H__ */
diff --git a/dmx512/src/dmxout.c b/dmx512/src/dmxout.c
index dcfef75..9c4c7fe 100644
--- a/dmx512/src/dmxout.c
+++ b/dmx512/src/dmxout.c
@@ -65,6 +65,7 @@ static void dmxout_open(t_dmxout*x, t_symbol*s_devname)
// strncpy(args[0], "--dmx", MAXPDSTRING);
// strncpy(args[1], devname, MAXPDSTRING);
+ verbose(2, "[dmxout]: trying to open '%s'", args[1]);
devname=DMXdev(&argc, argv);
if(!devname){
pd_error(x, "couldn't find DMX device");
@@ -77,6 +78,8 @@ static void dmxout_open(t_dmxout*x, t_symbol*s_devname)
if(fd!=-1) {
dmxout_close(x);
x->x_device=fd;
+ } else {
+ error("failed to open DMX-device '%s'",devname);
}
}
@@ -217,12 +220,17 @@ static void *dmxout_free(t_dmxout*x)
void dmxout_setup(void)
{
+#ifdef DMX4PD_POSTBANNER
+ DMX4PD_POSTBANNER;
+#endif
+
dmxout_class = class_new(gensym("dmxout"), (t_newmethod)dmxout_new, (t_method)dmxout_free,
sizeof(t_dmxout),
0,
A_GIMME, A_NULL);
class_addfloat(dmxout_class, dmxout_float);
+ class_addmethod(dmxout_class, (t_method)dmxout_open, gensym("open"), A_SYMBOL, A_NULL);
dmxout_class2 = class_new(gensym("dmxout"), (t_newmethod)dmxout_new, (t_method)dmxout_free,
sizeof(t_dmxout),
@@ -235,7 +243,5 @@ void dmxout_setup(void)
class_addmethod(dmxout_class2, (t_method)dmxout_port, gensym("port"),
A_FLOAT, A_DEFFLOAT, A_NULL);
-#ifdef DMX4PD_POSTBANNER
- DMX4PD_POSTBANNER
-#endif
+ class_addmethod(dmxout_class2, (t_method)dmxout_open, gensym("open"), A_SYMBOL, A_NULL);
}