IImportedApi.java

package client.teavm.common;

import libsidplay.components.printer.IPaper.Outputs;

import java.nio.ByteBuffer;

/**
 * Imports from JavaScript
 */
public interface IImportedApi {

    //
    // SharedArrayBuffer version
    //

    default void initControlBuffer() {
    }

    //
    // Buffers and callbacks
    //

    default boolean supportsWarp() {
        return false;
    }

    default void processWarp(boolean enabled) {
    }

    default void processInspection(String json) {
    }

    ByteBuffer initSampleBuffer(int chunkFrames, int channels);

    ByteBuffer initFrameBuffer(int maxWidth, int maxHeight);

    ByteBuffer initWhatsSidBuffer(int wavLength);

    ByteBuffer initOscBatchBuffer(int length, int slot);

    void processSamples(long absTime, ByteBuffer sampleBuffer, float[] lookupTable);

    void prepareFrame(ByteBuffer pixels);

    void processFrame(long absTime, ByteBuffer pixels);

    void whatsSid(ByteBuffer whatsSidBuffer);

    int prepareOscBatch();

    void processOscBatch(ByteBuffer batch, int slot);

    void processAudioTiming(ByteBuffer timing);

    void processOscSources(int oplType, int generation);

    void processSidWrite(int sidNum, long absTime, int relTime, int addr, int value);

    void processTimerEnd(double end);

    void processPrinter(Outputs output);

    void processGeoRAMImage(byte[] contents);

}