EmulatorPlugin13.15
Class in Unbroken.LaunchBox.Plugins
Obsolete since 14.1
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
protected EmulatorPlugin()A summary has not been written for this member.
Properties
EmulatorNameDisplay name of the emulator this controller is for
EmulatorName
public abstract string EmulatorName { get; }
Display name of the emulator this controller is for
Methods
AddSaveFile13.16Adds a save to the emulator through the schema version 1 compatibility API.FireEmulatorImportActionRuns logic for user selected import actionGetApplicableEmulatorsDetermine which emulators can be associated to this controllerGetBiosFilesForPlatform(string)Returns information on what BIOS files can or should be used with this emulator/platform combinationGetBiosFilesForPlatform(string, string, string)Returns information on what BIOS files can or should be used with this emulator/platform combinationGetCompanionSaveFiles13.27Returns companion save files that should be associated with the primary save file.GetCurrentVersionChanged 13.27Gets the current version of the installed emulatorGetImportActionsGets a list of options to be displayed in the ROM import wizard when this emulator is selected to be usedGetInstallableVersionsChanged 13.27Gets a list of installable versions of the emulatorGetPotentialSaveSlots13.16Get a list of save slots this emulator supportsGetSaves13.16Gets a list of saves for the emulator/game in questionInjectRetroAchievementsCredentials13.22Inject the RetroAchievements credentials from LaunchBox into the emulatorInstallEmulatorInstall the emulatorIsPlatformSupportedDoes this emulator support this platform?IsSaveActive13.27Checks whether a save is currently active for the emulator.IsSaveContainer13.27Indicates whether the save is stored inside a container that should remain on disk after removing the save.IsSecondarySaveFile13.27Indicates whether a save file is a secondary file within a multi-file save set.IsUpdateAvailable(string, out EmulatorControllerVersion)Changed 13.27Checks whether an existing installation can be updated to a newer one.IsUpdateAvailable(IEmulator, out EmulatorControllerVersion)Changed 13.27Checks whether an existing installation can be updated to a newer one.NormalizeCommandLineForExecutable13.27Allows an emulator plugin to normalize the command line based on the executable path.PrepareEmulatorForLaunch13.22Called 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.RemoveSave13.16Deletes a save file through the schema version 1 compatibility API.SupportsRetroAchievements13.22Does this plugin support injecting LaunchBox RetroAchievements credentials into emulatorSupportsSaveManagement13.16Does this plugin allow the user to manage their game save files?TryBackupSave13.27Attempts to extract a save into a destination folder for backup.TryComputeSaveSignature13.27Attempts to compute a signature for a save (used for comparing save content).TryGetSaveGroupInfo13.27Attempts to resolve persisted grouping information for a save based on its primary file path.UseSaveGroupIdForPersistedMatch13.27Indicates whether a save should be matched to persisted metadata by SaveGroupId first.
AddSaveFile 13.16
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
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 ranGetApplicableEmulators
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 againstGetBiosFilesForPlatform(string)
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 combinationGetBiosFilesForPlatform(string, string, string)
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
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
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 nullGetImportActions
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 selectsGetInstallableVersions Changed 13.27
public abstract IEnumerable<EmulatorControllerVersion>? GetInstallableVersions()
Gets a list of installable versions of the emulator
Returns
A collection of installable versions of this emulatorGetPotentialSaveSlots 13.16
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 slotGetSaves 13.16
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 successInjectRetroAchievementsCredentials 13.22
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
public abstract EmulatorInstallResponse InstallEmulator(
InstallEmulatorArgs args
)
Install the emulator
args- Context regarding the installation of the emulator
Returns
Appropriate response for the requestIsPlatformSupported
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 itIsSaveActive 13.27
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
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
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
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 falseIsUpdateAvailable(IEmulator, out EmulatorControllerVersion) Changed 13.27
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 falseNormalizeCommandLineForExecutable 13.27
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
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 gameRemoveSave 13.16
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
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 nowSupportsSaveManagement 13.16
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 notTryBackupSave 13.27
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
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
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
public virtual bool UseSaveGroupIdForPersistedMatch(GameSaveBase save)
Indicates whether a save should be matched to persisted metadata by SaveGroupId first.
save- The save to check.