com.groovemanager.sampled.nondestructive
Class InsertElement

java.lang.Object
  extended by com.groovemanager.sampled.nondestructive.AbstractElement
      extended by com.groovemanager.sampled.nondestructive.InsertElement
All Implemented Interfaces:
CutListElement

public class InsertElement
extends AbstractElement

A CutListElement that inserts another CutListSource at a specified position. Can be used for paste operations

Author:
Manu Robledo

Field Summary
private  int position
          The position in sample frames where to insert the source
private  CutListSource source
          The source to insert
 
Constructor Summary
InsertElement(CutListSource source, int position)
          Create a new InsertElement
 
Method Summary
 CutListElement duplicate()
          Create a new CutListElement out of this one that is independent of any changes made to this one.
 CutListSource getResult(CutListSource source)
          Create a new CutListSource out of the given source including this CutListElementīs modification.
 void replaceFile(java.io.File from, java.io.File to)
          Replace all references to the given source file inside this CutListElement with references to the given target file.
 boolean usesFile(java.io.File f)
          Ask this CutListElement whether it relies on the contents of the given file.
 
Methods inherited from class com.groovemanager.sampled.nondestructive.AbstractElement
addModificationListener, getName, notifyListeners, removeModificationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

position

private int position
The position in sample frames where to insert the source


source

private CutListSource source
The source to insert

Constructor Detail

InsertElement

public InsertElement(CutListSource source,
                     int position)
Create a new InsertElement

Parameters:
source - The source to insert
position - The position where to insert the source
Method Detail

duplicate

public CutListElement duplicate()
Description copied from interface: CutListElement
Create a new CutListElement out of this one that is independent of any changes made to this one.

Returns:
An independent copy of this CutListElement
See Also:
CutListElement.duplicate()

getResult

public CutListSource getResult(CutListSource source)
Description copied from interface: CutListElement
Create a new CutListSource out of the given source including this CutListElementīs modification.

Parameters:
source - The CutListSource to modify
Returns:
A modified CutListSource
See Also:
CutListElement.getResult(com.groovemanager.sampled.nondestructive.CutListSource)

replaceFile

public void replaceFile(java.io.File from,
                        java.io.File to)
Description copied from interface: CutListElement
Replace all references to the given source file inside this CutListElement with references to the given target file. This may be because the source file is about to change and to avoid inconsistencies. If the given source file is not used by this CutListElement, the call can be ignored.

Parameters:
from - The source file to replace
to - The target file to replace with
See Also:
CutListElement.replaceFile(java.io.File, java.io.File)

usesFile

public boolean usesFile(java.io.File f)
Description copied from interface: CutListElement
Ask this CutListElement whether it relies on the contents of the given file. This is needed, if a file should be overwritten and it must be checked that this doesnīt cause any inconsistencies

Parameters:
f - The file to ask for
Returns:
true, if a change to the given fileīs content would also mean a change to this element, false otherwise
See Also:
CutListElement.usesFile(java.io.File)