Please enable JavaScript to view this site.

XStudio 3

Navigation: Reference > Automation Database Maintenance > Actions

Embedding an Action in a Cart

Scroll Prev Top Next More

In XStudio, you can cause an Action to be executed when a cart (audio item) begins playing. This technique might be useful if you need to perform certain tasks at a non-scheduled time. By linking the execution of an Action to the play start of a specific cart, the Action can be executed on-demand without regard to time or reliance on a relay closure or other method of triggering execution of an Action.

Assuming the Action you wish to execute has been created, there are two steps involved in using this functionality:

1.Enable the functionality (see Enable Actions Embedded in Carts) in XStudio Preferences. Unless this feature is enabled, XStudio will ignore any Actions embedded in carts. Enabling this feature is a matter of checking the appropriate item and saving your changes in Preferences.

2.Modify the cart header to include the Action information, which consists of a keyword and an Action ID.

Modifying the Cart to Execute an Action

To use a particular cart number to execute an Action, the cart's header Description field needs to be edited to include a keyword and an Action ID number to execute. This can be done when the cart is created, or later edited to add the Action information. The example shown utilizes the XStudio View/Edit Cart Properties dialog.

Embeded Action Example

Embeded Action Example

The only difference between a normal cart and one that has embedded Action information is the content of the Description field. The description field must be edited to include a keyword and Action ID in the format:

XSA=nnnn

The XSA= part is the keyword, the nnnn part is the 4-digit Action ID to be executed. There must be no spaces between any of the characters and the characters following the equals sign must be numeric and a full 4 characters in the range 0001 to 9999. Note that if the Action ID number is, for instance, "99", the text entered here must be "0099" to meet the 4-digit requirement.

The keyword side (XSA=) can be upper or lowercase (or a mixture), but must be exactly those 3 characters followed by the equals sign.

When you have completed your edits, save the changes. In the example shown, you'd click on the [Commit Changes] button.

How do embedded Actions work?

The inner workings of Actions embedded in carts are fairly straightforward. When this feature is enabled and XStudio signals the audio engine to play a cart, the audio engine looks at the cart information to determine if there is an embedded Action. If the keyword "XSA=" is found, the 4 digits following the keyword are extracted and the audio engine signals XStudio to perform the Action, passing the 4-digit ID value. This special signal is sent a few milliseconds before actual start of playback. The audio engine then begins playing the cart as normal.

When XStudio receives notification to execute the Action, the same things that are done with all Action execution are done - XStudio tries to find the Action and if so, starts execution. If the Action is not found, that fact is logged to the event log and nothing happens. Within the Action itself, all normal execution rules apply, including any restrictions placed tasks relating to mode of operation, time of day and day of week. In other words, executing an Action in this way behaves the same as an Action initiated by any of the other available methods. The only thing that's different is that XStudio double-checks the ID value it receives to make sure it evaluates to a number. This is done to catch situations where you might have inadvertently entered the wrong information or somehow managed to create the keyword (XSA=) when entering a normal cart description.

While not important to the actual Action execution, the length and audio content of the cart should be considered. If, for instance, XStudio is being used as network programming originator and needs to signal affiliates for a local break, it may be that the audio content of the cart could be nothing more than 1 second of silence - enough time to execute the Action, which in this example would include Send Control Command task to perform the affiliate break signal, and allow enough time for the affiliate to switch away before XStudio plays the next cart on the log, which in this example would be the first element of a break.