libretro.api.message

Types that allow Cores to display notifications on the frontend’s OSD.

See also

MessageDriver

The Protocol that uses these types to implement notification support in libretro.py.

libretro.drivers.message

libretro.py’s included MessageDriver implementations.

Module Attributes

retro_message_target

Corresponds to retro_message_target in libretro.h.

retro_message_type

Corresponds to retro_message_type in libretro.h.

Classes

MessageTarget

Where a message should be displayed.

MessageType

The presentation style of a message.

retro_message

A short-lived on-screen notification.

retro_message_ext

An extended version of retro_message with more display options.

class MessageTarget[source]

Bases: IntEnum

Where a message should be displayed.

MessageDrivers can interpret these however they want.

>>> from libretro.api import MessageTarget
>>> MessageTarget.OSD
<MessageTarget.OSD: 1>
ALL = 0
OSD = 1
LOG = 2
__new__(value)
classmethod value in self

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)

classmethod self[name]

Return the member matching name.

__init__()
classmethod iter(self)

Return members in definition order.

classmethod len(self)

Return the number of members (no aliases)

class MessageType[source]

Bases: IntEnum

The presentation style of a message.

MessageDrivers can interpret these however they want.

NOTIFICATION = 0
NOTIFICATION_ALT = 1
STATUS = 2
PROGRESS = 3
__new__(value)
classmethod value in self

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)

classmethod self[name]

Return the member matching name.

__init__()
classmethod iter(self)

Return members in definition order.

classmethod len(self)

Return the number of members (no aliases)

class retro_message[source]

Bases: Structure

A short-lived on-screen notification.

Corresponds to retro_message in libretro.h.

msg

Null-terminated message text to display.

frames

Duration in frames to show the message.

__deepcopy__(memodict=None)[source]

Return a copy of this object, including all strings. Intended for use with copy.deepcopy().

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)
class retro_message_ext[source]

Bases: Structure

An extended version of retro_message with more display options.

Corresponds to retro_message_ext in libretro.h.

msg

Null-terminated message text to display.

duration

Duration in milliseconds to show the message.

priority

Priority of the message. Higher values take precedence.

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)
level

Log severity level of the message.

target

Where the message should be displayed.

type

Presentation style of the message.

progress

A value from -1 to 100 representing task progress. -1 for indefinite.

Assigned values are bitwise-masked to fit into a uint8_t.

__deepcopy__(memodict=None)[source]

Return a copy of this object, including all strings. Intended for use with copy.deepcopy().

>>> import copy
>>> from libretro.api import retro_message_ext
>>> copy.deepcopy(retro_message_ext()).duration
0
retro_message_target

Corresponds to retro_message_target in libretro.h.

retro_message_type

Corresponds to retro_message_type in libretro.h.