diff src/uk/ac/qmul/eecs/depic/daw/beads/BeadsSoundEngineFactory.java @ 2:c0412c81d274

Added documentation
author Fiore Martin <f.martin@qmul.ac.uk>
date Thu, 18 Feb 2016 18:35:26 +0000
parents 629262395647
children
line wrap: on
line diff
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/BeadsSoundEngineFactory.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/BeadsSoundEngineFactory.java	Thu Feb 18 18:35:26 2016 +0000
@@ -18,9 +18,6 @@
 */
 package uk.ac.qmul.eecs.depic.daw.beads;
 
-import java.io.IOException;
-
-import javax.sound.sampled.UnsupportedAudioFileException;
 
 import uk.ac.qmul.eecs.depic.daw.Parameter;
 import uk.ac.qmul.eecs.depic.daw.Parameter.Type;
@@ -30,6 +27,24 @@
 import uk.ac.qmul.eecs.depic.daw.SoundWave;
 import uk.ac.qmul.eecs.depic.daw.beads.sonification.BeadsSonification;
 
+/**
+ * 
+ * Beads implementation of the {@code SoundEngineFactory}. All the object returned are typed with 
+ * classes of this package. Therefore all the classes use the same Beads library and enjoy package 
+ * access with one another. 
+ * 
+ * Also they can be safely downcasted in order to get full functionality. For example  
+ * in {@code createParameter} the argument of type {@code SoundWave} is downcasted 
+ * to {@code BeadsSoundWave}. This is guaranteed to be safe because the way SoundWave objects 
+ * are created is through the {@code createSoundWave} method, which returns a BeadsSoundWave. 
+ * 
+ * This is in the spirit of the Facade design pattern. So a unique point of access to the package object
+ * guarantees all the objects come from that package, despite implementing interfaces which are defined 
+ * outside. 
+ *  
+ *  
+ *
+ */
 public class BeadsSoundEngineFactory implements SoundEngineFactory {
 	private static final int MAX_TRACK_SCALE_FACTOR = 10;
 	private static final int MIN_CHUNCKSIZE = 8;