@Test public void ShouldSetCorrectMidSynthC() { SynthTemplateOption midSynth = new SynthTemplateOption(1, "one", SynthTemplateOption.SynthRoll.SYNTH_HI); midSynth.setWeightClass(WeightClass.GOOD); SynthTemplateOption midAltSynth = new SynthTemplateOption(2, "two", SynthTemplateOption.SynthRoll.SYNTH_HI); midAltSynth.setWeightClass(WeightClass.GOOD); List<SynthTemplateOption> synthOptions = new ArrayList<>(); synthOptions.add(midSynth); synthOptions.add(midAltSynth); ProgressionUnitBar pBar = new ProgressionUnitBar(); pBar.setSynthTemplateMidOptions(Arrays.asList(synthOptions, synthOptions)); synthTemplatePrimeOrAltSelector.setMidSynths(pBar); boolean isEither = (pBar.getMidSynthId().get(1) == 1 || pBar.getMidSynthId().get(1) == 2); Assert.assertTrue(isEither); }
public void setMidSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateMidOptions().size(); i++) { SynthTemplateOption midSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(0); SynthTemplateOption midAltSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(1); if (midSynth.getWeightClass().getValue() > midAltSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midSynth.getId()); } else if (midAltSynth.getWeightClass().getValue() > midSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midAltSynth.getId()); } else { progressionUnitBar.addMidSynthId(midSynth.getId()); } } }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setMidSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateMidOptions().size(); i++) { SynthTemplateOption midSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(0); SynthTemplateOption midAltSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(1); if (midSynth.getWeightClass().getValue() > midAltSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midSynth.getId()); } else if (midAltSynth.getWeightClass().getValue() > midSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midAltSynth.getId()); } else { progressionUnitBar.addMidSynthId(midSynth.getId()); } } } }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setMidSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateMidOptions().size(); i++) { SynthTemplateOption midSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(0); SynthTemplateOption midAltSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(1); if (midSynth.getWeightClass().getValue() > midAltSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midSynth.getId()); } else if (midAltSynth.getWeightClass().getValue() > midSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midAltSynth.getId()); } else { progressionUnitBar.addMidSynthId(midSynth.getId()); } } }  }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setMidSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateMidOptions().size(); i++) { SynthTemplateOption midSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(0); SynthTemplateOption midAltSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(1); if (midSynth.getWeightClass().getValue() > midAltSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midSynth.getId()); } else if (midAltSynth.getWeightClass().getValue() > midSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midAltSynth.getId()); } else { progressionUnitBar.addMidSynthId(midSynth.getId()); } } }  void setHiSynths(ProgressionUnitBar progressionUnitBar); void setMidSynths(ProgressionUnitBar progressionUnitBar); void setLowSynths(ProgressionUnitBar progressionUnitBar); QueueState setRhythm(QueueState queueState); boolean randomSelection(); }
SynthTemplatePrimeOrAltSelector implements ISynthTemplatePrimeOrAltSelector { public void setMidSynths(ProgressionUnitBar progressionUnitBar){ for(int i=0; i<progressionUnitBar.getSynthTemplateMidOptions().size(); i++) { SynthTemplateOption midSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(0); SynthTemplateOption midAltSynth = progressionUnitBar.getSynthTemplateMidOptions().get(i).get(1); if (midSynth.getWeightClass().getValue() > midAltSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midSynth.getId()); } else if (midAltSynth.getWeightClass().getValue() > midSynth.getWeightClass().getValue()) { progressionUnitBar.addMidSynthId(midAltSynth.getId()); } else { progressionUnitBar.addMidSynthId(midSynth.getId()); } } }  void setHiSynths(ProgressionUnitBar progressionUnitBar); void setMidSynths(ProgressionUnitBar progressionUnitBar); void setLowSynths(ProgressionUnitBar progressionUnitBar); QueueState setRhythm(QueueState queueState); boolean randomSelection();  }