changeset 2:c0412c81d274

Added documentation
author Fiore Martin <f.martin@qmul.ac.uk>
date Thu, 18 Feb 2016 18:35:26 +0000
parents 629262395647
children 7f18cc173c4e
files src/uk/ac/qmul/eecs/depic/daw/Chunk.java src/uk/ac/qmul/eecs/depic/daw/Sonification.java src/uk/ac/qmul/eecs/depic/daw/beads/BeadsAutomation.java src/uk/ac/qmul/eecs/depic/daw/beads/BeadsParametersControl.java src/uk/ac/qmul/eecs/depic/daw/beads/BeadsSoundEngineFactory.java src/uk/ac/qmul/eecs/depic/daw/beads/BeadsSoundWave.java src/uk/ac/qmul/eecs/depic/daw/beads/GranularPlayer.java src/uk/ac/qmul/eecs/depic/daw/beads/SamplePlayer.java src/uk/ac/qmul/eecs/depic/daw/beads/ZoomUGen.java src/uk/ac/qmul/eecs/depic/daw/beads/package-info.java src/uk/ac/qmul/eecs/depic/daw/beads/sonification/AutomationSound.java src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsAutomationMapping.java src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsPeakLevelMapping.java src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsSonification.java src/uk/ac/qmul/eecs/depic/daw/beads/sonification/Buzz.java src/uk/ac/qmul/eecs/depic/daw/beads/sonification/PitchedUGen.java src/uk/ac/qmul/eecs/depic/daw/beads/sonification/SonificationPrefsPanel.java src/uk/ac/qmul/eecs/depic/daw/gui/AudioTrackParameters.java src/uk/ac/qmul/eecs/depic/daw/gui/AudioTrackSonification.java src/uk/ac/qmul/eecs/depic/daw/gui/MainFrame.java src/uk/ac/qmul/eecs/depic/daw/gui/PreferencesDialog.java src/uk/ac/qmul/eecs/depic/daw/gui/PreferencesPanel.java src/uk/ac/qmul/eecs/depic/daw/gui/Rule.java src/uk/ac/qmul/eecs/depic/daw/gui/SequenceGraph.java src/uk/ac/qmul/eecs/depic/daw/gui/SequencePoint.java src/uk/ac/qmul/eecs/depic/daw/gui/actions/EditActions.java src/uk/ac/qmul/eecs/depic/daw/gui/actions/MenuAction.java src/uk/ac/qmul/eecs/depic/daw/gui/actions/TransportControlActions.java src/uk/ac/qmul/eecs/depic/daw/gui/actions/UniqueHapticTrigger.java src/uk/ac/qmul/eecs/depic/daw/gui/actions/package-info.java src/uk/ac/qmul/eecs/depic/daw/gui/package-info.java src/uk/ac/qmul/eecs/depic/daw/haptics/DawHapticListener.java src/uk/ac/qmul/eecs/depic/daw/haptics/HapticTrigger.java src/uk/ac/qmul/eecs/depic/daw/haptics/HapticViewPort.java src/uk/ac/qmul/eecs/depic/daw/haptics/HaptificationPrefsPanel.java src/uk/ac/qmul/eecs/depic/daw/haptics/package-info.java src/uk/ac/qmul/eecs/depic/daw/referencesound/BeadsSequenceMapping.java src/uk/ac/qmul/eecs/depic/daw/referencesound/GridSound.java src/uk/ac/qmul/eecs/depic/daw/referencesound/package-info.java src/uk/ac/qmul/eecs/depic/patterns/SequenceMapping.java
diffstat 40 files changed, 283 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/src/uk/ac/qmul/eecs/depic/daw/Chunk.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/Chunk.java	Thu Feb 18 18:35:26 2016 +0000
@@ -23,7 +23,7 @@
 
 /**
  * 
- * A Chunk is a number of contiguous samples. It is used in the visual representation of a sound wave where only the maximum 
+ * A Chunk is a set of contiguous audio samples. It is used in the visual representation of a sound wave where only the maximum 
  * and minimum values of all the samples are taken into account. In the sound wave a chuck would be drawn as a vertical
  * line at a specific x position, all the contiguous chunks make the sound wave as usually drawn.       
  *
--- a/src/uk/ac/qmul/eecs/depic/daw/Sonification.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/Sonification.java	Thu Feb 18 18:35:26 2016 +0000
@@ -29,14 +29,19 @@
  */
 public interface Sonification {
 
+	/** returns the sequence mapping */
 	public SequenceMapping getSequenceMapping(SoundType soundType);
 	
+	/** play the sound of the event: cursor entering the selection */
 	public void withinSelection(float g, float p);
 	
+	/** play the sound of the event: cursor exits the selection */
 	public void outsideSelection();
 	
+	/** play a sound with default gain and pan */
 	public void play(SoundType type);
 	
+	/** play a sound with specific gain and pan */ 
 	public void play(SoundType type, float gain, float pan);
 
 }
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/BeadsAutomation.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/BeadsAutomation.java	Thu Feb 18 18:35:26 2016 +0000
@@ -33,6 +33,17 @@
 import uk.ac.qmul.eecs.depic.patterns.SequenceEvent;
 import uk.ac.qmul.eecs.depic.patterns.SequenceListener;
 
+/**
+ * 
+ * An automation implemented as a Beads UGen. 
+ * Automations are a series of audio rate slopes that change an parameter over time. So this
+ * version is implemented as a {@code UGen} that in the {@code processBuffer} produces audio rate values by 
+ * linearly interpolating between adjacent automation points ( automation points are represented as
+ * {@code AutomationValue} objects  )
+ *   
+ * 
+ *
+ */
 public class BeadsAutomation extends UGen implements Automation {
 	private static final float MIN_THRESHOLD = 0.05f;
 	//private Parameter parameter;
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/BeadsParametersControl.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/BeadsParametersControl.java	Thu Feb 18 18:35:26 2016 +0000
@@ -28,6 +28,11 @@
 import uk.ac.qmul.eecs.depic.daw.ParametersControl;
 import uk.ac.qmul.eecs.depic.daw.SoundWaveEvent;
 
+/**
+ * 
+ * Beads implementation of the {@code ParametersControl} interface. 
+ *
+ */
 class BeadsParametersControl implements ParametersControl {	
 	Parameter[] parameters;
 	GainParameter playersGain; 
--- 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;
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/BeadsSoundWave.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/BeadsSoundWave.java	Thu Feb 18 18:35:26 2016 +0000
@@ -49,6 +49,11 @@
 import uk.ac.qmul.eecs.depic.daw.WavePeaks;
 import uk.ac.qmul.eecs.depic.patterns.Sequence;
 
+/**
+ * 
+ * A {@code SoundWave} implementation 
+ *
+ */
 class BeadsSoundWave implements SoundWave  {
 	private Set<SoundWaveListener> listeners;
 	private int minChunkSize;
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/GranularPlayer.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/GranularPlayer.java	Thu Feb 18 18:35:26 2016 +0000
@@ -32,7 +32,7 @@
  * 
  * Plays a sample on a granular synthesizer 
  * 
- * It has two entries in its class Preferences:  
+ * It is used for scanning through a sound wave in {@code BeadsSoundWave.scrub} 
  * 
  *
  */
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/SamplePlayer.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/SamplePlayer.java	Thu Feb 18 18:35:26 2016 +0000
@@ -36,7 +36,10 @@
 import uk.ac.qmul.eecs.depic.patterns.Range;
 
 /**
- *
+ * This is actually responsible for play the audio file in a track when the play button is pressed. 
+ * It implements a {@code SoundWaveListener} because it updates its lenght when the sound wave changes 
+ * 
+ * 
  */
 public class SamplePlayer extends UGen implements SoundWaveListener {
 	
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/ZoomUGen.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/ZoomUGen.java	Thu Feb 18 18:35:26 2016 +0000
@@ -26,6 +26,7 @@
 import net.beadsproject.beads.ugens.Gain;
 import net.beadsproject.beads.ugens.WavePlayer;
 
+/* not used */
 public class ZoomUGen extends UGenChain {
 
 	public ZoomUGen(AudioContext context, int outputs) {
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/package-info.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/package-info.java	Thu Feb 18 18:35:26 2016 +0000
@@ -1,10 +1,12 @@
 /**
  * An implementation of the sound engine that uses the Beads library (http://www.beadsproject.net)
  * 
- * this package contains the classes that handle sound intended as content: playing back a sound files with automations
- * applied etc.   
+ * This package contains the classes that handle sound intended as content: 
+ * like playing back a sound files with automations applied, scanning through the wave etc.  
  * 
+ * So here are no sonification sounds. 
  * For the sonification part look in uk.ac.qmul.eecs.depic.daw.beads.sonification  
+ * and uk.ac.qmul.eecs.depic.daw.referencesounds
  */
 
 package uk.ac.qmul.eecs.depic.daw.beads;
\ No newline at end of file
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/AutomationSound.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/AutomationSound.java	Thu Feb 18 18:35:26 2016 +0000
@@ -29,6 +29,7 @@
 import net.beadsproject.beads.ugens.TapOut;
 import net.beadsproject.beads.ugens.WavePlayer;
 
+/* not used */
 public class AutomationSound extends UGenChain {
 	private WavePlayer sinOsc;
 	private UGen noise;
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsAutomationMapping.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsAutomationMapping.java	Thu Feb 18 18:35:26 2016 +0000
@@ -27,6 +27,16 @@
 import uk.ac.qmul.eecs.depic.daw.beads.sonification.PitchedUGen;
 import uk.ac.qmul.eecs.depic.patterns.Range;
 
+/**
+ * 
+ * The sonification used for automations graphs  in this programs.  
+ * An automation graph is a sequence (as in uk.ac.qmul.eecs.depic.patterns.Sequence) so 
+ * this sonification extends BeadsSequenceMapping and is defined in terms of the more abstract 
+ * properties of Sequence. So, despite the name, this same sonification could be used 
+ * for another type of sequence without any modifications.
+ *  
+ *
+ */
 public class BeadsAutomationMapping extends BeadsSequenceMapping {
 	private final Range<Float> PITCH_SPAN = new Range<Float>(0.2f,1.2f);
 	private Sample sample;
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsPeakLevelMapping.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsPeakLevelMapping.java	Thu Feb 18 18:35:26 2016 +0000
@@ -31,6 +31,16 @@
 import uk.ac.qmul.eecs.depic.daw.beads.sonification.PitchedUGen;
 import uk.ac.qmul.eecs.depic.patterns.Range;
 
+/**
+ * 
+ * The sonification used for peak levels graphs  in this programs.  
+ * A peak level graph is a sequence (as in uk.ac.qmul.eecs.depic.patterns.Sequence) so 
+ * this sonification extends BeadsSequenceMapping and is defined in terms of the more abstract 
+ * properties of Sequence. So, despite the name, this same sonification could be used 
+ * for another type of sequence without any modifications.
+ *  
+ *
+ */
 public class BeadsPeakLevelMapping extends BeadsSequenceMapping {
 	private final static Range<Float> PITCH_SPAN = new Range<Float>(100.0f,440.0f); 
 	
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsSonification.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/BeadsSonification.java	Thu Feb 18 18:35:26 2016 +0000
@@ -35,6 +35,11 @@
 import uk.ac.qmul.eecs.depic.daw.SoundType;
 import uk.ac.qmul.eecs.depic.patterns.SequenceMapping;
 
+/**
+ * 
+ * Sonification class that uses the Beads library 
+ *
+ */
 public class BeadsSonification implements Sonification {
 	
 	private AudioContext ac;
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/Buzz.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/Buzz.java	Thu Feb 18 18:35:26 2016 +0000
@@ -26,6 +26,11 @@
 import net.beadsproject.beads.ugens.Gain;
 import net.beadsproject.beads.ugens.WavePlayer;
 
+/**
+ * 
+ * A unit generator that sounds like a buzz
+ *
+ */
 public class Buzz extends UGenChain {
 	private Gain gain;
 	private  Envelope env;
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/PitchedUGen.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/PitchedUGen.java	Thu Feb 18 18:35:26 2016 +0000
@@ -23,7 +23,7 @@
 import net.beadsproject.beads.core.UGenChain;
 
 /**
- * A UGen with pitch 
+ * A UGen (unit generator) with pitch 
  * 
  *
  */
--- a/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/SonificationPrefsPanel.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/beads/sonification/SonificationPrefsPanel.java	Thu Feb 18 18:35:26 2016 +0000
@@ -32,6 +32,17 @@
 
 import javax.swing.JCheckBox;
 
+/**
+ * 
+ * GUI panel for setting preferences for the sonification. It is in this package and not in 
+ * the gui package because it's specific to this sonification. The gui package is more 
+ * a general purpose set of graphical classes for the DAW, regardless of the sonification.
+ * 
+ * However this class extends PreferencesPanel, which is an abstraction of a preference panel
+ * to allow other packages to plug in their custom preference settings panels, 
+ * without making the gui package dependent on them.    
+ *
+ */
 public class SonificationPrefsPanel extends PreferencesPanel {
 	private static String [] keys = new String [] {
 		"selection.filter",
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/AudioTrackParameters.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/AudioTrackParameters.java	Thu Feb 18 18:35:26 2016 +0000
@@ -46,6 +46,11 @@
 import uk.ac.qmul.eecs.depic.patterns.SequenceEvent;
 import uk.ac.qmul.eecs.depic.patterns.SequenceListener;
 
+/**
+ * 
+ * The small panel with parameters like volume and pan that sits at the left of each audio track 
+ *
+ */
 public class AudioTrackParameters extends JPanel {
 	private static final long serialVersionUID = 1L;
 	private final static int SLIDER_SCALE = 100;
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/AudioTrackSonification.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/AudioTrackSonification.java	Thu Feb 18 18:35:26 2016 +0000
@@ -30,6 +30,14 @@
 import uk.ac.qmul.eecs.depic.daw.SoundType;
 import uk.ac.qmul.eecs.depic.daw.SoundWave;
 
+/**
+ * Plays sonification sounds of the audio track through the member variable of 
+ * type {@code Sonification} that is initialized with {@code Daw.getSoundEngineFactory().getSharedSonification()}
+ * 
+ * Listen to property changes of AudioTrack objects ("cursorPos" and "mouseDragSelection" properties) 
+ * and to changes of sequence graphs (automation graphs) objects.
+ *
+ */
 class AudioTrackSonification implements PropertyChangeListener, ChangeListener {
 	private Sonification sonification = Daw.getSoundEngineFactory().getSharedSonification();
 	private AudioTrack track;
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/MainFrame.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/MainFrame.java	Thu Feb 18 18:35:26 2016 +0000
@@ -46,7 +46,11 @@
 import uk.ac.qmul.eecs.depic.daw.Daw;
 import uk.ac.qmul.eecs.depic.daw.gui.actions.Actions;
 
-
+/**
+ * 
+ * The main frame of this program.
+ *
+ */
 public class MainFrame extends JFrame {
 	private static final long serialVersionUID = 1L;
 	private Actions actions;
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/PreferencesDialog.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/PreferencesDialog.java	Thu Feb 18 18:35:26 2016 +0000
@@ -32,7 +32,12 @@
 import javax.swing.JPanel;
 import javax.swing.JTabbedPane;
 
-
+/**
+ * 
+ * Preference Dialog. It contains preference panels and when OK button is pressed 
+ * it calls {@code savePrefs()} on all the panels.
+ *
+ */
 public class PreferencesDialog extends JDialog {
 	private static final long serialVersionUID = 1L;
 	private final JTabbedPane content = new JTabbedPane();
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/PreferencesPanel.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/PreferencesPanel.java	Thu Feb 18 18:35:26 2016 +0000
@@ -20,6 +20,14 @@
 
 import javax.swing.JPanel;
 
+/**
+ * 
+ * Abstract panel for exposing configuration parameters.
+ * 
+ * To be extended by other packages that need to expose configuration parameters. By using this abstraction 
+ * this package is not dependent on such packages.
+ *
+ */
 public abstract class PreferencesPanel extends JPanel {
 	private static final long serialVersionUID = 1L;
 
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/Rule.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/Rule.java	Thu Feb 18 18:35:26 2016 +0000
@@ -43,7 +43,11 @@
 import uk.ac.qmul.eecs.depic.daw.Selection;
 import uk.ac.qmul.eecs.depic.daw.SoundWave;
 
-
+/**
+ * 
+ * The rule on top of the arrange window. 
+ *
+ */
 public class Rule extends JComponent implements PropertyChangeListener , Accessible {
 	private static final long serialVersionUID = 1L;
 	public static final int DEFAULT_TICK_INTERVAL = 50;
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/SequenceGraph.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/SequenceGraph.java	Thu Feb 18 18:35:26 2016 +0000
@@ -38,9 +38,15 @@
 import uk.ac.qmul.eecs.depic.patterns.Sequence;
 import uk.ac.qmul.eecs.depic.patterns.SequenceEvent;
 import uk.ac.qmul.eecs.depic.patterns.SequenceListener;
-import uk.ac.qmul.eecs.depic.patterns.SequenceMapping;
 
-public class SequenceGraph implements SequenceMapping, SequenceListener {
+/**
+ * 
+ * A visual representation of a sequence graph. Here used for automation graphs overlaying the audio track.
+ *
+ * It listen to sequences (automations) and, when the sequence is updated, it updates itself
+ * and triggers the registered change listeners. 
+ */
+public class SequenceGraph implements  SequenceListener {
 	private static final float SEQUENCE_LINE_WIDTH = 4.0f;
 	private static final int   SEQUENCE_POINTS_CAPACITY = 30;
 	
@@ -244,19 +250,5 @@
 		fireChangeListeners();
 	}
 
-	@Override
-	public void renderValue(Sequence.Value val) {
-		throw new UnsupportedOperationException("Only update() implemented");
-	}
-
-	@Override
-	public void renderCurve(Sequence m, float startTime) {
-		throw new UnsupportedOperationException("Only update() implemented");
-	}
-
-	@Override
-	public void renderCurveAt(Sequence m, float time, float duration) {
-		throw new UnsupportedOperationException("Only update() implemented");
-	}
 }
 
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/SequencePoint.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/SequencePoint.java	Thu Feb 18 18:35:26 2016 +0000
@@ -23,6 +23,11 @@
 import uk.ac.qmul.eecs.depic.patterns.MathUtils;
 import uk.ac.qmul.eecs.depic.patterns.Sequence;
 
+/**
+ * 
+ * A graphic representation of a Sequence.Value (automation point) 
+ *
+ */
 public class SequencePoint extends Ellipse2D.Float {
 	private static final long serialVersionUID = 1L;
 	public final static int SIZE = 9;
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/actions/EditActions.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/actions/EditActions.java	Thu Feb 18 18:35:26 2016 +0000
@@ -28,6 +28,11 @@
 import uk.ac.qmul.eecs.depic.daw.gui.AudioTrack;
 import uk.ac.qmul.eecs.depic.daw.gui.MainFrame;
 
+/**
+ * 
+ * Actions to edit the sound wave (also in the menu)
+ *
+ */
 class EditActions {
 	MainFrame frame;
 	Action cutAction;
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/actions/MenuAction.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/actions/MenuAction.java	Thu Feb 18 18:35:26 2016 +0000
@@ -25,7 +25,11 @@
 import javax.swing.AbstractAction;
 import javax.swing.KeyStroke;
 
-
+/**
+ * 
+ * Actions that are associated with the menu ( also Edit actions are in the menu though)
+ *
+ */
 abstract class MenuAction extends AbstractAction {
 	private static final long serialVersionUID = 1L;
 
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/actions/TransportControlActions.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/actions/TransportControlActions.java	Thu Feb 18 18:35:26 2016 +0000
@@ -30,6 +30,11 @@
 import uk.ac.qmul.eecs.depic.daw.gui.AudioTrack;
 import uk.ac.qmul.eecs.depic.daw.gui.MainFrame;
 
+/**
+ * 
+ * Actions associated with the transport bar: play, stop, rewind etc.
+ *
+ */
 public class TransportControlActions {
 	private MainFrame frame;
 	private boolean isPlaying; 
--- a/src/uk/ac/qmul/eecs/depic/daw/gui/actions/UniqueHapticTrigger.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/actions/UniqueHapticTrigger.java	Thu Feb 18 18:35:26 2016 +0000
@@ -25,11 +25,31 @@
 import uk.ac.qmul.eecs.depic.daw.haptics.HapticTrigger;
 import uk.ac.qmul.eecs.depic.patterns.Sequence;
 
+/**
+ * 
+ * Wraps an haptic trigger and makes sure that when a new trigger is created and installed 
+ * as a listener to a sound wave or a sequence, previously installed triggers are removed first. 
+ * 
+ * This allows to have the haptic device to render only one audio track at time. 
+ * See {@code ShowHapticsAction} for more details. When the show haptic action is performed
+ * the haptic device is linked to the currently selected track only. If any previous track was being rendered
+ * in haptics, then the trigger is removed from the listeners. 
+ *
+ */
 class UniqueHapticTrigger {
 	private HapticTrigger trigger;
 	private UniqueHapticTrigger uniqueTrigger;
 	private List<Object> observed = new ArrayList<>(2);
 		
+	/**
+	 * Sets a new haptic trigger. Before doing that de-install the previous haptic trigger 
+	 * from the objects the trigger was listening to. Namely the sequence or the waves 
+	 * that were passed to either {@code addToListener} method. 
+	 * 
+	 * 
+	 * 
+	 * @param t the new haptic trigger
+	 */
 	public void set(HapticTrigger t){
 		
 		/* remove the trigger from the observed objects */
@@ -53,6 +73,11 @@
 	
 	}
 	
+	/**
+	 * Add the wrapped haptic trigger among the listeners of the Sequence s 
+	 * 
+	 * @param s
+	 */
 	public void addToListener(Sequence s){
 		s.addSequenceListener(trigger);
 		observed.add(s);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/actions/package-info.java	Thu Feb 18 18:35:26 2016 +0000
@@ -0,0 +1,9 @@
+/**
+ * This package contains all the actions on the 
+ * 
+ * The actions are grouped into different files just to avoid having a unique gigantic file
+ * with all the actions. All the action can be accessed from the {@code Actions} object.   
+ *  
+ */
+
+package uk.ac.qmul.eecs.depic.daw.gui.actions;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/gui/package-info.java	Thu Feb 18 18:35:26 2016 +0000
@@ -0,0 +1,7 @@
+/**
+ * 
+ * This package contains all the classes that make up the GUI of the Cross Modal DAW prototype.
+ * 
+ * 
+ */
+package uk.ac.qmul.eecs.depic.daw.gui;
\ No newline at end of file
--- a/src/uk/ac/qmul/eecs/depic/daw/haptics/DawHapticListener.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/haptics/DawHapticListener.java	Thu Feb 18 18:35:26 2016 +0000
@@ -18,6 +18,14 @@
 import uk.ac.qmul.eecs.depic.patterns.Sequence;
 import uk.ac.qmul.eecs.depic.patterns.SequenceListener;
 
+/**
+ * 
+ * A concrete subclass of  {@code HapticListener} from the jHapticGUI library.
+ * 
+ * It listens to haptic device commands and it executes them in the DAW.
+ * 
+ *
+ */
 public class DawHapticListener extends HapticListener {
 	public static final boolean SUPPORT_VIEW_PORT = false; 
 	public static final String SCRUB_OFF_MSG = "scrub.off";
--- a/src/uk/ac/qmul/eecs/depic/daw/haptics/HapticTrigger.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/haptics/HapticTrigger.java	Thu Feb 18 18:35:26 2016 +0000
@@ -13,7 +13,15 @@
 import uk.ac.qmul.eecs.depic.patterns.SequenceListener;
 import uk.ac.qmul.eecs.depic.patterns.SequenceMapping;
 
-
+/**
+ * 
+ * Listens to elements of the DAW and sends commands to the haptic device in order to 
+ * render such elements in haptics. It implements all the listeners interfaces because it reacts
+ * to changes and mirrors them in haptics. 
+ * 
+ * It is used to render sound waves and automations (sequences) in haptics
+ *
+ */
 public class HapticTrigger implements SequenceMapping, SequenceListener,  SoundWaveListener  {
 	public enum DisplayType { 
 		DISPLAY_SEQUENCE,
--- a/src/uk/ac/qmul/eecs/depic/daw/haptics/HapticViewPort.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/haptics/HapticViewPort.java	Thu Feb 18 18:35:26 2016 +0000
@@ -1,5 +1,17 @@
 package uk.ac.qmul.eecs.depic.daw.haptics;
 
+/**
+ * The haptic viewport is the specific portion of a track that is visible in the haptic view 
+ * in every moment. 
+ * 
+ * It uses the same concept of a scrollable window: if the content is to big to be represented 
+ * in a single window, then you only represent a portion of it and allow the user to scroll 
+ * up and down. Likewise the haptic view port only represent one portion of audio track at 
+ * the time and when the haptic proxy gets to the left or right ends of the view port, then 
+ * the viewport is shifted of a certain amount of pixels.
+ * 
+ *
+ */
 public class HapticViewPort {
 	public static final int DEFAULT_WIDTH = 2320; // 2 secs at scale factor =1 
 												  //with 8000 Hz frame rate. x = 4000/frameRate * minChunksize => 2 = 4000/8000 * 4 
--- a/src/uk/ac/qmul/eecs/depic/daw/haptics/HaptificationPrefsPanel.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/haptics/HaptificationPrefsPanel.java	Thu Feb 18 18:35:26 2016 +0000
@@ -13,6 +13,17 @@
 
 import javax.swing.JComboBox;
 
+/**
+ * 
+ * Preference panel for the haptic display of the DAW. It is in this package and not in 
+ * the gui package because it's specific to this sonification. The gui package is more 
+ * a general purpose set of graphical classes for the DAW, regardless of the sonification.
+ * 
+ * However this class extends PreferencesPanel, which is an abstraction of a preference panel
+ * to allow other packages to plug in their custom preference settings panels, 
+ * without making the gui package dependent on them.    
+ *
+ */
 public class HaptificationPrefsPanel extends PreferencesPanel {
 	
 	public static GridSound.Type [] SOUND_TYPES = {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/haptics/package-info.java	Thu Feb 18 18:35:26 2016 +0000
@@ -0,0 +1,10 @@
+/**
+ * This package contains Java classes that handle the haptic device
+ * 
+ * Note that the jHapticGUI library (https://code.soundsoftware.ac.uk/projects/jhapticgui) is used.
+ * 
+ * 
+ *  
+ */
+
+package uk.ac.qmul.eecs.depic.daw.haptics;
\ No newline at end of file
--- a/src/uk/ac/qmul/eecs/depic/daw/referencesound/BeadsSequenceMapping.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/referencesound/BeadsSequenceMapping.java	Thu Feb 18 18:35:26 2016 +0000
@@ -28,8 +28,9 @@
 import uk.ac.qmul.eecs.depic.patterns.SequenceMapping;
 
 /**
- * Implements the sequence mapping using the Beads sound engine
- * 
+ * Implements {@code uk.ac.qmul.eecs.depic.patterns.SequenceMapping} using the Beads sound engine
+ * It's a slightly modified version of {@code uk.ac.qmul.eecs.depic.daw.beads.BeadsSequenceMapping}
+ * that includes the one ref and multiple ref sonification, used in GridSound.  
  * 
  *
  */
--- a/src/uk/ac/qmul/eecs/depic/daw/referencesound/GridSound.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/referencesound/GridSound.java	Thu Feb 18 18:35:26 2016 +0000
@@ -26,6 +26,18 @@
 import uk.ac.qmul.eecs.depic.patterns.Sequence;
 import uk.ac.qmul.eecs.depic.patterns.Sequence.Value;
 
+/**
+ * 
+ * Sonification of the haptic grid used to edit automation points. 
+ * It implements the sonification strategies we used during our studies: no reference, single 
+ * reference, multiple reference. 
+ * 
+ * It uses an in-package modified version BeadsSequenceMapping to produce the single tones that make 
+ * up the sonification. 
+ * 
+ *  
+ *
+ */
 public abstract class GridSound  {
 	public static final long REFERENCE_DELAY_MS = 200; 
 	protected BeadsSequenceMapping mapping;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/uk/ac/qmul/eecs/depic/daw/referencesound/package-info.java	Thu Feb 18 18:35:26 2016 +0000
@@ -0,0 +1,7 @@
+/**
+ *  This package was added later for the sonification of the automations based on haptic grid with 
+ *  reference. This was to incorporate the output of our studies in the DAW.   
+ *  
+ *  
+ */
+package uk.ac.qmul.eecs.depic.daw.referencesound;
\ No newline at end of file
--- a/src/uk/ac/qmul/eecs/depic/patterns/SequenceMapping.java	Wed Feb 17 14:43:35 2016 +0000
+++ b/src/uk/ac/qmul/eecs/depic/patterns/SequenceMapping.java	Thu Feb 18 18:35:26 2016 +0000
@@ -31,9 +31,14 @@
 	public float DURATION_INF = Float.POSITIVE_INFINITY;
 	public float DURATION_STOP = -1.0f;
 	
+	/**
+	 * renders a single value of the sequence 
+	 * @param val
+	 */
 	public void renderValue(Sequence.Value val);
 	
 	/**
+	 * Renders the whole curve, from start to end 
 	 * 
 	 * @param m
 	 * @param startTime the time in millisecond the curve rendering has to start from, if 
@@ -43,9 +48,9 @@
 	
 	/**
 	 * 
-	 * Render a curve at precise time in sound. 
+	 * Render a curve at precise time  
 	 * 
-	 * The sound lasts {@code duration} milliseconds and then fades out. 
+	 * If sound is used for rendering, the sound lasts {@code duration} milliseconds and then fades out. 
 	 * If {@code INF} is passed as duration the sound will go on forever. Successive calls with {@code INF} as duration
 	 * will have the effect of changing the sound in order to represent the curve at the new {@code time} passed as argument.
 	 * Successive calls with {@code duration} different from {@code DURATION_INF} will carry on the sound for {@code duration}