@Test public void shouldTrackSynthTemplates() { QueueState queueState = createTestQueue(); queueState = analyticsEvent.initAnalytics(queueState); queueState = setSynthTemplateAnalytics.set(queueState ); Assert.assertSame(12, queueState.getStructure().get(0).getProgressionUnitBars().get(0).getCompositionTimeSlot().getSynthTemplateHiId()); Assert.assertSame(12, queueState.getStructure().get(0).getProgressionUnitBars().get(1).getCompositionTimeSlot().getSynthTemplateHiId()); Assert.assertSame(12, queueState.getStructure().get(0).getProgressionUnitBars().get(2).getCompositionTimeSlot().getSynthTemplateHiId()); Assert.assertSame(12, queueState.getStructure().get(0).getProgressionUnitBars().get(3).getCompositionTimeSlot().getSynthTemplateHiId()); Assert.assertSame(21, queueState.getStructure().get(0).getProgressionUnitBars().get(0).getCompositionTimeSlot().getSynthTemplateMidId()); Assert.assertSame(21, queueState.getStructure().get(0).getProgressionUnitBars().get(1).getCompositionTimeSlot().getSynthTemplateMidId()); Assert.assertSame(21, queueState.getStructure().get(0).getProgressionUnitBars().get(2).getCompositionTimeSlot().getSynthTemplateMidId()); Assert.assertSame(21, queueState.getStructure().get(0).getProgressionUnitBars().get(3).getCompositionTimeSlot().getSynthTemplateMidId()); Assert.assertSame(32, queueState.getStructure().get(0).getProgressionUnitBars().get(0).getCompositionTimeSlot().getSynthTemplateLowId()); Assert.assertSame(32, queueState.getStructure().get(0).getProgressionUnitBars().get(1).getCompositionTimeSlot().getSynthTemplateLowId()); Assert.assertSame(32, queueState.getStructure().get(0).getProgressionUnitBars().get(2).getCompositionTimeSlot().getSynthTemplateLowId()); Assert.assertSame(32, queueState.getStructure().get(0).getProgressionUnitBars().get(3).getCompositionTimeSlot().getSynthTemplateLowId()); }
@Override public QueueState initAnalytics(QueueState queueState) { int bpm = queueState.getQueueItem().getBpm(); int mSecInBar = (int) LoopUtils.getMilliSecondsInBar(bpm); int currentBar = 0; List<ProgressionUnit> units = queueState.getStructure(); for (int i = 0; i < units.size(); i++) { List<ProgressionUnitBar> progressionBars = units.get(i).getProgressionUnitBars(); for (int j = 0; j < progressionBars.size(); j++) { progressionBars.get(j).getCompositionTimeSlot().setMsecStart(currentBar * mSecInBar); progressionBars.get(j).getCompositionTimeSlot().setMsecStop((currentBar + 1) * mSecInBar); currentBar++; } } return queueState; }
Analytics implements IAnalyticsEvent { @Override public QueueState initAnalytics(QueueState queueState) { int bpm = queueState.getQueueItem().getBpm(); int mSecInBar = (int) LoopUtils.getMilliSecondsInBar(bpm); int currentBar = 0; List<ProgressionUnit> units = queueState.getStructure(); for (int i = 0; i < units.size(); i++) { List<ProgressionUnitBar> progressionBars = units.get(i).getProgressionUnitBars(); for (int j = 0; j < progressionBars.size(); j++) { progressionBars.get(j).getCompositionTimeSlot().setMsecStart(currentBar * mSecInBar); progressionBars.get(j).getCompositionTimeSlot().setMsecStop((currentBar + 1) * mSecInBar); currentBar++; } } return queueState; } }
Analytics implements IAnalyticsEvent { @Override public QueueState initAnalytics(QueueState queueState) { int bpm = queueState.getQueueItem().getBpm(); int mSecInBar = (int) LoopUtils.getMilliSecondsInBar(bpm); int currentBar = 0; List<ProgressionUnit> units = queueState.getStructure(); for (int i = 0; i < units.size(); i++) { List<ProgressionUnitBar> progressionBars = units.get(i).getProgressionUnitBars(); for (int j = 0; j < progressionBars.size(); j++) { progressionBars.get(j).getCompositionTimeSlot().setMsecStart(currentBar * mSecInBar); progressionBars.get(j).getCompositionTimeSlot().setMsecStop((currentBar + 1) * mSecInBar); currentBar++; } } return queueState; }  }
Analytics implements IAnalyticsEvent { @Override public QueueState initAnalytics(QueueState queueState) { int bpm = queueState.getQueueItem().getBpm(); int mSecInBar = (int) LoopUtils.getMilliSecondsInBar(bpm); int currentBar = 0; List<ProgressionUnit> units = queueState.getStructure(); for (int i = 0; i < units.size(); i++) { List<ProgressionUnitBar> progressionBars = units.get(i).getProgressionUnitBars(); for (int j = 0; j < progressionBars.size(); j++) { progressionBars.get(j).getCompositionTimeSlot().setMsecStart(currentBar * mSecInBar); progressionBars.get(j).getCompositionTimeSlot().setMsecStop((currentBar + 1) * mSecInBar); currentBar++; } } return queueState; }  @Override QueueState initAnalytics(QueueState queueState); @Override Integer saveAnalytics(QueueState queueState); }
Analytics implements IAnalyticsEvent { @Override public QueueState initAnalytics(QueueState queueState) { int bpm = queueState.getQueueItem().getBpm(); int mSecInBar = (int) LoopUtils.getMilliSecondsInBar(bpm); int currentBar = 0; List<ProgressionUnit> units = queueState.getStructure(); for (int i = 0; i < units.size(); i++) { List<ProgressionUnitBar> progressionBars = units.get(i).getProgressionUnitBars(); for (int j = 0; j < progressionBars.size(); j++) { progressionBars.get(j).getCompositionTimeSlot().setMsecStart(currentBar * mSecInBar); progressionBars.get(j).getCompositionTimeSlot().setMsecStop((currentBar + 1) * mSecInBar); currentBar++; } } return queueState; }  @Override QueueState initAnalytics(QueueState queueState); @Override Integer saveAnalytics(QueueState queueState);  }