Klasse ExportedApi

java.lang.Object
client.teavm.common.ExportedApi
Alle implementierten Schnittstellen:
ICompileTime, IExportedApi, ILogger

public final class ExportedApi extends Object implements IExportedApi, ILogger
The ExportedApi class provides the external API that allows interaction with the C64 SID chip emulator and audio playback. It acts as a bridge between the client-side application and the emulator, handling the loading, configuration, and playback of SID tunes, while also managing the emulation of hardware components like the CPU, VIC, and SID chips.

Key responsibilities of this class include:

  • Initializing and configuring the emulator environment, including loading SID tunes, setting up the audio driver, and managing hardware components like C64, SID, and VIC.
  • Handling playback parameters such as song selection, loop settings, and play length.
  • Providing a mechanism for interacting with external modules, like the sound expander cartridge or loading custom cartridge files.
  • Exposing methods for event scheduling, audio playback, and emulation control.
  • Validating and logging critical operations to ensure the emulator runs smoothly.

This class interfaces directly with lower-level components like the event scheduler, SID chip emulator, and audio driver to ensure that the emulator works efficiently. It also supports various features such as detecting PSID64 files, interacting with a playlist, and supporting integration with external APIs.

Usage Example:

     // Initialize the ExportedApi with necessary parameters
     ExportedApi exportedApi = new ExportedApi(importedApiInstance, args);

     // Open a SID tune file for playback
     exportedApi.open(sidContents, sidContentsName, songIndex, nthFrame, addSidListener, cartContents, cartContentsName, command, songLength, sfxSoundExpander, sfxSoundExpanderType);

     // Trigger a clock tick (usually done on each frame for the emulator)
     exportedApi.clock();
 

The ExportedApi class also provides methods for customizing the behavior of the emulator, such as adjusting the default play length and enabling or disabling looped playback of SID tunes.

Methods are available for controlling playback, managing hardware emulation, and integrating with external modules such as sound expanders or cartridge files.

Siehe auch: