notifications

package
v0.24.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: GPL-3.0, GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package notifications defines the Notify type and the possible values of that type. These values represent the different notifications that be sent to the GUI.

hardware  ---->  emulation  ---->  GUI
(eg. cartridge)  (eg. debugger)

Notifications flow in one direction only and can be generated and terminate at any of the points in the chart above.

For example, a pause PlusROM network activitiy notification will be generated in the hardware, passed to the "emulation" package and forwarded to the GUI.

Another example, is the rewind notification. This will be generated in the "emulation" package and sent to the GUI.

Finally, a mute notification will be generated and consumed entirely inside the GUI.

In some instances, the emulation may choose not to forward the notification to the GUI or to transform it into some other notification but these instances should be rare.

Loosely related to the Notify type is the gui.FeatureRequest. The GUI FeatureRequest system is the mechanism by which notifications are forwarded to the GUI.

Communication between hardware and the emulation is meanwhile is handled by the NotificationHook mechanism defined in this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationHook

type NotificationHook func(cart mapper.CartMapper, notice Notify, args ...interface{}) error

NotificationHook is used for direct communication between a the hardware and the emulation package. Not often used but necessary for (currently):

. Supercharger (eg. tape start/end)
. PlusROM (eg. new installation)

The emulation understands how to interpret the event and forward the notification to the GUI using the gui.FeatureReq mechanism.

type Notify

type Notify string

Notify describes events that somehow change the presentation of the emulation. These notifications can be used to present additional information to the user

const (
	NotifyInitialising  Notify = "NotifyInitialising"
	NotifyPause         Notify = "NotifyPause"
	NotifyRun           Notify = "NotifyRun"
	NotifyRewindBack    Notify = "NotifyRewindBack"
	NotifyRewindFoward  Notify = "NotifyRewindFoward"
	NotifyRewindAtStart Notify = "NotifyRewindAtStart"
	NotifyRewindAtEnd   Notify = "NotifyRewindAtEnd"
	NotifyScreenshot    Notify = "NotifyScreenshot"
	NotifyMute          Notify = "NotifyMute"
	NotifyUnmute        Notify = "NotifyUnmute"

	// LoadStarted is raised for Supercharger mapper whenever a new tape read
	// sequence if started.
	NotifySuperchargerLoadStarted Notify = "NotifySuperchargerLoadStarted"

	// If Supercharger is loading from a fastload binary then this event is
	// raised when the loading has been completed.
	NotifySuperchargerFastloadEnded Notify = "NotifySuperchargerFastloadEnded"

	// If Supercharger is loading from a sound file (eg. mp3 file) then these
	// events area raised when the loading has started/completed.
	NotifySuperchargerSoundloadStarted Notify = "NotifySuperchargerSoundloadStarted"
	NotifySuperchargerSoundloadEnded   Notify = "NotifySuperchargerSoundloadEnded"

	// tape is rewinding.
	NotifySuperchargerSoundloadRewind Notify = "NotifySuperchargerSoundloadRewind"

	// PlusROM cartridge has been inserted.
	NotifyPlusROMInserted Notify = "NotifyPlusROMInserted"

	// PlusROM network activity.
	NotifyPlusROMNetwork Notify = "NotifyPlusROMNetwork"

	// PlusROM new installation
	NotifyPlusROMNewInstallation Notify = "NotifyPlusROMNewInstallation"
)

List of defined notifications.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL