Package client.teavm
Klasse ImportedApi
java.lang.Object
client.teavm.ImportedApi
- Alle implementierten Schnittstellen:
IImportedApi,IImportEventParameters
TeaVM JavaScript Interop (JSO)-based implementation of
IImportedApi.
This class provides a standard bridge between the TeaVM Web Worker and the browser main thread using TeaVM's
@Import and @JSBody mechanisms. It is the default implementation for general browser environments.
Data Conversion
- Audio samples: Converts 16-bit signed PCM samples (shorts) to 32-bit floats in the range of -1.0 to 1.0. A lookup table is used for high performance.
- Video frame: Transfers RGBA pixel data as a byte array (4 bytes per pixel).
- Oscilloscope data: Forwards waveform and envelope data to JavaScript for visualization.
Synchronization
Unlike ImportedApiSAB, which uses shared memory and
atomic operations, this implementation relies on TeaVM's standard JavaScript
interop, where data is typically passed via callbacks or message passing
(depending on how the JavaScript side is implemented).
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprotected FloatBufferprotected FloatBufferVon Schnittstelle geerbte Felder client.teavm.common.parameter.event.IImportEventParameters
ABS_TIME, ADDR, CHIP_NUM, CONTROL_BUFFER, END, ENV_0, ENV_0_TXT, ENV_1, ENV_1_TXT, ENV_2, ENV_2_TXT, EVENT_FRAME, EVENT_FRAME_SAB, EVENT_INIT_CONTROL_BUFFER_SAB, EVENT_INIT_FRAME_BUFFER_SAB, EVENT_INIT_GAUGE_BUFFER_SAB, EVENT_INIT_SAMPLE_BUFFER_SAB, EVENT_INIT_WHATSSID_SAB, EVENT_OSC, EVENT_OSC_SAB, EVENT_PRINTER, EVENT_SAMPLES, EVENT_SAMPLES_SAB, EVENT_SID_WRITE, EVENT_TIMER_END, EVENT_WHATSSID, EVENT_WHATSSID_SAB, FIL, FIL_TXT, FRAME_BUFFER, FRQ_0, FRQ_0_TXT, FRQ_1, FRQ_1_TXT, FRQ_2, FRQ_2_TXT, GAUGE_BUFFER, IMAGE, LEFT, LENGTH, OUTPUT, PIXELS, REL_TIME, RES, RES_TXT, RIGHT, SAMPLE_BUFFER, SID_NUM, TYPE, VALUE, VOL, VOL_TXT, WAV, WAV_0, WAV_0_TXT, WAV_1, WAV_1_TXT, WAV_2, WAV_2_TXT, WHATSSID_BUFFER -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibunginitFrameBuffer(int maxWidth, int maxHeight) initGaugeBuffer(String type, int chipNum, int pathLength) initSampleBuffer(int chunkFrames, int channels) initWhatsSidBuffer(int wavLength) voidprocessFrame(long absTime, ByteBuffer pixels) static voidprocessFrameJS(long absTime, byte[] pixels, int length) voidprocessOsc(int sidNum, long absTime, ByteBuffer wav0, String wav0Txt, ByteBuffer wav1, String wav1Txt, ByteBuffer wav2, String wav2Txt, ByteBuffer env0, String env0Txt, ByteBuffer env1, String env1Txt, ByteBuffer env2, String env2Txt, ByteBuffer frq0, String frq0Txt, ByteBuffer frq1, String frq1Txt, ByteBuffer frq2, String frq2Txt, ByteBuffer vol, String volTxt, ByteBuffer res, String resTxt, ByteBuffer fil, String filTxt) static voidprocessOscJS(int sidNum, long absTime, byte[] wav0, String wav0Txt, byte[] wav1, String wav1Txt, byte[] wav2, String wav2Txt, byte[] env0, String env0Txt, byte[] env1, String env1Txt, byte[] env2, String env2Txt, byte[] frq0, String frq0Txt, byte[] frq1, String frq1Txt, byte[] frq2, String frq2Txt, byte[] vol, String volTxt, byte[] res, String resTxt, byte[] fil, String filTxt) voidprocessPrinter(IPaper.Outputs output) static voidprocessPrinterJS(String output) voidprocessSamples(long absTime, ByteBuffer sampleBuffer, float[] lookupTable) static voidprocessSamplesJS(long absTime, float[] left, float[] right, int length) voidprocessSidWrite(int sidNum, long absTime, int relTime, int addr, int value) static voidprocessSidWriteJS(int sidNum, long absTime, int relTime, int addr, int value) voidprocessTimerEnd(double end) static voidprocessTimerEndJS(double end) voidwhatsSid(ByteBuffer whatsSidBuffer) static voidwhatsSidJS(byte[] wav, int length) Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden client.teavm.common.IImportedApi
initControlBuffer
-
Felddetails
-
MODULE_NAME
- Siehe auch:
-
CALLBACK_PROCESS_SAMPLES
- Siehe auch:
-
CALLBACK_PROCESS_FRAME
- Siehe auch:
-
CALLBACK_PROCESS_OSC
- Siehe auch:
-
CALLBACK_WHATSSID
- Siehe auch:
-
CALLBACK_PROCESS_SID_WRITE
- Siehe auch:
-
CALLBACK_TIMER_END
- Siehe auch:
-
CALLBACK_PROCESS_PRINTER
- Siehe auch:
-
resultL
-
resultR
-
-
Konstruktordetails
-
ImportedApi
public ImportedApi()
-
-
Methodendetails
-
initSampleBuffer
- Angegeben von:
initSampleBufferin SchnittstelleIImportedApi
-
initFrameBuffer
- Angegeben von:
initFrameBufferin SchnittstelleIImportedApi
-
initGaugeBuffer
- Angegeben von:
initGaugeBufferin SchnittstelleIImportedApi
-
initWhatsSidBuffer
- Angegeben von:
initWhatsSidBufferin SchnittstelleIImportedApi
-
processSamples
- Angegeben von:
processSamplesin SchnittstelleIImportedApi
-
processFrame
- Angegeben von:
processFramein SchnittstelleIImportedApi
-
processOsc
public void processOsc(int sidNum, long absTime, ByteBuffer wav0, String wav0Txt, ByteBuffer wav1, String wav1Txt, ByteBuffer wav2, String wav2Txt, ByteBuffer env0, String env0Txt, ByteBuffer env1, String env1Txt, ByteBuffer env2, String env2Txt, ByteBuffer frq0, String frq0Txt, ByteBuffer frq1, String frq1Txt, ByteBuffer frq2, String frq2Txt, ByteBuffer vol, String volTxt, ByteBuffer res, String resTxt, ByteBuffer fil, String filTxt) - Angegeben von:
processOscin SchnittstelleIImportedApi
-
whatsSid
- Angegeben von:
whatsSidin SchnittstelleIImportedApi
-
processSidWrite
public void processSidWrite(int sidNum, long absTime, int relTime, int addr, int value) - Angegeben von:
processSidWritein SchnittstelleIImportedApi
-
processTimerEnd
public void processTimerEnd(double end) - Angegeben von:
processTimerEndin SchnittstelleIImportedApi
-
processPrinter
- Angegeben von:
processPrinterin SchnittstelleIImportedApi
-
processSamplesJS
public static void processSamplesJS(long absTime, float[] left, float[] right, int length) -
processFrameJS
public static void processFrameJS(long absTime, byte[] pixels, int length) -
processOscJS
public static void processOscJS(int sidNum, long absTime, byte[] wav0, String wav0Txt, byte[] wav1, String wav1Txt, byte[] wav2, String wav2Txt, byte[] env0, String env0Txt, byte[] env1, String env1Txt, byte[] env2, String env2Txt, byte[] frq0, String frq0Txt, byte[] frq1, String frq1Txt, byte[] frq2, String frq2Txt, byte[] vol, String volTxt, byte[] res, String resTxt, byte[] fil, String filTxt) -
whatsSidJS
public static void whatsSidJS(byte[] wav, int length) -
processSidWriteJS
public static void processSidWriteJS(int sidNum, long absTime, int relTime, int addr, int value) -
processTimerEndJS
public static void processTimerEndJS(double end) -
processPrinterJS
-