Show
Ignore:
Timestamp:
07/08/07 05:51:41 (17 months ago)
Author:
krobillard
Message:

Component inputs can now be declared /quiet or /strobe

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/thune/thread_safe/component.c

    r429 r430  
    3939    int* counter; 
    4040    UAtom atom; 
     41    uint32_t special = 0; 
    4142 
    4243 
     
    6061                *counter = *counter + 1; 
    6162        } 
     63        else if( ur_is(it, UT_SELECT) ) 
     64        { 
     65            if( ur_atom(it) >= UT_BI_COUNT ) 
     66            { 
     67                if( ur_selIsAtom(it) && (counter == &inC) ) 
     68                { 
     69                    const char* str = ur_atomCStr( ur_sel(it), 0 ); 
     70                    if( *str == 'q' ) 
     71                        special |= 1 << inC;        // Quiet 
     72                    else if( *str == 's' ) 
     73                        special |= 0x10000 << inC;  // Strobe 
     74                } 
     75                *counter = *counter + 1; 
     76            } 
     77        } 
    6278        ++it; 
    6379    } 
     
    7591    while( it != end ) 
    7692    { 
    77         if( ur_is(it, UT_WORD) ) 
     93        if( ur_is(it, UT_WORD) || ur_is(it, UT_SELECT) ) 
    7894        { 
    7995            atom = ur_atom(it); 
     
    94110    ++it; 
    95111    ur_initType( it, UT_COORD );    // component-counts 
    96     it->coord.len = 4; 
     112    it->coord.len = 6; 
    97113    ur_ccIn(it)   = inC; 
    98114    ur_ccOut(it)  = outC; 
    99115    ur_ccLoc(it)  = localC; 
    100116    ur_ccMask(it) = 0xffff << inC; 
     117    ur_ccSpec(it) = special; 
    101118    ++it; 
    102119    ur_copyCell( it, *bodCell );    // component-body 
     
    120137 
    121138 
     139/* 
     140   (sig body -- comp) 
     141*/ 
    122142UR_CALL( uc_component ) 
    123143{ 
     
    398418    UCell* val; 
    399419    int trigger; 
     420    uint32_t mask; 
     421    uint32_t special; 
    400422 
    401423    if( wrdN < COMPONENT_CELLS ) 
     
    412434        ur_copyCell( val, *nval ); 
    413435 
     436        mask = 0x10001 << wrdN; 
     437        special = ur_ccSpec(plugCnts) & mask; 
     438 
    414439        trigger = ur_ccMask(plugCnts); 
    415440        if( trigger != -1 ) 
    416441        { 
    417             trigger |= (1 << wrdN); 
    418             ur_ccMask(plugCnts) = trigger; 
     442            trigger |= mask; 
     443 
     444            if( special < 0x10000 )             // Not Strobe 
     445                ur_ccMask(plugCnts) = trigger; 
     446 
    419447            if( trigger != -1 ) 
    420448                return; 
    421449        } 
     450 
     451        if( special & 0xffff )                  // Quiet 
     452            return; 
    422453 
    423454        // All inputs are set; add to execute list...