Base class for flat config players.

class mpf.config_players.flat_config_player.FlatConfigPlayer(machine)

Flat show players.

Initialise config player.


Clear the context.

config_play_callback(settings, calling_context, priority=0, mode=None, **kwargs)

Callback for standalone player.


Parse short config version.

Implements “express” settings for this config_player which is what happens when a config is passed as a string instead of a full config dict. (This is detected automatically and this method is only called when the config is not a dict.)

For example, the led_player uses the express config to parse a string like ‘ff0000-f.5s’ and translate it into:

color: 220000 fade: 500

Since every config_player is different, this method raises a NotImplementedError and most be configured in the child class.

Parameters:value – The single line string value from a config file.
Returns:A dictionary (which will then be passed through the config validator)

Return full config.


Parse config list.

mode_start(config, priority, mode)

Add events for mode.


Remove events for mode.

play(settings, context, calling_context, priority=0, **kwargs)

Directly play player.

process_config(config, **kwargs)

Process system-wide config.

Called every time mpf starts, regardless of whether config was built from cache or config files.

process_mode_config(config, root_config_dict, mode, **kwargs)

Parse mode config.

register_player_events(config, mode=None, priority=0)

Register events for standalone player.

show_play_callback(settings, priority, calling_context, show_tokens, context)

Callback if used in a show.


Callback if show stops.


Remove event for standalone player.


Validate this player’s section of a config file (either a machine-wide config or a mode config).

  • config – A dict of the contents of this config_player’s section
  • the config file. It's assumed that keys are event names, and (from) –
  • are settings for what this config_player does when that (values) –
  • is posted. (event) –
Returns: A dict in the same format, but passed through the config
validate_config_entry(settings, name)

Validate one entry of this player.