Package com.tagtraum.beatunes.analysis
Class SongPropertyAnalysisTask
- java.lang.Object
-
- com.tagtraum.beatunes.analysis.Task
-
- com.tagtraum.beatunes.analysis.AudioAnalysisTask
-
- com.tagtraum.beatunes.analysis.SongPropertyAnalysisTask
-
- All Implemented Interfaces:
TaskFactory
,TaskProcessListener
,TaskRunListener
,Matchable
,Cloneable
- Direct Known Subclasses:
FingerprintTask
@Entity public class SongPropertyAnalysisTask extends AudioAnalysisTask
SongPropertyAnalysisTask.- Author:
- Hendrik Schreiber
-
-
Field Summary
-
Fields inherited from class com.tagtraum.beatunes.analysis.Task
useOnlineResources
-
-
Constructor Summary
Constructors Constructor Description SongPropertyAnalysisTask()
SongPropertyAnalysisTask(SongPropertyAnalyzer... possibleSongPropertyAnalyzers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
calculatePropertyValue()
Returns the "calculated" property value, e.g.Task
createDeepCopy()
This method creates a copy of the Task and its subtasks.TaskEditor<? extends Task>
createEditor()
By default instantiates a class with the namethis.getClass().getName() + "Editor"
.SignalProcessor<AudioBuffer,?>
createPipeline(AudioFileFormat audioFileFormat)
String
getDescription()
HTML or plain text description of this task.String
getName()
HTML or plaintext name of this task.SongPropertyAnalyzer[]
getPossibleSongPropertyAnalyzers()
protected Object
getProperty()
String
getPropertyName()
AudioClip
getRequiredClip(AudioFileFormat audioFileFormat)
SongPropertyAnalyzer
getSongPropertyAnalyzer()
boolean
isReplaceExistingValue()
void
runBefore(Task task)
Is executed before sub tasks are run.protected void
setProperty(Object value)
void
setReplaceExistingValue(boolean replaceExistingValue)
void
setSongPropertyAnalyzer(SongPropertyAnalyzer songPropertyAnalyzer)
boolean
skip()
Indicates, whether this task can be skipped.String
toString()
-
Methods inherited from class com.tagtraum.beatunes.analysis.AudioAnalysisTask
getAlgorithmName
-
Methods inherited from class com.tagtraum.beatunes.analysis.Task
add, addTaskProcessListener, addTaskRunListener, cancel, clearProperties, createTask, deepRemove, equals, fetchCollections, getAnalysisProgress, getApplication, getAudioFileFormat, getCurrentOperation, getDeepLeafs, getDeepTaskCount, getDeepTasks, getEditor, getId, getMessagePanel, getParent, getPriority, getProperties, getProperty, getPropertyNames, getReferenceSong, getSong, getSongId, getTask, getTaskCount, getTasks, hashCode, hasSucceeded, isAvailable, isCancelled, isDeepUseOnlineResources, isFileExistedBeforeStart, isLeaf, isPaused, isProgressRelevant, isUseOnlineResources, 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, wasSkipped
-
-
-
-
Constructor Detail
-
SongPropertyAnalysisTask
public SongPropertyAnalysisTask()
-
SongPropertyAnalysisTask
public SongPropertyAnalysisTask(SongPropertyAnalyzer... possibleSongPropertyAnalyzers)
-
-
Method Detail
-
getPropertyName
public String getPropertyName()
-
getName
public String getName()
Description copied from class:Task
HTML or plaintext name of this task. Defaults to the task's classname.
-
getDescription
public String getDescription()
Description copied from class:Task
HTML or plain text description of this task.- Overrides:
getDescription
in classTask
- Returns:
- description
-
isReplaceExistingValue
public boolean isReplaceExistingValue()
-
setReplaceExistingValue
public void setReplaceExistingValue(boolean replaceExistingValue)
-
createPipeline
public SignalProcessor<AudioBuffer,?> createPipeline(AudioFileFormat audioFileFormat)
- Overrides:
createPipeline
in classAudioAnalysisTask
-
getRequiredClip
public AudioClip getRequiredClip(AudioFileFormat audioFileFormat)
- Overrides:
getRequiredClip
in classAudioAnalysisTask
- Parameters:
audioFileFormat
- file format of the original, potentially compressed audio file- Returns:
- the clip this algorithm actually requires
-
runBefore
public void runBefore(Task task) throws AnalysisException
Description copied from class:Task
Is executed before sub tasks are run.- Specified by:
runBefore
in interfaceTaskRunListener
- Overrides:
runBefore
in classTask
- Parameters:
task
- task- Throws:
AnalysisException
- if this analysis step fails
-
calculatePropertyValue
protected Object calculatePropertyValue()
Returns the "calculated" property value, e.g. a pump result.- Returns:
- result
-
skip
public boolean skip()
Description copied from class:Task
Indicates, whether this task can be skipped. Defaults to false.Since this task is not necessarily called by beaTunes, but by your own implementation of
Task.runBefore(Task)
, you should callTask.setSkipped(boolean)
with whatever value you are returning.
-
createEditor
public TaskEditor<? extends Task> createEditor()
Description copied from class:Task
By default instantiates a class with the namethis.getClass().getName() + "Editor"
. If that does not work (because the editor class does not exist), anEmptyTaskEditor
is created. To create a meaningful editor for a configurable task, you must override this method.- Overrides:
createEditor
in classTask
- Returns:
- task editor for this task.
-
createDeepCopy
public Task createDeepCopy()
Description copied from class:Task
This method creates a copy of the Task and its subtasks. If you added any members to your subclass you MUST override this method and provide code that copies your members.- Overrides:
createDeepCopy
in classTask
- Returns:
- copy
-
setSongPropertyAnalyzer
public void setSongPropertyAnalyzer(SongPropertyAnalyzer songPropertyAnalyzer)
-
getSongPropertyAnalyzer
public SongPropertyAnalyzer getSongPropertyAnalyzer()
-
getPossibleSongPropertyAnalyzers
public SongPropertyAnalyzer[] getPossibleSongPropertyAnalyzers()
-
getProperty
protected Object getProperty() throws InvocationTargetException, IllegalAccessException
-
setProperty
protected void setProperty(Object value) throws InvocationTargetException, IllegalAccessException
-
-