Package com.neophob.sematrix.core.fader

Examples of com.neophob.sematrix.core.fader.IFader


        try {
          int nr = col.getCurrentOutput();
          tmp=Integer.parseInt(msg[1]);
          //do not start a new fader while the old one is still running
          if (!col.getOutputMappings(nr).getFader().isStarted()) {
              IFader f = col.getPixelControllerFader().getVisualFader(tmp);
              if (f!=null) {
                  col.getOutputMappings(nr).setFader(f);  
              }
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_ALL_OUTPUT_FADER:
        try {
          tmp=Integer.parseInt(msg[1]);
          for (OutputMapping om: col.getAllOutputMappings()) {
            //do not start a new fader while the old one is still running
            if (!om.getFader().isStarted()) {
                IFader f = col.getPixelControllerFader().getVisualFader(tmp);
                if (f!=null) {
                    om.setFader(f);                   
                }
            }           
          }
View Full Code Here


      }     

      if (blah == 8 && col.getShufflerSelect(ShufflerOffset.FADER_OUTPUT)) {
        int size = col.getPixelControllerFader().getFaderCount();
        for (OutputMapping om: col.getAllOutputMappings()) {
          IFader f=om.getFader();
          if (!f.isStarted()) {
            om.setFader(
                col.getPixelControllerFader().getVisualFader(rand.nextInt(size)))
          }
        }
      }


      if (blah == 9) {
        col.getPixelControllerEffect().getEffect(EffectName.ROTOZOOM).shuffle();
      }

      if (blah == 10) {
        col.getPixelControllerEffect().getEffect(EffectName.ZOOM).shuffle();
      }

      if (blah == 11 && col.getShufflerSelect(ShufflerOffset.GENERATORSPEED)) {
        col.getPixelControllerGenerator().setFpsAdjustment(new Random().nextFloat()*2.0f);
      }

      if (blah == 12 && col.getShufflerSelect(ShufflerOffset.BEAT_WORK_MODE)) {
        BeatToAnimation bta = BeatToAnimation.values()[new Random().nextInt(BeatToAnimation.values().length)];
        col.getPixelControllerGenerator().setBta(bta);
      }
     
    }


    if (kick) {
      if (blah == 13 && col.getShufflerSelect(ShufflerOffset.OUTPUT)) {
        int nrOfVisuals = col.getAllVisuals().size();
        int screenNr = 0;
        for (OutputMapping om: col.getAllOutputMappings()) {
          IFader f=om.getFader();
          if (!f.isStarted()) {
            //start fader only if not another one is started
            f.startFade(rand.nextInt(nrOfVisuals), screenNr);
          }
          screenNr++;
        }
      }

View Full Code Here

    @Test
    public void presetFadeTest() throws Exception {
      final int fps = 50;
     
      MatrixData matrix = new MatrixData(8, 8);
      IFader switchFader = new Switch(matrix, fps);
      assertEquals(Fader.FaderName.SWITCH.getId(), switchFader.getId());

      //special case, the switch fader is always done!
      assertTrue(switchFader.isDone());
      assertFalse(switchFader.isStarted());
     
      switchFader.startFade(99, new int[77]);
      assertTrue(switchFader.isStarted());
     
      switchFader.getBuffer(new int[55], new int[5]);
      switchFader.cleanUp();
    }
View Full Code Here

    @Test
    public void visualFadeTest() throws Exception {
      final int fps = 5000;
     
      MatrixData matrix = new MatrixData(8, 8);
      IFader switchFader = new Switch(matrix, fps);
      assertEquals(Fader.FaderName.SWITCH.getId(), switchFader.getId());

      //special case, the switch fader is always done!
      assertTrue(switchFader.isDone());
      assertFalse(switchFader.isStarted());
     
      switchFader.startFade(99, 1);
      assertTrue(switchFader.isStarted());
     
      switchFader.getBuffer(new int[55], new int[5]);
      switchFader.getBuffer(new int[55], new int[5]);
      switchFader.cleanUp();
    }
View Full Code Here

    @Test
    public void presetFadeTest() throws Exception {
      final int fps = 50;
           
      MatrixData matrix = new MatrixData(8, 8);
      IFader switchFader = new Crossfader(matrix, fps);
      assertEquals(Fader.FaderName.CROSSFADE.getId(), switchFader.getId());

      assertFalse(switchFader.isDone());
      assertFalse(switchFader.isStarted());
     
      switchFader.startFade(99, new int[55]);
      assertTrue(switchFader.isStarted());
     
      switchFader.getBuffer(new int[55], new int[55]);
      switchFader.cleanUp();
    }
View Full Code Here

    @Test
    public void visualFadeTest() throws Exception {
      final int fps = 50;
           
      MatrixData matrix = new MatrixData(8, 8);
      IFader switchFader = new Crossfader(matrix, 20, fps);
      assertEquals(Fader.FaderName.CROSSFADE.getId(), switchFader.getId());

      assertFalse(switchFader.isDone());
      assertFalse(switchFader.isStarted());
     
      switchFader.startFade(99, 1);
      assertTrue(switchFader.isStarted());
     
      switchFader.getBuffer(new int[55], new int[55]);
      switchFader.getBuffer(new int[55], new int[55]);
      assertTrue(switchFader.isDone());
      switchFader.cleanUp();
    }   
View Full Code Here

    pixConStat.trackTime(TimeMeasureItemGlobal.OUTPUT_SCHEDULE, System.currentTimeMillis()-l);

    //cleanup faders
    l = System.currentTimeMillis();
    for (OutputMapping om: ioMapping) {
      IFader fader = om.getFader();
      if (fader!=null && fader.isStarted() && fader.isDone()) {
        //fading is finished, cleanup
        fader.cleanUp();

        if (fader.getScreenOutput()>=0) {
          mapInputToScreen(fader.getScreenOutput(), fader.getNewVisual());     
          LOG.log(Level.INFO, "Cleanup {0}, new visual: {1}, output screen: {2}",
              new Object[] { fader.getFaderName(), fader.getNewVisual(), fader.getScreenOutput() });
        } else {
          LOG.log(Level.INFO, "Cleanup preset {0}, new visual: {1}",
              new Object[] { fader.getFaderName(), fader.getNewVisual() });     
        }
      }
    }
    pixConStat.trackTime(TimeMeasureItemGlobal.FADER, System.currentTimeMillis()-l);
View Full Code Here

      assertEquals(panels, l.getRow1Size());
      assertEquals(0, l.getRow2Size());     
      assertEquals(Layout.LayoutName.HORIZONTAL, l.getLayoutName());
     
      MatrixData matrix = new MatrixData(8, 8);
      IFader f = new Switch(matrix, 50);
      List<OutputMapping> ioMapping = new ArrayList<OutputMapping>();
     
      //testcase#1: each output has a visual assigned
    for (int n=0; n<panels; n++) {
      ioMapping.add(new OutputMapping(f, n));     
View Full Code Here

              Generator g = new Fire(matrix);
              Effect e = new PassThru(matrix);
                Visual visual = new Visual(g, e, m, c);       
                   
              IFader fader = new Switch(matrix, 100);
              OutputMapping map = new OutputMapping(fader, 0);
             
                assertNotNull(matrix.getScreenBufferForDevice(visual, map));     
                assertNotNull(matrix.getScreenBufferForDevice(visual, lmDefault, map, output));
                assertNotNull(matrix.getScreenBufferForDevice(visual, lmBox1, map, output));
View Full Code Here

     * @param buffer the buffer
     * @param map the map
     * @return the int[]
     */
    private int[] doTheFaderBaby(int[] buffer, OutputMapping map) {
        IFader fader = map.getFader();
        if (fader.isStarted()) {
            buffer=fader.getBuffer(buffer, Collector.getInstance().getVisual(fader.getNewVisual()).getBuffer());
            //do not cleanup fader here, the box layout gets messed up!
            //the fader is cleaned up in the update system method
            /*      if (fader.isDone()) {
        //fading is finished
        fader.cleanUp();
View Full Code Here

TOP

Related Classes of com.neophob.sematrix.core.fader.IFader

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.