CD Player Action

Declaration

<AMCDPLAYER ACTION="text [options]" DRIVELETTER="text" TRACKS="text" WAIT="yes/no">

See Also

Speak, Play Audio

Description

Controls the CD drive on the system. This is only for audio CD's. To specify multiple tracks when using the "Play Tracks" option, separate the tracks with a dash (e.g. 2-5 will play tracks 2 through 5).

Practical Usage

Used to play a music CD. Common uses include: alarm clock, server audio notification, radio music broadcast system or any other application that requires audio to be played.

Parameters

General Tab

CD ROM Drive to Use

Text, Required
MARKUP:
a) DRIVELETTER="default"
b) DRIVELETTER="f:"

Specifies the drive letter of the CD-ROM that the command should be directed to. If set to "default" the default CD-ROM drive is used.

Action

Options, Required
MARKUP:
a) ACTION="stop"
b) ACTION="play"

Specifies the action that should be performed on the CD-ROM drive.

The available options are:

Tracks

Text, Required
MARKUP:
a) TRACKS="4"
b) TRACKS="2,5,9"
c) TRACKS="1-3"

Valid only when the Action [ACTION] parameter is set to "playtrack". Specifies the tracks that should be played. To specify multiple tracks separate the tracks with a dash (e.g. 2-5 will play tracks 2 through 5) or a comma (e.g. 1,5 will play tracks 1 and 5) .

Wait

Yes/No, Optional Default No
MARKUP: WAIT="ES"

Valid only when Action [ACTION] is set to Play ["play"] or Play Track ["playtrack"]. When set to YES, causes the task to stop at the current step and not move on until the entire CD or the specified tracks have finished playing. When set to NO, CD Player will return and allow the task to continue immediately while the CD is playing.

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMCDPLAYER DRIVELETTER="default" ACTION="previous" WAIT="YES">

<AMCDPLAYER DRIVELETTER="F:" ACTION="play">

<AMCDPLAYER DRIVELETTER="default" ACTION="playtrack" TRACK="1-5" WAIT="YES">