public class NbsSong extends Song
| Constructor and Description |
|---|
NbsSong() |
NbsSong(java.lang.String fileName) |
copyGeneralData, getAuthor, getAuthorOr, getDescription, getDescriptionOr, getFileName, getFileNameOr, getFormat, getHumanReadableLength, getLengthInMilliseconds, getLengthInSeconds, getNotes, getOriginalAuthor, getOriginalAuthorOr, getTempoEvents, getTitle, getTitleOr, getTitleOrFileName, getTitleOrFileNameOr, millisecondsToTick, setAuthor, setDescription, setOriginalAuthor, setTitle, tickToMillisecondspublic short getLength()
public NbsSong setLength(short length)
length - The length of the song, measured in ticks. Divide this by the tempo to get the length of the song in seconds.public byte getVersion()
public NbsSong setVersion(byte version)
version - The version of the NBS format.public int getVanillaInstrumentCount()
public NbsSong setVanillaInstrumentCount(int vanillaInstrumentCount)
vanillaInstrumentCount - Amount of default instruments when the song was saved. This is needed to determine at what index custom instruments start.public short getLayerCount()
public NbsSong setLayerCount(short layerCount)
layerCount - The last layer with at least one note block in it, or the last layer that has had its name, volume or stereo changed.public short getTempo()
public NbsSong setTempo(short tempo)
tempo - The tempo of the song multiplied by 100 (for example, 1225 instead of 12.25). Measured in ticks per second.public boolean isAutoSave()
public NbsSong setAutoSave(boolean autoSave)
autoSave - Whether auto-saving has been enabled (0 or 1). As of NBS version 4 this value is still saved to the file, but no longer used in the program.public byte getAutoSaveInterval()
public NbsSong setAutoSaveInterval(byte autoSaveInterval)
autoSaveInterval - The amount of minutes between each auto-save (if it has been enabled) (1-60). As of NBS version 4 this value is still saved to the file, but no longer used in the program.public byte getTimeSignature()
public NbsSong setTimeSignature(byte timeSignature)
timeSignature - The time signature of the song. If this is 3, then the signature is 3/4. Default is 4. This value ranges from 2-8.public int getMinutesSpent()
public NbsSong setMinutesSpent(int minutesSpent)
minutesSpent - Amount of minutes spent on the project.public int getLeftClicks()
public NbsSong setLeftClicks(int leftClicks)
leftClicks - Amount of times the user has left-clicked.public int getRightClicks()
public NbsSong setRightClicks(int rightClicks)
rightClicks - Amount of times the user has right-clicked.public int getNoteBlocksAdded()
public NbsSong setNoteBlocksAdded(int noteBlocksAdded)
noteBlocksAdded - Amount of times the user has added a note block.public int getNoteBlocksRemoved()
public NbsSong setNoteBlocksRemoved(int noteBlocksRemoved)
noteBlocksRemoved - Amount of times the user has removed a note block.public java.lang.String getSourceFileName()
public java.lang.String getSourceFileNameOr(java.lang.String fallback)
fallback - The fallback value if the source file name is not set.public NbsSong setSourceFileName(java.lang.String sourceFileName)
sourceFileName - If the song has been imported from a .mid or .schematic file, that file name is stored here (only the name of the file, not the path).public boolean isLoop()
public NbsSong setLoop(boolean loop)
loop - Whether looping is on or off.public byte getMaxLoopCount()
public NbsSong setMaxLoopCount(byte maxLoopCount)
maxLoopCount - 0 = infinite. Other values mean the amount of times the song loops.public short getLoopStartTick()
public NbsSong setLoopStartTick(short loopStartTick)
loopStartTick - Determines which part of the song (in ticks) it loops back to.public java.util.Map<java.lang.Integer,NbsLayer> getLayers()
public java.util.List<NbsCustomInstrument> getCustomInstruments()