package turgen.plugin.standard;

import turgen.playlist.AbstractPlayListItem;

/**Playlist item for PL Turbo ROM*/
public class StandardPlaylistItem extends AbstractPlayListItem {

    public String fname=null;
    public int inputType=0;
    public static final int IT_MONOLITHIC_BINARY=0;
    public static final int IT_BINARY=1;
    public static final int IT_DATA=2;
    public static final int IT_BASIC_TOKENIZED=3;
    public static final int IT_BASIC_SOURCE=4;
    
    private static final String[] methodStrings = {"[mB]","[B]","[D]","[BAS]","[BASsrc]"};
    public int[] silenceList=null;
    public boolean shortIRG;

    /** Create new instance*/
    public StandardPlaylistItem(String inF,String outF,String fname,int inputType,int[] silenceList,boolean shortIRG) {
        this.inFile=inF;
        this.outFile=outF;
        this.fname=fname;
        this.inputType=inputType;
        this.silenceList=silenceList;
        this.shortIRG=shortIRG;
    }

    /**Get string representation*/
    public String toString() {
        if (inputType==IT_BINARY) return methodStrings[inputType]+" "+fname;
        return methodStrings[inputType];
    }

    /** Create blank instance*/
    public StandardPlaylistItem() {

    }

    /** Validate item
     *@ return Playlist item is Valid
     */
     
    public boolean validate() {
        if (this.inFile==null) return false;
        if (this.outFile==null) this.outFile="";
        if (this.fname==null) this.fname="NONAME";
        if (this.pulses==null) return false;
        return true;
    }

}
