|
Opus+ Version 1.0 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopusplus.core.lilypond.LilypondFileHandle
public class LilypondFileHandle
The file naming scheme is encapsulated in this class. All Lilypond files generated by Opus+ use this format:
NAME_v<000#>[_for_[_]][_bars_<#>_to_<#>].ly
NAME is the name of the composition.
_ is a sub-optional capital letter distinguishing multiple occurrences of the same instrument name within the composition, for example duo written for two identical instruments.
_bars_<#>_to_<#> is also optional and is used when large compositions are broken up into smaller sections to enable Lilypond to process the resulting files.
Some examples. Suppose we have a composition called 'WholeLottaLove'. Single Instrument files will have the long instrument name appended so the 2nd version of the guitar part for this would be WholeLottaLove_v0002_for_Electric_Guitar.ly and for the bass WholeLottaLove_v0002_for_Electric_Bass_Pick.ly As this shows the long MIDI instrument name is used.
If there is a guitar duo then these will be numbered again i.e. WholeLottaLove_v0002_for_Electric_Guitar_A.ly and WholeLottaLove_v0002_for_Electric_Guitar_B.ly.
Bar sections of large compositions are similarly labelled with the bar ranges; to wit the second version of our song with 100 bars in each of two files would be WholeLottaLove_v0002_bars_1_to_100.ly, WholeLottaLove_v0002_bars_101_to_200.ly.
When this splitting into sections is combined with scores for single instruments we have for example: WholeLottaLove_v0002_for_Electric_Guitar_bars_1_to_100.ly and WholeLottaLove_v0002_for_Electric_Bass_Pick_bars_101_to_200.ly.
And finally in the extended long-play version of our song with a steaming guitar double act the names would be: WholeLottaLove_v0002_for_Electric_Guitar_A_bars_1_to_100.ly and WholeLottaLove_v0002_for_Electric_Guitar_B_bars_1_to_100.ly etc.
In the unlikely event that there are more than 26 parts for the same instrument, the instrument distinguishing character is doubled: AA, AB, AC .... AZ, BA, BB, BC etc.
Note LilypondFileHandle objects do not deal with file PATH information - only the NAMES of Lilypond files.
Constructor Summary | |
---|---|
LilypondFileHandle(java.io.File lyFile) Ctor that parses the details of the Lilypond file name out of the passed java.io.File object. |
|
LilypondFileHandle(java.lang.String lyFileName) Ctor that parses the details of the Lilypond file name out of the passed string. |
Method Summary | |
---|---|
java.lang.Object |
clone() Bit-wise implementation of the clone method. |
int |
getBarRangeEnd() For when large compositions are broken down into separate Lilypond files this returns the end of the bar range held in this file. |
int |
getBarRangeStart() For when large compositions are broken down into separate Lilypond files this returns the start of the bar range held in this file. |
java.lang.String |
getInstrumentName() Returns the name of the instrument playing this music. |
java.lang.String |
getInstrumentSuffix() Returns the instrument suffix string which distinguishes different instances of the same instrument playing in the same composition. |
java.lang.String |
getRootName() Returns the root name of the Lilypond file. |
int |
getStaveNumber() Returns the stave number for this instrument or a negative number if not set. |
static java.lang.String |
getSuffixString(int index) Returns the numbered suffix string. |
int |
getVersion() Returns the version number of this Lilypond file |
int |
getWidth() Returns the number of zeros used as padding for the version number in the Lilypond file name. |
boolean |
isMetronomeSuppressed() If true, then this score will NOT have a metronome track output to the Lilypond file. |
boolean |
isValid() Returns true if the name of the file is well-formed. |
java.lang.Boolean |
probeFile() Returns true if a file by this name exists in the current working directory as specified in the SysParameters, otherwise false. |
int |
probeForNextVersion() This method examines the file system and searches for all files with the same root name, and calculates the next version number to use such that no clash with existing files will occur. |
void |
setBarRange(int barRangeStart, int barRangeEnd) For when large compositions are broken down into separate Lilypond files this sets the start of the bar range held in this file. |
void |
setInstrumentName(DrumKit kit) Specifies the name of the instrument playing this music. |
void |
setInstrumentName(DrumKitId kitId) Specifies the name of the instrument playing this music. |
void |
setInstrumentName(Instrument inst) Specifies the name of the instrument playing this music. |
void |
setInstrumentName(InstrumentId instId) Specifies the type of instrument playing this music. |
void |
setInstrumentName(java.lang.String instrument) Specifies the name of the instrument playing this music. |
void |
setInstrumentSuffix(java.lang.String instrumentSuffix) Sets the instrument suffix string which distinguishes different instances of the same instrument playing in the same composition. |
void |
setMetronomeSuppressed(boolean suppressed) If true, then this score will NOT have a metronome track output to the Lilypond file. |
void |
setRootName(java.lang.String rootName) Sets the root name of the Lilypond file. |
void |
setStaveNumber(int staveNumber) Sets the stave number for this instrument. |
void |
setVersion(int version) Sets the version of this Lilypond file. |
void |
setWidth(int zeros) Sets the number of zeros used as padding for the version number in the Lilypond file name. |
java.io.File |
toFile() Returns a java.io.File object representing this Lilypond file according to the current state of this object. |
java.lang.String |
toString() Returns the name of the Lilypond file as a string according to the current state of this object. |
void |
unsetBarRange() Turns off the bar range information for this file. |
void |
unsetInstrumentName() Turns off the instrument naming on this file. |
void |
unsetInstrumentSuffix() Turns off the instrument suffix on this file. |
void |
unsetStaveNumber() Unsets the stave number. |
void |
unsetVersion() Turns off the versioning on this file |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LilypondFileHandle(java.lang.String lyFileName)
public LilypondFileHandle(java.io.File lyFile)
Method Detail |
---|
public boolean isValid()
public java.lang.String toString()
toString
in class java.lang.Object
public java.io.File toFile()
public java.lang.Boolean probeFile()
public int probeForNextVersion()
public final java.lang.String getRootName()
public final void setRootName(java.lang.String rootName)
public final int getVersion()
public final void setVersion(int version)
public final void unsetVersion()
public final java.lang.String getInstrumentName()
public final void setInstrumentName(java.lang.String instrument)
public final void setInstrumentName(Instrument inst)
public final void setInstrumentName(InstrumentId instId)
public final void setInstrumentName(DrumKit kit)
public final void setInstrumentName(DrumKitId kitId)
public void unsetInstrumentName()
public final java.lang.String getInstrumentSuffix()
public final void setInstrumentSuffix(java.lang.String instrumentSuffix)
public void unsetInstrumentSuffix()
public final int getBarRangeStart()
public final int getBarRangeEnd()
public final void setBarRange(int barRangeStart, int barRangeEnd)
public void unsetBarRange()
public final int getWidth()
public final void setWidth(int zeros)
public final int getStaveNumber()
public final void setStaveNumber(int staveNumber)
public final void unsetStaveNumber()
public static java.lang.String getSuffixString(int index)
public final boolean isMetronomeSuppressed()
public final void setMetronomeSuppressed(boolean suppressed)
public java.lang.Object clone()
clone
in class java.lang.Object
|
Opus+ Version 1.0 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |