plugging

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: GPL-3.0, GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package plugging conceptualises the act of plugging devices into the VCS ports. This includes the panel in addition to the various peripherals that plug into the player ports (ie. controllers, savekey, etc.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitorable

type Monitorable interface {
	AttachPlugMonitor(m PlugMonitor)
}

Monitorable implementations are capable of having a PlugMonitor attached to it. The VCS Ports themselves are monitorable but we also use this mechanism in the "auto" controller type and in the future, devices like the Quadtari will be implemented similarly.

It is expected that such implementations will call PlugMonitor.Plugged() as required. Note that PlugMonitor.Plugged() should not be called on the event of AttachPlugMonitor except in the special case of the ports.Ports type

Implementations of Monitorable should also test peripherals that are daisy-chained and call AttachPlusMonitor() as appropriate.

if a, ok := periph.daisychain.(pluggin.Monitorable); ok {
	a.AttachPlugMonitor(m)
}

type PeripheralID added in v0.14.0

type PeripheralID string

PeripheralID identifies the class of device a Peripheral implemenation represents.

const (
	PeriphNone     PeripheralID = "None"
	PeriphPanel    PeripheralID = "Panel"
	PeriphStick    PeripheralID = "Stick"
	PeriphGamepad  PeripheralID = "Gamepad"
	PeriphPaddle   PeripheralID = "Paddle"
	PeriphKeypad   PeripheralID = "Keypad"
	PeriphSavekey  PeripheralID = "Savekey"
	PeriphAtariVox PeripheralID = "AtariVox"
)

List of valid PeripheralID values.

type PlugMonitor

type PlugMonitor interface {
	Plugged(port PortID, peripheral PeripheralID)
}

PlugMonitor interface implementations will be notified of newly plugged peripherals.

type PortID

type PortID string

PortID differentiates the different ports in the VCS into which peripherals can be plugged.

const (
	PortUnplugged   PortID = "Unplugged"
	PortLeftPlayer  PortID = "Left"
	PortRightPlayer PortID = "Right"
	PortPanel       PortID = "Panel"
)

List of defined PortIDs.

We could potentially extend this to support a future Quadtari implementation.

Jump to

Keyboard shortcuts

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