@Test public void ShouldSetSynthWeights() { ProgressionUnitBar progressionUnitBar = new ProgressionUnitBar(); progressionUnitBar.setBeatLoop(new BeatLoop()); progressionUnitBar.setHarmonicLoop(new HarmonicLoop()); SynthTemplateOption synthTemplateOptionHi = new SynthTemplateOption(1, "hi", SynthTemplateOption.SynthRoll.SYNTH_HI); SynthTemplateOption synthTemplateOptionHiAlt = new SynthTemplateOption(11, "hialt", SynthTemplateOption.SynthRoll.SYNTH_HI); SynthTemplateOption synthTemplateOptionMid = new SynthTemplateOption(2, "mid", SynthTemplateOption.SynthRoll.SYNTH_MID); SynthTemplateOption synthTemplateOptionMidAlt = new SynthTemplateOption(2, "midalt", SynthTemplateOption.SynthRoll.SYNTH_MID); SynthTemplateOption synthTemplateOptionLow = new SynthTemplateOption(3, "low", SynthTemplateOption.SynthRoll.SYNTH_LOW); SynthTemplateOption synthTemplateOptionLowAlt = new SynthTemplateOption(3, "lowalt", SynthTemplateOption.SynthRoll.SYNTH_LOW); progressionUnitBar.addSynthTemplateHiOption(Arrays.asList(synthTemplateOptionHi, synthTemplateOptionHi)); progressionUnitBar.addSynthTemplateHiOption(Arrays.asList(synthTemplateOptionHiAlt, synthTemplateOptionHiAlt)); progressionUnitBar.addSynthTemplateMidOption(Arrays.asList(synthTemplateOptionMid, synthTemplateOptionMid)); progressionUnitBar.addSynthTemplateMidOption(Arrays.asList(synthTemplateOptionMidAlt, synthTemplateOptionMidAlt)); progressionUnitBar.addSynthTemplateLowOption(Arrays.asList(synthTemplateOptionLow, synthTemplateOptionLow)); progressionUnitBar.addSynthTemplateLowOption(Arrays.asList(synthTemplateOptionLowAlt, synthTemplateOptionLowAlt)); synthWeighter.setWeights(progressionUnitBar, SynthTemplateOption.SynthRoll.SYNTH_HI); List<SynthTemplateOption> hiOptions = progressionUnitBar.getSynthTemplateHiOptions().get(1).stream().filter(s -> s.getWeightClass() != null).collect(Collectors.toList()); Assert.assertEquals(2, hiOptions.size()); synthWeighter.setWeights(progressionUnitBar, SynthTemplateOption.SynthRoll.SYNTH_MID); List<SynthTemplateOption> midOptions = progressionUnitBar.getSynthTemplateMidOptions().get(1).stream().filter(s -> s.getWeightClass() != null).collect(Collectors.toList()); Assert.assertEquals(2, midOptions.size()); synthWeighter.setWeights(progressionUnitBar, SynthTemplateOption.SynthRoll.SYNTH_LOW); List<SynthTemplateOption> lowOptions = progressionUnitBar.getSynthTemplateLowOptions().get(1).stream().filter(s -> s.getWeightClass() != null).collect(Collectors.toList()); Assert.assertEquals(2, lowOptions.size()); }
@Override public void setWeights(ProgressionUnitBar progressionUnitBar, SynthRoll synthRoll) { switch (synthRoll) { case SYNTH_HI: progressionUnitBar.getSynthTemplateHiOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_MID: progressionUnitBar.getSynthTemplateMidOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_LOW: progressionUnitBar.getSynthTemplateLowOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; } }
SynthWeighter implements ISynthWeighter { @Override public void setWeights(ProgressionUnitBar progressionUnitBar, SynthRoll synthRoll) { switch (synthRoll) { case SYNTH_HI: progressionUnitBar.getSynthTemplateHiOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_MID: progressionUnitBar.getSynthTemplateMidOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_LOW: progressionUnitBar.getSynthTemplateLowOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; } } }
SynthWeighter implements ISynthWeighter { @Override public void setWeights(ProgressionUnitBar progressionUnitBar, SynthRoll synthRoll) { switch (synthRoll) { case SYNTH_HI: progressionUnitBar.getSynthTemplateHiOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_MID: progressionUnitBar.getSynthTemplateMidOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_LOW: progressionUnitBar.getSynthTemplateLowOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; } }  }
SynthWeighter implements ISynthWeighter { @Override public void setWeights(ProgressionUnitBar progressionUnitBar, SynthRoll synthRoll) { switch (synthRoll) { case SYNTH_HI: progressionUnitBar.getSynthTemplateHiOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_MID: progressionUnitBar.getSynthTemplateMidOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_LOW: progressionUnitBar.getSynthTemplateLowOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; } }  @Override void setWeights(ProgressionUnitBar progressionUnitBar, SynthRoll synthRoll); }
SynthWeighter implements ISynthWeighter { @Override public void setWeights(ProgressionUnitBar progressionUnitBar, SynthRoll synthRoll) { switch (synthRoll) { case SYNTH_HI: progressionUnitBar.getSynthTemplateHiOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_MID: progressionUnitBar.getSynthTemplateMidOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; case SYNTH_LOW: progressionUnitBar.getSynthTemplateLowOptions().forEach(synthTemplateOptions -> synthTemplateOptions.forEach(s -> s.setWeightClass(WeightClass.OK))); break; } }  @Override void setWeights(ProgressionUnitBar progressionUnitBar, SynthRoll synthRoll);  }