@Test public void shouldTrackBeatLoops() { QueueState queueState = createTestQueue(); queueState = analyticsEvent.initAnalytics(queueState); queueState = setBeatLoopAnalyticsEvent.set(queueState); Assert.assertEquals(11, queueState.getStructure().get(0).getProgressionUnitBars().get(0).getCompositionTimeSlot().getBeatLoopId().intValue()); Assert.assertEquals(12, queueState.getStructure().get(0).getProgressionUnitBars().get(1).getCompositionTimeSlot().getBeatLoopId().intValue()); Assert.assertEquals(13, queueState.getStructure().get(0).getProgressionUnitBars().get(2).getCompositionTimeSlot().getBeatLoopId().intValue()); Assert.assertEquals(13, queueState.getStructure().get(0).getProgressionUnitBars().get(3).getCompositionTimeSlot().getBeatLoopId().intValue()); }
@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);  }