Package com.tagtraum.beatunes.analysis
Class AudioPumpAnalysisTask
- java.lang.Object
-
- com.tagtraum.beatunes.analysis.Task
-
- com.tagtraum.beatunes.analysis.AudioPumpAnalysisTask
-
- All Implemented Interfaces:
TaskFactory
,TaskProcessListener
,TaskRunListener
,Matchable<PlayList.SubstringFilterProperty>
,Cloneable
@Entity public class AudioPumpAnalysisTask extends Task
Creates a pump for all childAudioAnalysisTask
s that return non-null
pipelines. To get to your results, usegetPumpResult(Object)
.- Author:
- Hendrik Schreiber
-
-
Field Summary
Fields Modifier and Type Field Description static int
AUDIO_ANALYSIS_DISK_BUFFER_SIZE
-
Fields inherited from class com.tagtraum.beatunes.analysis.Task
useOnlineResources
-
-
Constructor Summary
Constructors Constructor Description AudioPumpAnalysisTask()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AudioInputStream
get44_1kHzStereo16BitStream(AudioSong song)
Attempt to open an audio inputstream with certain properties: signed PCM, 44.1kHz, 16bit, stereo.Object
getPumpResult(Object id)
Lets you retrieve results produced by a sub-task's pipeline.Map<Object,Object>
getPumpResults()
Lets you retrieve results produced by a sub-task's pipeline.boolean
isUseOnlineResources()
Indicates whether this task should use online resources.void
runBefore(Task currentTask)
Is executed before sub tasks are run.boolean
skipLocalProcessing()
-
Methods inherited from class com.tagtraum.beatunes.analysis.Task
add, addTaskProcessListener, addTaskRunListener, cancel, clearProperties, createDeepCopy, createEditor, createTask, deepRemove, equals, fetchCollections, getAnalysisProgress, getApplication, getAudioFileFormat, getCurrentOperation, getDeepLeafs, getDeepTaskCount, getDeepTasks, getDescription, getEditor, getId, getMessagePanel, getName, getParent, getPriority, getProperties, getProperty, getPropertyNames, getReferenceSong, getSong, getSongId, getTask, getTaskCount, getTasks, hashCode, hasSucceeded, isAvailable, isCancelled, isDeepUseOnlineResources, isFileExistedBeforeStart, isLeaf, isPaused, isProgressRelevant, matches, maybePause, process, processAfter, processBefore, processFinally, remove, removeDeadLeaves, run, runAfter, runFinally, setAnalysisProgress, setApplication, setAudioFileFormat, setAvailable, setCurrentOperation, setId, setParent, setPaused, setPriority, setProgressRelevant, setProperties, setProperty, setReferenceSong, setSkipped, setSong, setSongId, setSucceeded, setUseOnlineResources, skip, toString, wasSkipped
-
-
-
-
Method Detail
-
isUseOnlineResources
public boolean isUseOnlineResources()
Description copied from class:Task
Indicates whether this task should use online resources. This persistent flag is typically set in the editorTask.createEditor()
. If it is set, itsTaskProcessListener.processBefore(Task)
method is called once online results are available.- Overrides:
isUseOnlineResources
in classTask
- Returns:
- true or false (defaults to
false
) - See Also:
Task.process()
-
runBefore
public void runBefore(Task currentTask) throws AnalysisException
Description copied from class:Task
Is executed before sub tasks are run.- Specified by:
runBefore
in interfaceTaskRunListener
- Overrides:
runBefore
in classTask
- Parameters:
currentTask
- task- Throws:
AnalysisException
- if this analysis step fails
-
getPumpResult
public Object getPumpResult(Object id)
Lets you retrieve results produced by a sub-task's pipeline.- Parameters:
id
- result id- Returns:
- result
- See Also:
SignalPump.pump()
,AudioAnalysisTask.createPipeline(javax.sound.sampled.AudioFileFormat)
,getPumpResults()
-
getPumpResults
public Map<Object,Object> getPumpResults()
Lets you retrieve results produced by a sub-task's pipeline.- Returns:
- results
- See Also:
SignalPump.pump()
,AudioAnalysisTask.createPipeline(javax.sound.sampled.AudioFileFormat)
,getPumpResult(Object)
-
get44_1kHzStereo16BitStream
public static AudioInputStream get44_1kHzStereo16BitStream(AudioSong song) throws UnsupportedAudioFileException, IOException
Attempt to open an audio inputstream with certain properties: signed PCM, 44.1kHz, 16bit, stereo.- Parameters:
song
- audio song- Returns:
- audio inputstream
- Throws:
UnsupportedAudioFileException
IOException
-
skipLocalProcessing
public boolean skipLocalProcessing()
-
-