Class Source

java.lang.Object
org.audiveris.proxymusic.util.Source

public class Source extends Object
Class Source precisely describes the source of a ScorePartwise.

Within a given input file (or uri), perhaps composed of several sheet images, the relevant sheets are listed, each with the systems processed for the ScorePartwise instance at hand.

A sheet with no system processed (for example because it is made of text only), could explicitly appear but with an empty sequence of system numbers (this is recommended), or the sheet could not appear at all in this source structure.

In the following example, the ScorePartwise spans the first 3 sheets of the input file, with sheet #2 being "empty", and only the first system in sheet #3. Another ScorePartwise instance, typically representing a following movement, could start with the same sheet #3, but from system 2.

In MusicXML, such Source data is encoded using the miscellaneous element.
Using file:

 <miscellaneous>
     <miscellaneous-field name="source-file">D:\soft\scores\morphology\recordare\MozartTrio.png</miscellaneous-field>
     <miscellaneous-field name="source-offset">4</miscellaneous-field>
     <miscellaneous-field name="source-sheet-1">1 2</miscellaneous-field>
     <miscellaneous-field name="source-sheet-2"></miscellaneous-field>
     <miscellaneous-field name="source-sheet-3">1</miscellaneous-field>
 </miscellaneous>
 

Using uri:

 <miscellaneous>
     <miscellaneous-field name="source-uri">file:///MozartTrio.png</miscellaneous-field>
     <miscellaneous-field name="source-offset">4</miscellaneous-field>
     <miscellaneous-field name="source-sheet-1">1 2</miscellaneous-field>
     <miscellaneous-field name="source-sheet-2"></miscellaneous-field>
     <miscellaneous-field name="source-sheet-3">1</miscellaneous-field>
 </miscellaneous>
 
Author:
Hervé Bitteur
  • Constructor Details

    • Source

      public Source()
  • Method Details

    • decode

      public static Source decode(ScorePartwise scorePartwise)
    • encode

      public void encode(ScorePartwise scorePartwise)
    • getFile

      public String getFile()
      Returns:
      the file
    • getOffset

      public int getOffset()
      Returns:
      the offset
    • getSheets

      public List<Source.SheetSystems> getSheets()
      Returns:
      the sheetSystems
    • getUri

      public URI getUri()
      Returns:
      the uri
    • setFile

      public void setFile(String file)
      Parameters:
      file - the file to set
    • setOffset

      public void setOffset(int offset)
      Parameters:
      offset - the offset to set
    • setUri

      public void setUri(URI uri)
      Parameters:
      uri - the uri to set
    • toString

      public String toString()
      Overrides:
      toString in class Object