@Test public void ShouldSetCorrectLowSynthA() { SynthTemplateOption lowSynth = new SynthTemplateOption(1, "one", SynthTemplateOption.SynthRoll.SYNTH_LOW); lowSynth.setWeightClass(WeightClass.BAD); SynthTemplateOption lowAltSynth = new SynthTemplateOption(2, "two", SynthTemplateOption.SynthRoll.SYNTH_LOW); lowAltSynth.setWeightClass(WeightClass.OK); List<SynthTemplateOption> synthOptions = new ArrayList<>(); synthOptions.add(lowSynth); synthOptions.add(lowAltSynth); ProgressionUnitBar pBar = new ProgressionUnitBar(); pBar.setSynthTemplateLowOptions(Arrays.asList(synthOptions, synthOptions)); synthTemplatePrimeOrAltSelector.setLowSynths(pBar); assertThat(pBar.getLowSynthId()).hasSize(2); assertThat(pBar.getLowSynthId().get(1)).isEqualTo(2); }
public void setLowSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateLowOptions().size(); i++) { SynthTemplateOption lowSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(0); SynthTemplateOption lowAltSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(1); if (lowSynth.getWeightClass().getValue() > lowAltSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowSynth.getId()); } else if (lowAltSynth.getWeightClass().getValue() > lowSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowAltSynth.getId()); } else { progressionUnitBar.addLowSynthId(lowSynth.getId()); } } }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setLowSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateLowOptions().size(); i++) { SynthTemplateOption lowSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(0); SynthTemplateOption lowAltSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(1); if (lowSynth.getWeightClass().getValue() > lowAltSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowSynth.getId()); } else if (lowAltSynth.getWeightClass().getValue() > lowSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowAltSynth.getId()); } else { progressionUnitBar.addLowSynthId(lowSynth.getId()); } } } }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setLowSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateLowOptions().size(); i++) { SynthTemplateOption lowSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(0); SynthTemplateOption lowAltSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(1); if (lowSynth.getWeightClass().getValue() > lowAltSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowSynth.getId()); } else if (lowAltSynth.getWeightClass().getValue() > lowSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowAltSynth.getId()); } else { progressionUnitBar.addLowSynthId(lowSynth.getId()); } } }  }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setLowSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateLowOptions().size(); i++) { SynthTemplateOption lowSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(0); SynthTemplateOption lowAltSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(1); if (lowSynth.getWeightClass().getValue() > lowAltSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowSynth.getId()); } else if (lowAltSynth.getWeightClass().getValue() > lowSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowAltSynth.getId()); } else { progressionUnitBar.addLowSynthId(lowSynth.getId()); } } }  void setHiSynths(ProgressionUnitBar progressionUnitBar); void setMidSynths(ProgressionUnitBar progressionUnitBar); void setLowSynths(ProgressionUnitBar progressionUnitBar); QueueState setRhythm(QueueState queueState); boolean randomSelection(); }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setLowSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateLowOptions().size(); i++) { SynthTemplateOption lowSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(0); SynthTemplateOption lowAltSynth = progressionUnitBar.getSynthTemplateLowOptions().get(i).get(1); if (lowSynth.getWeightClass().getValue() > lowAltSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowSynth.getId()); } else if (lowAltSynth.getWeightClass().getValue() > lowSynth.getWeightClass().getValue()) { progressionUnitBar.addLowSynthId(lowAltSynth.getId()); } else { progressionUnitBar.addLowSynthId(lowSynth.getId()); } } }  void setHiSynths(ProgressionUnitBar progressionUnitBar); void setMidSynths(ProgressionUnitBar progressionUnitBar); void setLowSynths(ProgressionUnitBar progressionUnitBar); QueueState setRhythm(QueueState queueState); boolean randomSelection();  }