summaryrefslogtreecommitdiffstats
path: root/test/samples/uscxml/applications/spoken-map-ticker.scxml
blob: 926cd6cafe86d38045bd39f11712d3b651d21578 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<scxml datamodel="ecmascript" name="comet-test"
	xmlns:html="http://www.w3.org/1999/xhtml"
  xmlns:vxml="http://www.w3.org/2001/vxml" 
	xmlns="http://www.w3.org/2005/07/scxml">

	<script src="http://uscxml.tk.informatik.tu-darmstadt.de/scripts/dump.js" />

	<state id="start">
		<invoke type="xhtml" id="xhtml1">
			<content src="spoken-map-ticker.xhtml" />
			<finalize>
				<!-- <script>dump(_event);</script> -->
			</finalize>
		</invoke>
		
		<invoke type="vxml" id="vxml" />
		
		<invoke type="umundo" id="umundo">
			<param name="channel" expr="'map/tick'" />
			<finalize>
				<script>dump(_event);</script>
			</finalize>
		</invoke>
		
		<invoke type="openal" id="audio">
			<!-- <param name="maxX" expr="180" />
			<param name="maxY" expr="18" />
			<param name="maxZ" expr="85" /> -->
		</invoke>
		
		<state id="idle">
			<transition target="idle" event="map.center">
				<send event="move.listener" target="#_audio">
					<param name="x" expr="_event.data.lon" />
					<param name="y" expr="18 - _event.data.zoom" />
					<!-- <param name="y" expr="0" /> -->
					<param name="z" expr="_event.data.lat" />

				</send>
			</transition>
			<transition target="idle" event="umundo.rcvd">
				<send target="#_xhtml1">
					<content>${_event.data}</content>
				</send>
				<send target="#_audio" event="play" delay="0ms">
					<param name="src" expr="'../audio/click.wav'" />
					<param name="x" expr="_event.data.lon" />
					<param name="y" expr="0" />
					<param name="z" expr="_event.data.lat" />
				</send>
				
				<if cond="_event.data.message &amp;&amp; _event.data.severity &gt; 8">
					<send target="#_vxml">
						<content>
							<vxml:prompt>
								${_event.data.message}
							</vxml:prompt>
						</content>
					</send>
				</if>
				
			</transition>
		</state>		
	</state>
</scxml>