Klasse SidIdV2


public final class SidIdV2 extends SidIdBase
Scan tune files to find out the player ID. A configuration file is used with patterns of well-known players.
Autor:
Ken Händel
  • Felddetails

    • SID_ID_PKG

      private static final String SID_ID_PKG
      Package of the internal configuration file.
      Siehe auch:
    • FNAME

      private static final String FNAME
      Name of the configuration file.
      Siehe auch:
    • HEX_RADIX

      private static final int HEX_RADIX
      Integer base for hexadecimals.
      Siehe auch:
    • MAX_KEY_LENGTH

      private static final int MAX_KEY_LENGTH
      Maximum pattern length.
      Siehe auch:
    • sections

      private ArrayList<SidIdV2.PlayerSection> sections
      Configuration sections.
    • multiScan

      private boolean multiScan
      Scan multiple times.
  • Konstruktordetails

    • SidIdV2

      public SidIdV2()
      Constructor. Enable use of BNDM algorithm.
  • Methodendetails

    • setMultiScan

      public void setMultiScan(boolean m)
      Scan file for multiple player IDs.
      Parameter:
      m - on/off multi scan
    • identify

      public ArrayList<String> identify(String filename) throws IOException
      Search player ID of a tune file.
      Parameter:
      filename - file name
      Gibt zurück:
      list of players (depending of multiScan one or more entries)
      Löst aus:
      IOException - read error
    • identify

      public ArrayList<String> identify(byte[] prg)
      Search player ID of a program.
      Parameter:
      prg - program to identify
      Gibt zurück:
      list of players (depending of multiScan one or more entries)
    • matchOneOf

      private boolean matchOneOf(ArrayList<ArrayList<SidIdV2.Pattern>> orList, byte[] prg)
      Match one of the patterns in the list.
      Parameter:
      orList - the list of patterns to match
      prg - the byte array containing the text
      Gibt zurück:
      true - one of the patterns have matched, false otherwise
    • matchAllOf

      private boolean matchAllOf(ArrayList<SidIdV2.Pattern> andList, byte[] prg)
      Match all patterns in the list.
      Parameter:
      andList - the list of patterns to match
      prg - the byte array containing the text
      Gibt zurück:
      true - all patterns have matched, false otherwise
    • readconfig

      public void readconfig() throws NumberFormatException, IOException
      Read configuration file and configure the SID-ID class.
      Löst aus:
      IOException - I/O error
      NumberFormatException
    • readconfig

      public void readconfig(byte[] sidIdCfgBin) throws NumberFormatException, IOException
      Read configuration file and configure the SID-ID class.
      Löst aus:
      IOException
      NumberFormatException
    • andBytes

      private void andBytes(SidIdV2.PlayerSection section, ArrayList<Byte> byteList)
      Add all bytes of the byte list to the last element of the orList.
      Parameter:
      section - the current section
      byteList - the bytes to add
    • andBytesMaxPtnLength

      private void andBytesMaxPtnLength(ArrayList<SidIdV2.Pattern> ptnList, ArrayList<Byte> byteList, int byteListOffset, int byteCount, boolean isSubPattern)
      Add a pattern to the pattern search list.
      Parameter:
      ptnList - the pattern list to add a new pattern for
      byteList - the list of bytes to add
      byteListOffset - Current offset of the bytes to add
      byteCount - length of bytes to add (will become the search pattern length, and must not exceed the maximum pattern length)
      isSubPattern - is this a splitted sub-pattern?