class ProcessMixPanning implements IEventChain {

    @Override
    public QueueState set(QueueState queueState) {

        File[] sourceFiles = FileStructure.getFilesInDirectory(queueState.getQueueItem().getAudioPartFilePath());

        for (File sourceFile : sourceFiles) {

            String panCode = getPancode(sourceFile.getName().toLowerCase(), queueState);
            if (panCode != null) {
                Double[] leftRightGain = getLeftAndRightGain(panCode);
                audioMixer.changeVolume(leftRightGain[0], queueState.getQueueItem().getAudioPartFilePath() + "/" + sourceFile.getName(), queueState.getQueueItem().getMonoPartsFilePath() + "/" + sourceFile.getName().replace(".wav", "_l.wav"));
                audioMixer.changeVolume(leftRightGain[1], queueState.getQueueItem().getAudioPartFilePath() + "/" + sourceFile.getName(), queueState.getQueueItem().getMonoPartsFilePath() + "/" + sourceFile.getName().replace(".wav", "_r.wav"));
            }
        }

        stereoMixer.createStereoMixes(queueState.getQueueItem(), numOfGeneratedMixes);

        return queueState;
    }

}