LaunchBoxContributors
On this page

EmulatorPlugin13.15

Class in Unbroken.LaunchBox.Plugins

Obsolete since 14.1

EmulatorPlugin is the schema version 1 compatibility base. Schema version 2 emulator integrations should implement IEmulatorIntegration and only the optional capability interfaces they support.

C#
public abstract class EmulatorPlugin
Provides the schema version 1 base class for emulator integrations.

Remarks

Schema version 2 emulator integrations implement IEmulatorIntegration and only the optional capability interfaces they support.

Constructors

EmulatorPlugin

C#
protected EmulatorPlugin()

A summary has not been written for this member.

Properties

  • EmulatorNameDisplay name of the emulator this controller is for

EmulatorName

C#
public abstract string EmulatorName { get; }
Display name of the emulator this controller is for

Methods

AddSaveFile 13.16

C#
public virtual AddSaveResponse AddSaveFile(AddSaveArgs args)
Adds a save to the emulator through the schema version 1 compatibility API.
args
The save and optional overwrite decision callback.

Returns

The save result. The default implementation reports that the feature is unsupported.

FireEmulatorImportAction

C#
public virtual PluginResponse FireEmulatorImportAction(ImportActionArgs args)
Runs logic for user selected import action
args
Arguments containing details on which action to fire and against the list of imported games

Returns

The response in whether the action was successfully ran

GetApplicableEmulators

C#
public abstract IEnumerable<IEmulator> GetApplicableEmulators(
    IEnumerable<IEmulator> emulators
)
Determine which emulators can be associated to this controller
emulators
The users existing emulators

Returns

A collection of emulators that this controller can operate against

GetBiosFilesForPlatform(string)

C#
public virtual IEnumerable<EmulatorBiosFile> GetBiosFilesForPlatform(
    string platform
)
Returns information on what BIOS files can or should be used with this emulator/platform combination
platform
The platform for which the BIOS file would be used for

Returns

A collection of BIOS files that are associated to this emulator/platform combination

GetBiosFilesForPlatform(string, string, string)

C#
public virtual IEnumerable<EmulatorBiosFile> GetBiosFilesForPlatform(
    string emulatorApplicationPath,
    string platform,
    string commandLine
)
Returns information on what BIOS files can or should be used with this emulator/platform combination
emulatorApplicationPath
The application path of the emulator asking for BIOS information
platform
The platform for which the BIOS file would be used for
commandLine
The current platform specific commandline being used by the emulator

Returns

The BIOS file descriptions for the emulator and platform.

GetCompanionSaveFiles 13.27

C#
public virtual IReadOnlyList<string> GetCompanionSaveFiles(
    string primaryFilePath
)
Returns companion save files that should be associated with the primary save file.
primaryFilePath
The primary save file path.

Returns

A list of companion save file paths.

GetCurrentVersion Changed 13.27

C#
public abstract string? GetCurrentVersion(string applicationPath)
Gets the current version of the installed emulator
applicationPath
Path to the emulator executable

Returns

If version can get determined the version number, else null

GetImportActions

C#
public virtual IEnumerable<EmulatorImportAction> GetImportActions()
Gets a list of options to be displayed in the ROM import wizard when this emulator is selected to be used

Returns

A collection of actions to be listed. LaunchBox will call FireImportAction after the import for any option the user selects

GetInstallableVersions Changed 13.27

C#
public abstract IEnumerable<EmulatorControllerVersion>? GetInstallableVersions()
Gets a list of installable versions of the emulator

Returns

A collection of installable versions of this emulator

GetPotentialSaveSlots 13.16

C#
public virtual IReadOnlyDictionary<int, string> GetPotentialSaveSlots()
Get a list of save slots this emulator supports

Returns

Should return a dictionary where the key is the slot number that will be past in the GameSaveBase model used elsewhere in the plugin. The value is the label string for that slot

GetSaves 13.16

C#
public virtual GetSavesResponse GetSaves(GetSavesArgs args)
Gets a list of saves for the emulator/game in question
args
Argument containing information about the game or app this request is for, as well as the emulator it's using

Returns

Response that indicates success or failure, with a list of found files on success

InjectRetroAchievementsCredentials 13.22

C#
public virtual PluginResponse InjectRetroAchievementsCredentials(
    InjectRetroAchievementsCredentialsArgs args
)
Inject the RetroAchievements credentials from LaunchBox into the emulator
args
The target emulator, credentials, and optional achievement settings to apply.

Returns

The success status and any related message.

InstallEmulator

C#
public abstract EmulatorInstallResponse InstallEmulator(
    InstallEmulatorArgs args
)
Install the emulator
args
Context regarding the installation of the emulator

Returns

Appropriate response for the request

IsPlatformSupported

C#
public abstract EmulatorSupportResponse IsPlatformSupported(string platform)
Does this emulator support this platform?
platform
The platform in question

Returns

Response that indicates if the platform is supported, and if this emulator is recommended for it

IsSaveActive 13.27

C#
public virtual bool IsSaveActive(
    GameSaveBase save,
    string emulatorApplicationPath
)
Checks whether a save is currently active for the emulator.
save
The save to check.
emulatorApplicationPath
The application path of the emulator in question.

Returns

True if the save should be treated as active.

IsSaveContainer 13.27

C#
public virtual bool IsSaveContainer(GameSaveBase save)
Indicates whether the save is stored inside a container that should remain on disk after removing the save.
save
The save to check.

Returns

True if the save is stored inside a shared container.

IsSecondarySaveFile 13.27

C#
public virtual bool IsSecondarySaveFile(string filePath)
Indicates whether a save file is a secondary file within a multi-file save set.
filePath
The save file path to check.

Returns

True if the file should be skipped as a secondary save file.

IsUpdateAvailable(string, out EmulatorControllerVersion) Changed 13.27

C#
public virtual bool IsUpdateAvailable(
    string? emulatorAppPath,
    out EmulatorControllerVersion? version
)
Checks whether an existing installation can be updated to a newer one.
emulatorAppPath
The application path of the emulator in question
version
The name of the version to be used in a message box explaining an update was found

Returns

True if this emulator can be updated, otherwise false

IsUpdateAvailable(IEmulator, out EmulatorControllerVersion) Changed 13.27

C#
public virtual bool IsUpdateAvailable(
    IEmulator? emulator,
    out EmulatorControllerVersion? version
)
Checks whether an existing installation can be updated to a newer one.
emulator
The emulator in question
version
The name of the version to be used in a message box explaining an update was found

Returns

True if this emulator can be updated, otherwise false

NormalizeCommandLineForExecutable 13.27

C#
public virtual string NormalizeCommandLineForExecutable(
    string commandLine,
    string applicationPath
)
Allows an emulator plugin to normalize the command line based on the executable path.
commandLine
The command line to normalize.
applicationPath
The emulator executable path.

Returns

The normalized command line.

PrepareEmulatorForLaunch 13.22

C#
public virtual PrepareForLaunchResponse PrepareEmulatorForLaunch(
    PrepareForLaunchArgs args
)
Called right before LaunchBox attempts to start the emulator to play the ROM in question. Used to ensure all configuration requirements are done before the game is launched.
args
Details regarding what emulator and game/app is about to be launched

Returns

Return success if we can launch the game

RemoveSave 13.16

C#
public virtual PluginResponse RemoveSave(GameSaveBase? save)
Deletes a save file through the schema version 1 compatibility API.
save
The save to remove. Null or an empty file location requires no deletion.

Returns

Success when no deletion is needed or the file is deleted; otherwise a failure result.

SupportsRetroAchievements 13.22

C#
public virtual RetroAchievementSupportResponse SupportsRetroAchievements(
    string emulatorApplicationPath
)
Does this plugin support injecting LaunchBox RetroAchievements credentials into emulator
emulatorApplicationPath
The application path of the emulator in question

Returns

Response that tells LaunchBox if the plugin supports this functionality, as well as what the current values in the emulator are now

SupportsSaveManagement 13.16

C#
public virtual bool SupportsSaveManagement()
Does this plugin allow the user to manage their game save files?

Returns

True if this plugin supports save management features, false if not

TryBackupSave 13.27

C#
public virtual bool TryBackupSave(
    GameSaveBase save,
    string emulatorApplicationPath,
    string destinationFolder,
    out string? error
)
Attempts to extract a save into a destination folder for backup.
save
The save to back up.
emulatorApplicationPath
The application path of the emulator in question.
destinationFolder
Destination folder to place extracted save data.
error
The error message if the backup fails.

Returns

True if the backup was created, false otherwise.

TryComputeSaveSignature 13.27

C#
public virtual bool TryComputeSaveSignature(
    GameSaveBase save,
    string emulatorApplicationPath,
    out string? signature
)
Attempts to compute a signature for a save (used for comparing save content).
save
The save to compute the signature for.
emulatorApplicationPath
The application path of the emulator in question.
signature
The computed signature, if available.

Returns

True if a signature was computed, false otherwise.

TryGetSaveGroupInfo 13.27

C#
public virtual bool TryGetSaveGroupInfo(
    GameSaveBase save,
    string primaryFilePath,
    out string? saveGroupId,
    out string? saveGroupName
)
Attempts to resolve persisted grouping information for a save based on its primary file path.
save
The save to group.
primaryFilePath
The primary save file path.
saveGroupId
The resolved save group id.
saveGroupName
The resolved save group name.

Returns

True if grouping information was resolved.

UseSaveGroupIdForPersistedMatch 13.27

C#
public virtual bool UseSaveGroupIdForPersistedMatch(GameSaveBase save)
Indicates whether a save should be matched to persisted metadata by SaveGroupId first.
save
The save to check.

Returns

True if SaveGroupId should be used for persisted matching.