source: release-kits/lirk3/bin/ant-installer/web/manual/manual/OptionalTasks/sound.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 4.0 KB
Line 
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<html>
18
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>Sound Task</title>
23</head>
24
25<body>
26
27<h2><a name="sound">Sound</a></h2>
28<h3>Description</h3>
29<p>Plays a sound-file at the end of the build, according to whether
30the build failed or succeeded. You can specify either a specific
31sound-file to play, or, if a directory is specified, the
32<code>&lt;sound&gt;</code> task will randomly select a file to play.
33Note: At this point, the random selection is based on all the files
34in the directory, not just those ending in appropriate suffixes
35for sound-files, so be sure you only have sound-files in the
36directory you specify.</p>
37<p>
38Unless you are running on Java 1.3 or later, you need the Java Media Framework
39on the classpath (javax.sound).
40</p>
41
42
43<h3>Nested Elements</h3>
44<h4>success</h4>
45<p>Specifies the sound to be played if the build succeeded.</p>
46<h4>fail</h4>
47<p>Specifies the sound to be played if the build failed.</p>
48
49<h3>Nested Element Parameters</h3>
50<p>
51The following attributes may be used on the <code>&lt;success&gt;</code>
52and <code>&lt;fail&gt;</code> elements:</p>
53<table border="1" cellpadding="2" cellspacing="0">
54 <tr>
55 <td valign="top"><b>Attribute</b></td>
56 <td valign="top"><b>Description</b></td>
57 <td align="center" valign="top"><b>Required</b></td>
58 </tr>
59 <tr>
60 <td valign="top">source</td>
61 <td valign="top">the path to a sound-file directory, or the name of a
62specific sound-file, to be played.
63 </td>
64 <td valign="top" align="center">Yes</td>
65 </tr>
66 <tr>
67 <td valign="top">loops</td>
68 <td valign="top">the number of extra times to play the sound-file;
69 default is <code>0</code>.
70 </td>
71 <td valign="top" align="center">No</td>
72 </tr>
73 <tr>
74 <td valign="top">duration</td>
75 <td valign="top">the amount of time (in milliseconds) to play
76 the sound-file.
77 </td>
78 <td valign="top" align="center">No</td>
79 </tr>
80</table>
81
82<h3>Examples</h3>
83<blockquote>
84<pre>
85&lt;target name=&quot;fun&quot; if=&quot;fun&quot; unless=&quot;fun.done&quot;&gt;
86 &lt;sound&gt;
87 &lt;success source=&quot;${user.home}/sounds/bell.wav&quot;/&gt;
88 &lt;fail source=&quot;${user.home}/sounds/ohno.wav&quot; loops=&quot;2&quot;/&gt;
89 &lt;/sound&gt;
90 &lt;property name=&quot;fun.done&quot; value=&quot;true&quot;/&gt;
91&lt;/target&gt;
92</pre>
93</blockquote>
94plays the <code>bell.wav</code> sound-file if the build succeeded, or
95the <code>ohno.wav</code> sound-file if the build failed, three times,
96if the <code>fun</code> property is set to <code>true</code>.
97If the target
98is a dependency of an &quot;initialization&quot; target that other
99targets depend on, the
100<code>fun.done</code> property prevents the target from being executed
101more than once.
102<blockquote>
103<pre>
104&lt;target name=&quot;fun&quot; if=&quot;fun&quot; unless=&quot;fun.done&quot;&gt;
105 &lt;sound&gt;
106 &lt;success source=&quot;//intranet/sounds/success&quot;/&gt;
107 &lt;fail source=&quot;//intranet/sounds/failure&quot;/&gt;
108 &lt;/sound&gt;
109 &lt;property name=&quot;fun.done&quot; value=&quot;true&quot;/&gt;
110&lt;/target&gt;
111</pre>
112</blockquote>
113randomly selects a sound-file to play when the build succeeds or fails.
114
115
116
117</body>
118</html>
119
Note: See TracBrowser for help on using the repository browser.