XML Configuration

XML Configuration of BlowTorch

The settings for a BlowTorch connection can be exported and imported into the app. All settings can be modified in this XML file.

How settings are stored

At this point the settings storage and importing/exporting are a little convoluted. In the internal app storage of the program resides the configuration file for the connection. Exporting settings will copy this file to a location on the SD Card in the /BlowTorch directory. Importing settings will read the configuration from a file in the /BlowTorch directory and use those settings for the currently open connection, which will then be saved to the internal app storage area. In the future connections will have a "settings location" option so this import/export business will be obsolete.

Export/Import Settings

Importing and Exporting settings files can be done from the MENU->Options page. When clicking the export option, a dialog asking for a file name will be given, it will use this name to create a file in the /BlowTorch directory on the SD Card (the .xml extension is not added automatically). The import option will give a list of files with a .xml extension that currently exist in the /BlowTorch directory on the SD Card, the selection will be imported for the currently open connection.

Window Settings

Window settings are all attributes of the <window> node under the <root> node. They include:

  • lineSize: Vertical height of the desired font in pixels.
  • spaceExtra: Extra space inbetween lines, in pixels.
  • maxLines: Number of lines that the window will keep.
  • fontName: Name of the font to use, this will be monospace, sans-serif or default if fontPath is none.
  • fontPath: Path to the true type font to use.
  • wrapMode: (This setting currently doesn't do anything, but in the future will be used for none, line break or word wrap wrapping modes).

Service Settings

Service settings are attributes of the <service> node.

  • processSemi: Weather or not semicolons will be replaced with newlines when sent to the server. Can be "true" or "false"
  • processPeriod: Weather or not commands with leading periods will be processed as Special Commands. Can be "true" or "false"
  • throttle: Weather or not the service will throttle itself when the window is not open. Can be "true" or "false"

Button Sets

Settings for Button Sets are attributes of the <buttonset> node. These nodes should be children of the <buttonsets> node which should be a child of the <root> node. A <buttonset> may have an unlimited amount of <button> children. The attributes available for the <buttonset> node are:

  • setName: The name of the button set, this is what will be used in the button set selection dialog, and as targets for other buttons to switch to. This value is a string.
  • Colors: all color values are 8 byte AARRGGBB hexadecimal values written as strings. (no leading #,0x or 0h values needed).
    • color - idle button color.
    • flipColor - flipped button color.
    • labelColor - idle label color.
    • flipLabelColor - flipped label color.
  • Screen Display Info: all values are in pixels.
    • buttonHeight - height of the button.
    • buttonWidth - width of the button.
    • labelSize - height of text used as the label.

Individual Buttons

Button data is stored as <button> nodes that are children of a <buttonset> node. nodes can have the following attributes:

  • label: text that is displayed in the idle state.
  • command: the command sent to the server when this button is clicked.
  • flipLabel: the label displayed in the button's idle state.
  • flipCommand: the command sent to the server when this button is flipped.
  • moveMethod: the current movement method for this button, value is an integer of the following:
    • 0: "Free" the button tracks the movement of the finger when moving.
    • 1: "Nudge" the button tracks the movement of the finger at 1/10 scale when moving.
    • 2: "Freeze" the button does not move, although the movement state can still be observed.
    • targetSet: if this is set, this button will switch to the named button set when clicked. String value.
  • xPos: x position of the center of the button, in pixels.
  • yPos: y position of the center of the button, in pixels.
    • If settings are moved to a phone with different screen size/resolution, buttons may appear off the screen.
  • The following are the same attributes available in the <buttonset> node. If these are set, changing the <buttonset> value will not affect this button.
    • Colors: all color values are 8 byte AARRGGBB hexadecimal values written as strings. (no leading #,0x or 0h values needed).
      • color - idle button color.
      • flipColor - flipped button color.
      • labelColor - idle label color.
      • flipLabelColor - flipped label color.
    • Screen Display Info: all values are in pixels.
      • buttonHeight - height of the button.
      • buttonWidth - width of the button.
      • labelSize - height of text used as the label.

Aliases

Aliases are stored as <alias> node children of the <aliases> node that has the <root> node as a parent. <alias> nodes have the following attributes:

  • pre: the text to replace. String value.
  • post: the replaced text. String value.

Triggers

Triggers are stored as <trigger> nods of the top level <triggers> node. <trigger> nodes may have the following attributes:

  • title: String value used for display in the trigger selection dialog.
  • pattern: String value that will cause the trigger to fire. Can be "true" or "false"
  • interpretLiteral: Indicates weather or not the pattern should be interpreted as literal text or as a regular expression.
  • I think this is currently backwards, if interpretLiteral = false, it is interpreted as a literal. If interpretLiteral = true, then it is interpreted as a regular expression.
  • fireOnce: Indicates if this trigger will only fire once per connection session. Can be "true" or "false"
  • hidden: Indicates if this trigger will not show up in the trigger selection dialog. Can be "true" or "false"
  • Triggers may also have an unlimited number of children nodes that represent the responders that are fired when the trigger pattern is encountered.

Responders

The 3 different responder types can be represented by <ack>,<toast> and <notification> nodes. These nodes are used as children of <trigger> nodes.

fireWhen attribute

Each of the following nodes may have a "fireWhen" attribute set that will describe the fire behavior of the responder. Values that can be used:

  • never: This responder will never fire
  • windowOpen: This responder will fire only if the main app window is open.
  • windowClosed: This responder will fire only if the main app window is closed.
  • always: This responder will fire always, regardless of the application window state.

<notification>

  • title: String value used as the title in the notification bar.
  • message: String value to indicate more information used as subtext in the notification.
  • useSound: Boolean string indicating if notification will play a sound. Can be "true" or "false".
  • soundPath: Path to the sound to use, if this is blank ("") and useSound="true", the default notification sound will play.
  • useLights: Boolean string indicating if lights will be shown for this notification. Can be "true" or "false"
  • lightColor: AARRGGBB hexadecimal string indicating which light color to use. Hardware will do its best to approximate. No leading #,0x or 0h used. If this is blank ("") and useLights = true, then the default system light color will be used.
  • useVibrate: Boolean value indicating if this notification will vibrate when fired. Can be "true" or "false"
  • vibrateType:
    • 0: Default
    • 1: Very Short
    • 2: Short
    • 3: Long
    • 4: Super Long
  • spawnNew: Boolean string indicating if this notification will spawn a new notification each time it is fired, or recycle the same notification but update the timestamp. Can be "true" or "false"
  • useOngoing: Currently does nothing, but will be a Boolean string indicating if this notification will use the main app's ongoing notification for it's output.

<toast>

  • message: String to be displayed as the toast message.
  • delay: Duration of the message in seconds. Integer value.

<ack>

  • with: String to be sent as a command to the server when this responder is fired.