# HG changeset patch # User nenolod # Date 1168077577 28800 # Node ID 2bf7e2965eec51fc30e4ec3b5fe787d45e700e15 # Parent 290588854a9db3b4edd19a931458729b29d56c33 [svn] - actuatorbin.c was missing. diff -r 290588854a9d -r 2bf7e2965eec ChangeLog --- a/ChangeLog Sat Jan 06 01:57:34 2007 -0800 +++ b/ChangeLog Sat Jan 06 01:59:37 2007 -0800 @@ -1,3 +1,19 @@ +2007-01-06 09:57:34 +0000 William Pitcock + revision [894] + - rovascope -- a variant of the paranormal visualization engine that is + uses random data instead of presets. + + trunk/configure.ac | 2 + trunk/src/rovascope/Makefile | 7 + trunk/src/rovascope/cfg.c | 636 -------------------------- + trunk/src/rovascope/paranormal.c | 27 - + trunk/src/rovascope/paranormal.h | 6 + trunk/src/rovascope/plugin.c | 940 +++++++++++++++++++-------------------- + trunk/src/rovascope/presets.c | 261 ---------- + trunk/src/rovascope/presets.h | 11 + 8 files changed, 494 insertions(+), 1396 deletions(-) + + 2007-01-06 03:31:47 +0000 William Pitcock revision [892] - update to Objective-Make II diff -r 290588854a9d -r 2bf7e2965eec src/rovascope/actuatorbin.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/rovascope/actuatorbin.c Sat Jan 06 01:59:37 2007 -0800 @@ -0,0 +1,76 @@ +#include "paranormal.h" +#include "actuators.h" + +struct pn_actuator * +rovascope_get_random_colourmap(void) +{ + struct pn_actuator *out; + + srand(time(NULL)); + + out = create_actuator("cmap_bwgradient"); + out->options[2].val.cval.r = 255 - rand() % 255; + out->options[2].val.cval.g = 255 - rand() % 255; + out->options[2].val.cval.b = 255 - rand() % 255; + + return out; +} + +struct pn_actuator * +rovascope_get_random_general(void) +{ + struct pn_actuator *out; + + gchar *candidates[] = { + "general_fade", "general_blur", "general_mosaic", + "general_flip", + }; + + out = create_actuator(candidates[rand() % G_N_ELEMENTS(candidates)]); + + return out; +} + +struct pn_actuator * +rovascope_get_random_normal_scope(void) +{ + struct pn_actuator *out; + static gint ret = 0; + + gchar *candidates[] = { + "wave_horizontal", "wave_vertical", "wave_radial", + }; + + if (ret >= G_N_ELEMENTS(candidates)) + ret = 0; + + out = create_actuator(candidates[ret]); + + ret++; + + return out; +} + +struct pn_actuator * +rovascope_get_random_actuator(void) +{ + struct pn_actuator *out; + struct pn_actuator *(*func)(); + static gint ret = 0; + + void *candidates[] = { + rovascope_get_random_colourmap, + rovascope_get_random_general, + rovascope_get_random_normal_scope, + }; + + if (ret >= G_N_ELEMENTS(candidates)) + ret = 0; + + func = candidates[ret]; + out = func(); + + ret++; + + return out; +}