ADTF  3.18.2
Scripting within ADTF Configuration Editor

Table of Contents

Note
This feature is still in beta state

Overview

This feature provides the option to enhance the behaviour of the ADTF Configuration Editor with user defined scripts. The time of execution of each script is defined by different Events. Each event consists of a pre execution stack and a post execution stack. For each stack there can be a number of n different scripts.

The signature of each script function is specified by the selected event. Lets have a look at the event onAddFilterToFilterGraph

function onAddFilterToFilterGraph(name, cid, x, y) {
event.logInfo(`"${script.name}" was executed`)
return {name: name, cid: cid, x: x, y: y}
}

The Signature can not be changed and own return statements within the code must match the provided return value with respect to the names of the object keys and typesof the object values.

Lets say the above code was added as script to the pre event stack of onAddFilterToFilterGraph. Now each time a filter is added to the filter graph of your project this script is executed and can for example modify the given values and return them. By default the values are just passed 'through' the function.

For this purpose this script has the name 'MyCustomScript1' and if we modify the above code like this

function onAddFilterToFilterGraph(name, cid, x, y) {
name += `addedBy${script.name}`
return {name: name, cid: cid, x: x, y: y}
}

Now after adding a new filter to the graph the name of the filter will be changed to the original name plus the postfix 'addedByMyCustomScript1'.

For more information on each of the provided Events have look at their corresponding description provided within the Scripting section of the Options dialog.

API

The current public API includes the following objects:

  • script
    • name: string containing the name of the current script

  • stack
    • cancelExecution: function which cancels the further execution of the current stack when called
    • globals: object shared between all scripts in one stack

  • event
    • cancelExecution: a function which cancels the further execution of the current event when called
    • globals: object shared between all scripts in one event
    • logInfo: function taking one string argument, when called the argument is logged as information
    • logWarning: function taking one string argument, when called the argument is logged as warning
    • logError: function taking one string argument, when called the argument is logged as error

Events

The current implementation includes the following events:

  • onAddFilterToFilterGraph
  • onRemoveFilterFromFilterGraph
  • onAddBindingProxyToFilterGraph
  • onRemoveBindingProxyFromFilterGraph
  • onAddSampleStreamToFilterGraph
  • onRemoveSampleStreamFromFilterGraph
  • onAddRunnerToFilterGraph
  • onRemoveRunnerFromFilterGraph
  • onAddDataInportToFilterGraph
  • onRemoveDataInportFromFilterGraph
  • onAddDataOutportToFilterGraph
  • onRemoveDataOutportFromFilterGraph
  • onAddInterfaceInportToFilterGraph
  • onRemoveInterfaceInportFromFilterGraph
  • onAddInterfaceOutportToFilterGraph
  • onRemoveInterfaceOutportFromFilterGraph
  • onAddRunnerInportToFilterGraph
  • onRemoveRunnerInportFromFilterGraph
  • onAddStreamingInportToFilterGraph
  • onRemoveStreamingInportFromFilterGraph
  • onAddStreamingOutportToFilterGraph
  • onRemoveStreamingOutportFromFilterGraph
  • onAddStreamingInterfaceInportToFilterGraph
  • onRemoveStreamingInterfaceInportFromFilterGraph
  • onAddStreamingInterfaceOutportToFilterGraph
  • onRemoveStreamingInterfaceOutportFromFilterGraph
  • onAddConnectionToFilterGraph
  • onRemoveConnectionFromFilterGraph
  • onAddSubgraphToFilterGraph
  • onRemoveSubgraphFromFilterGraph
  • onAddNoticeToFilterGraph
  • onRemoveNoticeFromFilterGraph
  • onElementsSelectedInFilterGraph
  • onElementsDeselectedInFilterGraph
  • onDeleteSelectedElementsInFilterGraph
  • onMoveSelectedElementsInFilterGraph
  • onAddConnectionToStreamingGraph
  • onRemoveConnectionFromStreamingGraph
  • onElementsSelectedInStreamingGraph
  • onElementsDeselectedInStreamingGraph
  • onDeleteSelectedElementsInStreamingGraph
  • onMoveSelectedElementsInStreamingGraph
  • onAddNoticeToStreamingGraph
  • onRemoveNoticeFromStreamingGraph
  • onAddBindingProxyToStreamingGraph
  • onRemoveBindingProxyFromStreamingGraph
  • onAddSampleStreamToStreamingGraph
  • onRemoveSampleStreamFromStreamingGraph
  • onAddStreamingSourceToStreamingGraph
  • onRemoveStreamingSourceFromStreamingGraph
  • onAddStreamingSinkToStreamingGraph
  • onRemoveStreamingSinkFromStreamingGraph
  • onAddStreamigInportToStreamingGraph
  • onRemoveStreamingInportFromStreamingGraph
  • onAddStreamingOutportToStreamingGraph
  • onRemoveStreamingOutportFromStreamingGraph
  • onAddStreamingInterfaceInportToStreamingGraph
  • onRemoveStreamingInterfaceInportFromStreamingGraph
  • onAddStreamingInterfaceOutportToStreamingGraph
  • onRemoveStreamingInterfaceOutportFromStreamingGraph