Changeset 5907:e4b706566364 in roaraudio


Ignore:
Timestamp:
06/17/13 23:14:21 (6 years ago)
Author:
phi
Branch:
default
Message:

support samples-per-tick parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/roard/dmx-random.c

    r5823 r5907  
    2626#include <roard/include/roard.h> 
    2727 
    28 #define SAMPLES_PER_TICK 2 
    29  
    3028struct channel { 
    3129 int32_t endsamp; 
     
    3735 size_t startaddr; 
    3836 size_t len; 
     37 int32_t samples_per_tick; 
    3938 struct channel * channels; 
    4039}; 
     
    4241static struct state * g_state; 
    4342static 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 
    4747}; 
    4848 
     
    5353 
    5454 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; 
    5656 
    5757 g_state->channels[index].startval = g_state->channels[index].endval; 
     
    8181 if ( p != NULL && p->value != NULL ) 
    8282  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); 
    8387 
    8488 g_state->channels = roar_mm_malloc(g_state->len*sizeof(struct channel)); 
Note: See TracChangeset for help on using the changeset viewer.