aboutsummaryrefslogtreecommitdiff
path: root/cyclone/hammer
diff options
context:
space:
mode:
authorN.N. <electrickery@users.sourceforge.net>2015-01-27 18:58:39 +0000
committerN.N. <electrickery@users.sourceforge.net>2015-01-27 18:58:39 +0000
commitf994b384f76aefdf25cbcadf8a12bfcf06cf87fd (patch)
treebe8b13fe8500d4b07b0a78adead06ceb18324e41 /cyclone/hammer
parentf802a8da9d8d7e53f3407ae6771a7a4352b832fa (diff)
cyclone/coll: Added the missing message separate.
cyclone/decide: Replaced the fixed seed by rand() and added support for a seed as argument. svn path=/trunk/externals/miXed/; revision=17420
Diffstat (limited to 'cyclone/hammer')
-rw-r--r--cyclone/hammer/coll.c18
-rw-r--r--cyclone/hammer/decide.c12
2 files changed, 27 insertions, 3 deletions
diff --git a/cyclone/hammer/coll.c b/cyclone/hammer/coll.c
index 89112ce..94b28ee 100644
--- a/cyclone/hammer/coll.c
+++ b/cyclone/hammer/coll.c
@@ -1524,6 +1524,20 @@ static void coll_debug(t_coll *x, t_floatarg f)
}
#endif
+static void coll_separate(t_coll *x, t_floatarg f)
+{
+ int indx;
+ t_collcommon *cc = x->x_common;
+ if (loud_checkint((t_pd *)x, f, &indx, gensym("separate")))
+ {
+ t_collelem *ep;
+ for (ep = cc->c_first; ep; ep = ep->e_next)
+ if (ep->e_hasnumkey && ep->e_numkey >= indx)
+ ep->e_numkey += 1;
+ collcommon_modified(cc, 0);
+ }
+}
+
static void coll_free(t_coll *x)
{
hammerfile_free(x->x_filehandle);
@@ -1623,6 +1637,8 @@ void coll_setup(void)
class_addmethod(coll_class, (t_method)coll_click,
gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);
+ class_addmethod(coll_class, (t_method)coll_separate,
+ gensym("separate"), A_FLOAT, 0);
#ifdef COLL_DEBUG
class_addmethod(coll_class, (t_method)coll_debug,
gensym("debug"), A_DEFFLOAT, 0);
@@ -1634,4 +1650,6 @@ void coll_setup(void)
class itself has been already set up above), but it is better to
have it around, just in case... */
hammerfile_setup(collcommon_class, 0);
+ logpost(NULL, 4, "this is cyclone/coll %s, %dth %s build",
+ CYCLONE_VERSION, CYCLONE_BUILD, CYCLONE_RELEASE);
}
diff --git a/cyclone/hammer/decide.c b/cyclone/hammer/decide.c
index a612fbf..9f5742c 100644
--- a/cyclone/hammer/decide.c
+++ b/cyclone/hammer/decide.c
@@ -4,6 +4,7 @@
#include "m_pd.h"
#include "common/loud.h"
+#include "shared.h"
typedef struct _decide
{
@@ -48,13 +49,17 @@ static void decide_ft1(t_decide *x, t_floatarg f)
if (i) /* CHECKED: negative numbers are accepted */
x->x_seed = i;
else
- x->x_seed = 123456789; /* FIXME */
+ x->x_seed = rand(); /* FIXED */
}
static void *decide_new(t_floatarg f)
{
t_decide *x = (t_decide *)pd_new(decide_class);
- x->x_seed = 123456789; /* FIXME */
+ int i = (int)f;
+ if (i)
+ x->x_seed = i;
+ else
+ x->x_seed = rand();
inlet_new((t_object *)x, (t_pd *)x, &s_float, gensym("ft1"));
outlet_new((t_object *)x, &s_float);
return (x);
@@ -72,4 +77,5 @@ void decide_setup(void)
gensym("ft1"), A_FLOAT, 0);
/* CHECKED list is auto-unfolded */
/* CHECKED doesn't understand "seed" */
-}
+ logpost(NULL, 4, "this is cyclone/decide %s, %dth %s build",
+ CYCLONE_VERSION, CYCLONE_BUILD, CYCLONE_RELEASE);}