Emulation.java

package libsidplay.common;

import libsidplay.config.IEmulationSection;

public enum Emulation {
    /**
     * Use default emulation
     */
    DEFAULT,
    /**
     * Dag Lem's resid 1.0 beta
     */
    RESID,
    /**
     * Antti S. Lankila's resid-fp
     */
    RESIDFP,
    /**
     * Leandro Nini's modern ReSIDfp digital core with the analogue models.
     */
    RESIDFP_CIRCUIT;

    /**
     * Detect SID emulation of specified SID number in the following order:
     * <OL>
     * <LI>SID emulation forced by user configuration
     * <LI>default SID emulation
     * </OL>
     *
     * @return SID emulation to be used for SID number 0..MAX_SIDS-1
     */
    public static Emulation getEmulation(IEmulationSection emulationSection, int sidNum) {
        Emulation forcedEmulation = emulationSection.getForcedEmulation(sidNum);
        Emulation defaultEmulation = emulationSection.getDefaultEmulation();

        return forcedEmulation != DEFAULT ? forcedEmulation : defaultEmulation;
    }
}