Writing mdtoceditor plugins

Minidisc Toc Editor provides a framework for editing and saving of minidisc Table of Contents (TOC). It sends sequences of IR signals to transmit the TOC to the minidisc deck. But different models of minidisc decks require completely different sequences of IR signals, so the process of creating these sequences is highly deck specific.

To simplify adding code for not yet supported decks as comfortable as possible, all deck specific code is isolated in loadable plugins. Each plugin is written in the script language Tcl, what makes it possible to implement code without spending time or money for a development environment.

Each plugin has to implement a set of operations. Operations that are not supported by a specific deck can be omitted and will be disabled in mdtoceditor. There is a template plugin file that can be copied and adjusted. The template file contains a documentation for all required operations.

Beside basic Tcl syntax, plugins can/must use the additional commands:

ircmd adds exactly one command to the command sequence. A command might be an infrared command a delay or a user callback. An infrared command is the name of a button, how it is defined in the lircd config file. (Often /etc/lircd.conf). A command can be sent once or for a period of time. A delay is a period of time, that will suspend the execution of the sequence. A user callback will result in calling the plugin while processing the sequence. Duration is number followed by an optional unit s for seconds, or ms for miliseconds. If no unit is given, the duration will be a multiplicated with the delay base value, from the delay proc of the plugin. Examples: 2, 2s, 2000ms.


An IRCOMMAND is the name of a button, how it is defined in the lircd config file.

ircmd delay [DURATION]

ircmd user CALLBACK

When processing a user command, mdtoceditor will call the user procedure of the plugin and passes CALLBACK to identify the type of callback. The plugin might return an additional sequence that will be processed directly before continueing the original sequence.

dialog enables the plugin to lead dialogs with the user. They are necessairy for decks that can't be label discs by the remote completel and require user interactions. Currently two type of dialogs are implemted:

dialog returns the selected option, or -1 otherwise. (f.e Cancel)

dialog note NOTE
dialog returns 0 if ok, or -1 otherwise.