Command Reference - Action Examples
|
Actions used: |
In this example, we'll use a simple IF block to make a "Pause" button that works just like the pause button on most audio equipment: press it once to pause, and press it again to unpause.
Here's what the action list looks like:

First, we use an "MP3 - Get Property" action to get the current play state of the global MP3 player.

This stores the current play state ("PLAYING", "PAUSED", "STOPPED" etc.) in a variable which we named %PlayState%.
Next, we test the contents of our variable with a simple "Control Structure - IF" action.

The conditional expression simply compares the value in %PlayState% with the string "PAUSED", which is what the "MP3 - Get Property" action will return when the MP3 player is paused.
We want to resume playing if the MP3 player is paused, so we use an "MP3 - Play" action to resume playing the paused MP3.
Then we use a "Control Structure - ELSE" action to split the IF block into two parts: the part above the ELSE, that will be used if the IF action's condition is true; and the part below the ELSE, that will be used if the IF action's condition is false.
In this case, the "true" part happens if the MP3 is paused, and the "false" part happens if the MP3 is, well, not already paused. (It could be playing, or stopped, or loading...but that doesn't really matter, since the "MP3 - Pause" action already handles all those situations naturally.)
So, after the ELSE, we use an "MP3 - Pause" action to pause the currently-not-paused MP3.
Finally, we end the IF block with a "Control Structure - END IF" action.
Here's a link to the finished example, as an AutoPlay Media Studio 4.0 actions XML file that you can import into an action list:
(Note: save this file to your hard drive and use a tool like WinZip to extract the XML file)