Package com.tagtraum.beatunes.analysis
Class AnalyzeKey
- java.lang.Object
-
- com.tagtraum.beatunes.analysis.Task
-
- com.tagtraum.beatunes.analysis.AudioAnalysisTask
-
- com.tagtraum.beatunes.analysis.AnalyzeKey
-
- All Implemented Interfaces:
TaskFactory,TaskProcessListener,TaskRunListener,Matchable,Cloneable
@Entity public class AnalyzeKey extends AudioAnalysisTask
Analyze key.- Author:
- Hendrik Schreiber
-
-
Field Summary
-
Fields inherited from class com.tagtraum.beatunes.analysis.Task
useOnlineResources
-
-
Constructor Summary
Constructors Constructor Description AnalyzeKey()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AnalyzeKeycreateDeepCopy()This method creates a copy of the Task and its subtasks.TaskEditor<AnalyzeKey>createEditor()By default instantiates a class with the namethis.getClass().getName() + "Editor".SignalProcessorcreatePipeline(AudioFileFormat audioFileFormat)booleanequals(Object o)static StringgetClassName(KeyTextRenderer renderer)Ruby and Python object's classnames are not the same after the JVM exists.StringgetDescription()HTML or plain text description of this task.com.tagtraum.beatunes.analysis.AnalyzeKey.KeyClassifiergetKeyClassifier()StringgetName()HTML or plaintext name of this task.KeyTextRenderergetRenderer()StringgetRendererClass()AudioClipgetRequiredClip(AudioFileFormat audioFileFormat)inthashCode()booleanisCopyToComment()booleanisLimitToOneMinute()booleanisOverwriteComment()booleanisReplaceExistingKey()voidprocessBefore(Task task)Process online results with this task before other tasks are invoked.voidrunBefore(Task task)Is executed before sub tasks are run.voidsetCopyToComment(boolean overwrite)voidsetKeyClassifier(com.tagtraum.beatunes.analysis.AnalyzeKey.KeyClassifier keyClassifier)voidsetKeyClassifier(String keyClassifier)voidsetLimitToOneMinute(boolean limitToOneMinute)voidsetOverwriteComment(boolean overwrite)voidsetRendererClass(String klass)voidsetReplaceExistingKey(boolean replaceExistingKey)booleanskip()Indicates, whether this task can be skipped.StringtoString()-
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, fetchCollections, getAnalysisProgress, getApplication, getAudioFileFormat, getCurrentOperation, getDeepLeafs, getDeepTaskCount, getDeepTasks, getEditor, getId, getMessagePanel, getParent, getPriority, getProperties, getProperty, getPropertyNames, getReferenceSong, getSong, getSongId, getTask, getTaskCount, getTasks, hasSucceeded, isAvailable, isCancelled, isDeepUseOnlineResources, isFileExistedBeforeStart, isLeaf, isPaused, isProgressRelevant, isUseOnlineResources, matches, maybePause, process, processAfter, 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
-
-
-
-
Method Detail
-
getName
public String getName()
Description copied from class:TaskHTML or plaintext name of this task. Defaults to the task's classname.
-
getDescription
public String getDescription()
Description copied from class:TaskHTML or plain text description of this task.- Overrides:
getDescriptionin classTask- Returns:
- description
-
createPipeline
public SignalProcessor createPipeline(AudioFileFormat audioFileFormat)
- Overrides:
createPipelinein classAudioAnalysisTask
-
setOverwriteComment
public void setOverwriteComment(boolean overwrite)
-
isOverwriteComment
public boolean isOverwriteComment()
-
setCopyToComment
public void setCopyToComment(boolean overwrite)
-
isCopyToComment
public boolean isCopyToComment()
-
setRendererClass
public void setRendererClass(String klass)
-
getRendererClass
public String getRendererClass()
-
getRenderer
public KeyTextRenderer getRenderer()
-
isLimitToOneMinute
public boolean isLimitToOneMinute()
-
setLimitToOneMinute
public void setLimitToOneMinute(boolean limitToOneMinute)
-
getKeyClassifier
public com.tagtraum.beatunes.analysis.AnalyzeKey.KeyClassifier getKeyClassifier()
-
setKeyClassifier
public void setKeyClassifier(com.tagtraum.beatunes.analysis.AnalyzeKey.KeyClassifier keyClassifier)
-
setKeyClassifier
public void setKeyClassifier(String keyClassifier)
-
isReplaceExistingKey
public boolean isReplaceExistingKey()
-
setReplaceExistingKey
public void setReplaceExistingKey(boolean replaceExistingKey)
-
getRequiredClip
public AudioClip getRequiredClip(AudioFileFormat audioFileFormat)
- Overrides:
getRequiredClipin classAudioAnalysisTask- Parameters:
audioFileFormat- file format of the original, potentially compressed audio file- Returns:
- the clip this algorithm actually requires
-
createEditor
public TaskEditor<AnalyzeKey> createEditor()
Description copied from class:TaskBy default instantiates a class with the namethis.getClass().getName() + "Editor". If that does not work (because the editor class does not exist), anEmptyTaskEditoris created. To create a meaningful editor for a configurable task, you must override this method.- Overrides:
createEditorin classTask- Returns:
- task editor for this task.
-
processBefore
public void processBefore(Task task)
Description copied from class:TaskProcess online results with this task before other tasks are invoked. Override this method, if you want to take online resources into account. Note that you will also need to setTask.setUseOnlineResources(boolean)totrue, if you want this method to be called at all.To avoid having this task processed again by
Task.runBefore(Task), you must callTask.setSucceeded(boolean)with the argumenttrue. If, for some reason, you could not take care of this task with just the available online resources, you must callTask.setSucceeded(boolean)with the argumentfalseThis method is executed before sub tasks are run. When this method is called, the methods
Task.getSong()andTask.getReferenceSong()will return meaningful results.- Specified by:
processBeforein interfaceTaskProcessListener- Overrides:
processBeforein classTask- Parameters:
task- task
-
runBefore
public void runBefore(Task task) throws AnalysisException
Description copied from class:TaskIs executed before sub tasks are run.- Specified by:
runBeforein interfaceTaskRunListener- Overrides:
runBeforein classTask- Parameters:
task- task- Throws:
AnalysisException- if this analysis step fails
-
skip
public boolean skip()
Description copied from class:TaskIndicates, 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.
-
createDeepCopy
public AnalyzeKey createDeepCopy()
This method creates a copy of the Task and its subtasks.- Overrides:
createDeepCopyin classTask- Returns:
- copy
-
getClassName
public static String getClassName(KeyTextRenderer renderer)
Ruby and Python object's classnames are not the same after the JVM exists. Therefore we have to get their type's name, which is persistent.- Parameters:
renderer- renderer- Returns:
- classname
-
-