DirectOutputR1
DirectOutput framework R1 for virtual pinball cabinets.
Go to:
Overview 
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros Pages
ini files

Introduction

The DirectOutput framework supports the use of the legacy LedControl.ini files as well as the extended DirectOutputConfig.ini files as generated by the Ledwiz config tool to control the cabinet outputs. Since this framework supports the use of more than one output controller/LedWiz, the use of more than one such file can be used.

To facilitate the use of the framework, the auto config function will automatically load ini files and select a table config from the data based on the RomName, if no xml table config can be found. But even if a xml table config file is available is is possible to use the directoutputconfig.ini/ledcontrol.ini configs together with xml table configs by setting the right option in the xml table config.

If you dont have a directoutputconfig.ini file for your cabinet, it is best if you go to the LedWiz ConfigTool Website and create a file matching your cabinet.

LedControl.ini files which worked for the legacy ledcontrol.vbs solution are working in DOF too and will generally create the same effects as the ledcontrol.vbs, but you might notice some small differences since the timeing behaviour of DOF is completely different from the old solution (DOF is much, much faster).

section inifiles_howitworks How it works

Since both types of supported ini files, do only specify the effects which are to be applied on certain outputs, but contain no information on the toys to be used, the DirectOutput framework uses a special type of toy to map the output definitions in the ini files to outputs resp. to the connected toys. This special type of toy is called LedWizEquivalent. It is basically a list of 32 outputs, which typically all belong to the same output controller, and a number specifying a the number of the virtual output controller. If necessary it is also possible to mix outputs of several output controllers in one LedwizEquivalent toy.

When configurations from ini files are to be used, the framework is matching the ini files against the LedWizEquivalentToys by their numbers and uses the output definitions of the toy, to determine which outputs are to be used for which column in the ini file. For these outputs the frameworks checks next if a matching toy has already been configured for those outputs. If a matching toy does already exist, it will be used, if no toy is found DOF will automatically create a toy of a matching type (RGBAToy or AnalogaAlphaToy). These toys are then used as targets for the effects specified in the columns of the ini files.

Once the toy to be used have been determined the DirectOutput framework will setup the effects for those toys based on the settings found in the columns of the ini file. Deppending on the settings one or several effects are used to create the desired results. Please read the paragraph on Setting parameters and the page on Effects for more information.

Configuration loading

Depending on the settings in the global config file, the framework will either load the ini files specified in the global configuration or it will try to detect the ini files automatically.

If entries for ledcontrol files exist in the global config (see global config documentation), the framework will use those files for configuration and check only these files for table settings.

If the global config doesn't specify any ini files, the system will go into automatic configuration mode, in which it tries to detect and load global config files automatically.

Automatic configuration

File locations and names

In auto config mode the DirectOutput framework tries to locate the files in the following locations:

  • Table directory as specified in the table name para when the framework is initialized.
  • Global config directory which is usualy a subdirectory named config within the installation directory of the framework.
  • Installation directory which is the directory containg the DirectOutput.dll.

DOF will check each of these directories for ini files containing configurations. These files can have the following names:

  • directoutputconfig.ini resp. directoutputconfig{Number}.ini are the files for which the framework is looking first.
  • ledcontrol.ini resp. ledcontrol{Number}.ini are the names the framework is looking for if no files named _directoutputconfig.ini__ can be found.

Based on the loaded files, the system will configure the DirectOutput framework.

LedControl file numbering

If auto configuration is used (typical if no table config file is available), the framework requires the ini files to match as specific naming and numbering system so they can be detected and used automatically. If more than one ini file is used, the files have to be numbered. Valid names are DirectOutputConfig.ini resp. DirectOutputConfig{Number}.ini or LedControl.ini resp. LedControl{Number}.ini. Using DirectOutputConfig.ini is the recommanded naming schema.

The numbers in the filenames (1 is assumed if no number exists) are used to match the files with the LedWizEquivalentToys, which are in turn used to determine the outputs resp. toys to be configured by the ini files.

Files having a number, which does not match any LedWizEquivalent toy are ignored in the configuration process.

Manual configuration

Instead of using the automatic detection of ini files, it is also possible to specify the ini files to be used in the global configuration of the framework. Each entry for a ini file consists of the path and name of the file and a number specifying which LedWizEquivalent toy should be configured by the ini file.

If at least one ini file is specifiy in the global config, the framework will no do any automatic ini file detection.

For ini files specified in the global config any filename can be used. The restriction on filesnames which exists for automatic config does not exist here.

Cabinet configuration

The DirectOutput framework is not capable of doing anything without a cabinet config. For detailed information on this topic please read the page on Cabinet Configuration, since the following paragraphs only contain a few details which are relevant when it come to config through ini files.

Automatic cabinet configuration

A cabinet config file can contain any number of LedWizEquivalent toys to control any number of output controllers. If cabinet auto configuration is used, the framework will automatically generate LedWizEquivalent toys for the output controllers which are automatically detected.

If active (typically if no cabinet config file exists), automatic cabinet configuration numbers the detected and created output controllers resp. their related LedWizEquivalent toys as follows:

  • For LedWiz unit 1-16, the framework creates one LedWizEquivalent per unit having the same number as the LedWiz (LedWiz nr. = LedWizEquivalent nr. = ini file number).
  • For PacLed64 units (max 4 supported), the framework creates 2 LedWizEquivalentToys per unit to cover all 64 outputs. The numbering for those LedWizEquivalent starts at 20, so PacLed64 id 1 can be accessed through LedWizEquivalents numbered 20 & 21, PacLed id 2 uses 22 & 23 and so on.

Manual cabinet configuration

Instead of relying on the automatic cabinet configuration, you can also specifiy your own cabinet config for the use with ini files.

To be usable for the ini file configration system of the framework, the list of toys in the cabinet must contain one or several LedWizEquivalent toy objects. Normaly the outputs of a LedWizEquivalent toys will point to the outputs of a single output controller, but you are free to point them to any other output of any output controller configured in your system (e.g. you could use outputs of 2 different LedWiz controllers in one LedWizEquivalent toy).

When ini file data is used for the Table configuration, the number of the LedWizEquivalent toy is used to match to the correct ini file.

If a cabinet config file exists, the framework normally no do any automatic detection of output controllers and will no create any LedWizEquivalent toys automatically.

Settings in DirectOutputConfig/LedControl ini files

The content opf the ini files is a bit hard to read and understand. The following paragraphs try to explain the most importants points.

The ini files are also quite hard to edit manually. Therefore the best option to get your own settings, is to use the LedWiz ConfigTool Website. If you create your own settings, it is highly recommended that you use the LedControlFileTester.exe to check if your files can be parsed.

LedWizConfigTool.jpg
LedWiz ConfigTool

Colors Section

The first section in a directoutputconfig.ini file is the Colors section. It starts with the header [Colors_DOF] and a empty line following the header. After the header one or several colors are specified by a name and the brighness of 3 color components (red, green, blue) or 4 color components (red, green, blue, alpha). The values of the components have a range of 0 (off resp. fully transparent for alpha) to 48 (max brightness resp. fully opaque for alpha). For color specifications without a alpha component, alpha will be set to 0 (transparent) if all components are set to 0 (resulting in black). All other definitions will have a alpha value of 255 (fully opaque).

A colors section might looks as follows:

[Colors DOF]
Black=0,0,0
White=48,48,48,48
Red=48,0,0,255
SemitransparentRed=48,0,0,24
.. more color definitions ....
Brown=24,12,0

Config DOF Section

The most important section in a directoutputconfig.ini file is the [Config DOF] section. It contains the effect definitions for the various tables.

Each line in this section contains the definition for a single table. The lines start with a short version of the romname of the table or a fake romname for EM tables. After the romname, there can be up to 32 columns (separated by commas) containing the settings for every output of a ledwiz resp. the internal representation of a ledwiz (Column 1 is output 1, column 2 is output 2 and so on).

Every column can contain any number of definitions how the framework should control the output. If more than one definition exists for a column, these definitions have to be separated by forward dashes (/).

The following definitions can be used to specifiy the output behaviour of the physical outputs. Definitions can consist of up to three parts each containing one setting separated by a space.

LedWizConfigTool.jpg
LedWiz ConfigTool

The config section of a ini file might looks like this:

[Config DOF]
abv106,S6/S7 60/S48,S4,S8/S11/W58 60/W59 60/W60 60/W61 60,S13,0,S1/S2/S46,S5/S12 60,0,S15/S16/S31 60/S32/W51 60/W52 60/W53 60,S14/S17 60/S30,S3,ON,ON,L34,W27 Blink,L3,S6 Yellow/S20 Yellow,S4 White/S14 Red/S21 Red/S22 Green/S27 Red/S28 Red/W62 Green/W65 Yellow/W66 Yellow/W69 Yellow,S1 Blue/S13 Red/W41 Yellow/W42 Yellow/W43 Yellow/W70 Yellow,S5 White/S15 Red/S24 Yellow/S25 Green/S27 Red/W54 White/W71 Yellow,S23 Yellow/S26 Yellow/W49 White/W50 White,0
afm,S48,S9,0,0,S3/S11,S1/S2/S46,S10,0,S4/S13,S12/S16,S7,ON,ON,0,L86,L88,S27 Red/S11 Red/S28 Green/W56 Green/W57 Green/W58 Green,S9 Blue/S25 Red/S26 Red/W43 Green,S12 Red/S21 Red/S23 Green,S10 Blue/S17 Red/S18 Red/S22 Yellow/W38 Yellow/W44 Green,S19 Red/S13 Red/S20 Green/W41 Green/W42 Green/W48 Yellow,S5 600 I32/S6 600 I32/S8 600 I32/S14 600 I32/S15 600 I32
... more table configs ...
atlantis,S48,S7,0,S2/S9/W1 60/W2 60/W3 60/W4 60,S4/S11,S12/S14/S46,S8,0,S1/S5,S6,S15,ON,ON,0,W16 Blink,ON,S4 Red/W25 Red/W26 White/W27 Yellow/L43 Orange,S7 Yellow/W32 Blue/L77 White,S6 Red/W12 White/W33 Red/W34 White/W35 Yellow/L45 Red,S8 Yellow/W36 Cyan/L62 White,S5 Red/W13 White/W28 Red/W29 White/W30 Yellow/W45 Blue/L76 Orange,0

Setting examples

The first part of a setting for a column must always be one of the following:

  • TableElementTypeChar plus Number (e.g. S48 for solenoid 48) determines which table element is controlling the specified effect.
  • On resp. 1 turns the specified effect constantly on.
  • B defines a static (not externaly controlled) blinking.

The second and following parts can contain the following:

  • Color name as specified in the colors section of the file. Only valid as the second value.
  • Hex color definition (e.g. #ff0000ff for opaque red). Take note that these color definitions allow for values from 0-255 in contrast to the colors section which only support 0-48. Hex color definitions can contain 3 or 4 parts (without or with alpha value). Setting is only accepted as the second value.
  • Blink defines blinking with a default interval of 500ms.
  • I{Number} defines a intensity between 0 (off) and 48 (fully on) for the effect. This settings is only valid for effect settings without a color definition and controlling only a single output.
  • L{Number} defines the layer on which the setting operates. In most cases the setting is not required, since DOF will assign ascending layer numbers to the settings for a column anyway.
  • W{NumberOfMilliseconds} defines a wait period resp. delay before the effect executes after it has been triggered.
  • M{NumberOfMilliseconds} defines the minimum duration for the effect in milliseconds.
  • F{NumberOfMilliseconds}, FU{NumberOfMilliseconds}, FD{NumberOfMilliseconds} are used to specify the fading duration in milliseconds. F sets the duration for both fading up and down, FU controls fading up anly and FD fading down only.
  • Numeric Values without any extra character can be used to specify the duration of the effect or the blinking behaviour. If blinking has been defined, one or two numeric values are parsed. Value 1 controls the blink interval in milliseconds, while value 2 defines the number of blinks. If no blinking has been defined, only one numeric values which is used to defined the duration of the effect in milliseconds is parsed.

Setting examples

  • S48 will turn the toy associated with the column on and off depending on the state of solenoid 48.
  • S48 Green will set the rgb led associated with the column of the file to green depending on the state of solenoid 48.
  • S48 Green Blink will set the rgb led associated with the column of the file to green blinking depending on the state of solenoid 48.
  • W32 Red Blink 500 5 will make a rgbled blink red for 5 times with a interval of 500ms when switch 32 is activated.
  • W32 Red Blink 250 5 F200 same result as previous example but the color will fadin and out in 200 millieconds.
  • W36 I32 sets the output associated with the column to intensity 32 as long as switch 32 is active.

LedControl File Testing Application

The package of the DirectOutput framework does also contain a small tool named LedControlFileTester.exe which can be used to test wether the contents of a directouput.ini resp. ledcontrol.ini file can be read and understood be the DirectOutput framework.

The tool can by started directly with a double click like any other program, but it can also be used from the command line.

For command line usem you have to specify a single parameter with the name and path to your config file:

LedControlFileTester.exe DirectOutputConfig.ini

If the file is OK, the tool will output a small notification message in the command window. If there are problems in the ledcontrol file, the tool will open a window where you can see the messages returned by the ledcontrol file parser.

LedControlFileTester.jpg
Test results showing a problem in a config file.
Warning
This tool does only check if the basic structure of the file is correct and wether all settings can be parsed. It does NOT check if settings make sense (e.g. if a settings exists for a non existing table element).