diff src/uk/ac/qmul/eecs/depic/daw/AudioLoader.java @ 1:629262395647

Added some dosumentation added .hginfo
author Fiore Martin <f.martin@qmul.ac.uk>
date Wed, 17 Feb 2016 14:43:35 +0000
parents 3074a84ef81e
children
line wrap: on
line diff
--- a/src/uk/ac/qmul/eecs/depic/daw/AudioLoader.java	Wed Aug 26 16:16:53 2015 +0100
+++ b/src/uk/ac/qmul/eecs/depic/daw/AudioLoader.java	Wed Feb 17 14:43:35 2016 +0000
@@ -33,8 +33,12 @@
 import javax.swing.SwingWorker;
 
 import uk.ac.qmul.eecs.depic.daw.AudioLoader.ReturnObject;
-import uk.ac.qmul.eecs.depic.daw.beads.BeadsSampleWrapper;
 
+/**
+ * 
+ * A swing worker that loads an audio file in a separate thread. It returns a RetunObject when the loading is complete. 
+ *
+ */
 public class AudioLoader extends SwingWorker<ReturnObject,Void>{
 	public static final int FILE_LOAD_TOTAL_PROGRESS = 100;
 	/**
@@ -157,12 +161,9 @@
 		}
 		
 		/* open the Sample for playback */			
-		BeadsSampleWrapper sample = new BeadsSampleWrapper(new 
-				net.beadsproject.beads.data.Sample(
-						audioFile.getAbsolutePath(),
-						net.beadsproject.beads.data.Sample.Regime.newStreamingRegimeWithAging(1000, 1000)
-				)
-		);
+		Sample sample = Daw.getSoundEngineFactory().createSample(audioFile.getAbsolutePath()); 
+				
+				
 		/* return sample and chunks to the event dispatching thread */
 		return new ReturnObject(newFileChunks,sample,originalAudioFormat,conversionFormat);
 	}
@@ -171,8 +172,14 @@
 		return DEFAULT_CONVERSION_FORMAT;
 	}
 	
+	/**
+	 * 
+	 * An object returned by the AudioLoader. It contains meta data about the sound sample such as wave peaks and format
+	 * as well as the Sample object representing the loaded sample.  
+	 *
+	 */
 	public static class ReturnObject {
-		public ReturnObject(WavePeaks peaks, BeadsSampleWrapper s, 
+		public ReturnObject(WavePeaks peaks, Sample s, 
 						AudioFormat originalFormat, AudioFormat conversionFormat) {
 			super();
 			this.peaks = peaks;
@@ -182,7 +189,7 @@
 		}
 		
 		public WavePeaks peaks;
-		public BeadsSampleWrapper sample;
+		public Sample sample;
 		public AudioFormat originalFormat;
 		public AudioFormat conversionFormat;
 	}