Package org.jjazz.ss_editor.api
Class SongPartCopyBuffer
java.lang.Object
org.jjazz.ss_editor.api.SongPartCopyBuffer
Singleton class to manage SongParts copy/cut/paste operations.
SongParts must be contiguous.
-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()get(SongStructure targetSgs, int targetStartBarIndex) Return a copy of the SongParts adapted to the specified targetSgs.static SongPartCopyBufferintgetSize()The SongStructure from which the songparts have been put in the buffer.intintbooleanisEmpty()voidPut a copy of each SongPart (and a copy of its parent section) in the buffer.void
-
Method Details
-
getInstance
-
put
Put a copy of each SongPart (and a copy of its parent section) in the buffer.SongParts must be contiguous.
- Parameters:
spts-
-
clear
public void clear() -
getSize
public int getSize()- Returns:
- int The nb of RhyhmParts in the buffer.
-
getSptMinStartBarIndex
public int getSptMinStartBarIndex() -
getSptMaxStartBarIndex
public int getSptMaxStartBarIndex() -
isEmpty
public boolean isEmpty() -
getSourceSongStructure
The SongStructure from which the songparts have been put in the buffer.- Returns:
- Can be null if SongPartCopyBuffer is empty.
-
get
Return a copy of the SongParts adapted to the specified targetSgs.The SongParts startBarIndexes are adjusted to start at targetStartBarIndex.
nbBars is also adjusted if pasting in a different targetSgs.
SongParts for which we could not find a matching parent section are discarded.- Parameters:
targetSgs- The container of the returned SongParts. If null songparts container is unchanged.targetStartBarIndex- The first returned SongPart will have startBarIndex=targetStartBarIndex.- Returns:
-
addChangeListener
-
removeChangeListener
-