Package de.sciss.eisenkraut.util

Examples of de.sciss.eisenkraut.util.MapManager$Context


  // sync : attempts shared on DOOR_TRACKS
  private void addChannelPanMessages( OSCBundle bndl )
  {
    Object    o;
    MapManager  map;
    float    pos, width;
   
    if( oCfg == null ) return;
 
//    if( !doc.bird.attemptShared( Session.DOOR_TRACKS, 250 )) return;
//    try {
      if( doc.audioTracks.size() != ct.numInChans ) {
        Server.getPrintStream().println( "Input channel mismatch!" );
        return;
      }
      for( int ch = 0; ch < ct.numInChans; ch++ ) {
        map  = doc.audioTracks.get( ch ).getMap();
        o  = map.getValue( AudioTrack.MAP_KEY_PANAZIMUTH );
        if( (o != null) && (o instanceof Number) ) {
          pos  = ((Number) o).floatValue() / 180;
          pos  = pos < 0.0f ? 2.0f - ((-pos) % 2.0f) : pos % 2.0f;
        } else {
          pos  = 0.0f;
        }
        o  = map.getValue( AudioTrack.MAP_KEY_PANSPREAD );
        if( (o != null) && (o instanceof Number) ) {
          width    = ((Number) o).floatValue();
//System.out.println( "width in : " + width );
          if( width <= 0.0f ) {
            width  = Math.max( 1.0f, width + 2.0f );
View Full Code Here


  // sync : attempt exclusive on doors
  protected void setFlags( int mask, boolean set )
  {
    int        flags, flagsNew;
    Object      o;
    MapManager    map;
    boolean      soloChange;
 
    map    = so.getMap();
    o    = map.getValue( SessionObject.MAP_KEY_FLAGS );
    flags  = o == null ? 0 : ((Integer) o).intValue();
   
    if( set ) {
      flagsNew  = flags | mask;
    } else {
      flagsNew  = flags & ~mask;
    }
    soloChange = (mask & SessionObject.FLAGS_SOLO) != 0;
    if( soloChange || (mask & SessionObject.FLAGS_SOLOSAFE) != ) {
      if( set ) {
        flagsNew &= ~SessionObject.FLAGS_VIRTUALMUTE;
      } else if( (flagsNew & SessionObject.FLAGS_SOLO) == 0 &&
             isAny( SessionObject.FLAGS_SOLO, true )) {
            
        flagsNew |= SessionObject.FLAGS_VIRTUALMUTE;
      }
    }
    if( flags != flagsNew ) {
      map.putValue( this, SessionObject.MAP_KEY_FLAGS, new Integer( flagsNew ));
    }
    if( soloChange ) broadcastFlags( 0, true );
  }
View Full Code Here

  protected void broadcastFlags( int mask, boolean set )
  {
    int        i, flags, flagsNew;
    SessionObject  so2;
    Object      o;
    MapManager    map;
    boolean      virtualMute  = false;

    if( (mask & SessionObject.FLAGS_SOLO) == 0 &&
      !((mask & SessionObject.FLAGS_SOLOSAFE) != 0 && set) ) {
   
      virtualMute = isAny( SessionObject.FLAGS_SOLO, true );
    }
    for( i = 0; i < sc.size(); i++ ) {
      so2    = sc.get( i );
      map    = so2.getMap();
      o    = map.getValue( SessionObject.MAP_KEY_FLAGS );
      flags  = o == null ? 0 : ((Integer) o).intValue();
     
      if( set ) {
        flagsNew  = flags | mask;
      } else {
        flagsNew  = flags & ~mask;
      }
      if( virtualMute && (flagsNew & (SessionObject.FLAGS_SOLO | SessionObject.FLAGS_SOLOSAFE)) == 0 ) {
        flagsNew |= SessionObject.FLAGS_VIRTUALMUTE;
      } else {
        flagsNew &= ~SessionObject.FLAGS_VIRTUALMUTE;
      }
     
      if( flags != flagsNew ) {
        map.putValue( this, SessionObject.MAP_KEY_FLAGS, new Integer( flagsNew ));
      }
    }
  }
View Full Code Here

  protected boolean isAny( int mask, boolean set )
  {
    int        i, flags;
    SessionObject  so2;
    Object      o;
    MapManager    map;

//    if( !lm.attemptShared( doors, 250 )) return false;
//    try {
      for( i = 0; i < sc.size(); i++ ) {
        so2    = sc.get( i );
        map    = so2.getMap();
        o    = map.getValue( SessionObject.MAP_KEY_FLAGS );
        flags  = o == null ? 0 : ((Integer) o).intValue();
       
        if( set ) {
          if( (flags & mask) != 0 ) return true;
        } else {
View Full Code Here

  {
    super();

    this.doc    = doc;
   
    final MapManager map = getMap();

    map.putContext( this, MAP_KEY_RATE, new MapManager.Context( 0, MapManager.Context.TYPE_DOUBLE, null, null, null,
                                  new Double( 1000 )));
    map.putContext( this, MAP_KEY_LENGTH, new MapManager.Context( 0, MapManager.Context.TYPE_LONG, null, null, null,
                                    new Long( 0 )));
    map.putContext( this, MAP_KEY_POSITION, new MapManager.Context( 0, MapManager.Context.TYPE_LONG, null, null, null,
                                    new Long( 0 )));

    osc  = new OSCRouterWrapper( doc, this );

    clear( this );
View Full Code Here

    this.chan  = chan;
    this.coll  = coll;

//    final NumberSpace  spcAzi    = new NumberSpace( -360.0, 360.0, 0.1 );
//    final NumberSpace  spcSpread  = new NumberSpace( -1.0, 1.0, 0.1 );
    final MapManager  map      = getMap();

    map.putContext( this, MAP_KEY_PANAZIMUTH, new MapManager.Context( MapManager.Context.FLAG_OBSERVER_DISPLAY,
                                       MapManager.Context.TYPE_DOUBLE, null, "labelAzimuth",
                                       null, new Double( 0.0 )));
    map.putContext( this, MAP_KEY_PANSPREAD, new MapManager.Context( MapManager.Context.FLAG_OBSERVER_DISPLAY,
                                       MapManager.Context.TYPE_DOUBLE, null, "labelSpread",
                                       null, new Double( 0.0 )));

    osc      = new OSCRouterWrapper( coll, this );
  }
View Full Code Here

            throw new InvokerException(ioe.getMessage(), ioe.getCause());
        } catch (XMLStreamException xse) {
            throw new InvokerException(xse.getMessage(), xse.getCause());
        }
        executor = new SCXMLExecutor(evaluator, new SimpleDispatcher(), new SimpleErrorReporter());
        Context rootCtx = evaluator.newContext(null);
        for (Map.Entry<String, Object> entry : params.entrySet()) {
            rootCtx.setLocal(entry.getKey(), entry.getValue());
        }
        executor.setRootContext(rootCtx);
        try {
            executor.setStateMachine(scxml);
        }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Set<Entry<String, Object>> entrySet() {
        Set<Entry<String, Object>> entrySet = new HashSet<Entry<String, Object>>();
        Context current = leaf;
        while (current != null) {
            entrySet.addAll(current.getVars().entrySet());
            current = current.getParent();
        }
        return entrySet;
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Object get(final Object key) {
        if (key != null) {
            Context current = leaf;
            while (current != null) {
                if (current.getVars().containsKey(key.toString())) {
                    return current.getVars().get(key);
                }
                current = current.getParent();
            }
        }
        return null;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public void execute(ActionExecutionContext exctx) throws ModelException, SCXMLExpressionException {
        Context ctx = exctx.getContext(getParentEnterableState());
        Evaluator eval = exctx.getEvaluator();
        ctx.setLocal(getNamespacesKey(), getNamespaces());
        exctx.getAppLog().info(label + ": " + String.valueOf(eval.eval(ctx, expr)));
        ctx.setLocal(getNamespacesKey(), null);
    }
View Full Code Here

TOP

Related Classes of de.sciss.eisenkraut.util.MapManager$Context

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.