Changeset 5907:e4b706566364 in roaraudio
- Timestamp:
- 06/17/13 23:14:21 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/roard/dmx-random.c
r5823 r5907 26 26 #include <roard/include/roard.h> 27 27 28 #define SAMPLES_PER_TICK 229 30 28 struct channel { 31 29 int32_t endsamp; … … 37 35 size_t startaddr; 38 36 size_t len; 37 int32_t samples_per_tick; 39 38 struct channel * channels; 40 39 }; … … 42 41 static struct state * g_state; 43 42 static struct state g_state_init = { 44 .startaddr = 0, 45 .len = 4, 46 .channels = NULL 43 .startaddr = 0, 44 .len = 4, 45 .samples_per_tick = 2, /* default: 2, good for fireflies, for moodlight 8 seems to be a better value */ 46 .channels = NULL 47 47 }; 48 48 … … 53 53 54 54 g_state->channels[index].cursamp = 0; 55 g_state->channels[index].endsamp = (int32_t)1 + (int32_t)roar_random_uint16() * (int32_t)SAMPLES_PER_TICK;55 g_state->channels[index].endsamp = (int32_t)1 + (int32_t)roar_random_uint16() * g_state->samples_per_tick; 56 56 57 57 g_state->channels[index].startval = g_state->channels[index].endval; … … 81 81 if ( p != NULL && p->value != NULL ) 82 82 g_state->len = atoi(p->value); 83 84 p = roar_keyval_lookup(para->argv, "samples-per-tick", para->argc, 1); 85 if ( p != NULL && p->value != NULL ) 86 g_state->samples_per_tick = atoi(p->value); 83 87 84 88 g_state->channels = roar_mm_malloc(g_state->len*sizeof(struct channel));
Note: See TracChangeset
for help on using the changeset viewer.