annotate WebContent/index.jsp @ 67:b8f8ed1ef8dd tip

Provide .wav suffix in delivered filename
author Chris Cannam
date Tue, 30 Sep 2014 16:52:50 +0100
parents 55ce07768e33
children
rev   line source
luis@0 1 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
luis@32 2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
luis@0 3 <html>
Chris@42 4 <head>
Chris@42 5 <title>Human Echolocation</title>
Chris@42 6 <link href="http://fonts.googleapis.com/css?family=Mako" rel="stylesheet" type="text/css">
Chris@42 7 <link href="screen.css" rel="stylesheet" type="text/css" />
luis@27 8
Chris@42 9 <!-- no default value for distance -->
Chris@42 10 <c:choose>
Chris@42 11 <c:when test="${not empty param.dist}">
Chris@42 12 <c:set var="dist" value="${param.dist}" />
Chris@42 13 <c:set var="distSet" value="true" />
Chris@42 14 </c:when>
Chris@42 15 <c:otherwise>
Chris@42 16 <c:set var="distSet" value="false" />
Chris@42 17 </c:otherwise>
Chris@42 18 </c:choose>
luis@32 19
Chris@42 20 <!-- Default values for remaining parameters -->
Chris@42 21 <c:set var="azim" value="0" />
Chris@42 22 <c:set var="dirweight" value="0.2" />
Chris@42 23 <c:set var="orient" value="horz" />
luis@38 24
Chris@42 25 <c:if test="${not empty param.azim}">
Chris@42 26 <c:set var="azim" value="${param.azim}" />
Chris@42 27 </c:if>
Chris@42 28 <c:if test="${not empty param.dirweight}">
Chris@42 29 <c:set var="dirweight" value="${param.dirweight}" />
Chris@42 30 </c:if>
Chris@42 31 <c:if test="${not empty param.orient}">
Chris@42 32 <c:set var="orient" value="${param.orient}" />
Chris@42 33 </c:if>
luis@32 34
Chris@42 35 </head>
luis@0 36
Chris@42 37 <body>
Chris@42 38 <!-- NB the form submits back to this very page -->
Chris@42 39 <form action="index.jsp" method="get">
Chris@42 40 <table width="100%" cellpadding="0" cellspacing="0">
Chris@42 41 <tr>
Chris@42 42 <td align="right"><img src="soton-logo.png" alt="University of Southampton"/></td>
Chris@42 43 </tr>
Chris@42 44 </table>
Chris@42 45 <br />
Chris@42 46
Chris@42 47 <h1>Human Echolocation WebApp Test Page</h1>
Chris@42 48
Chris@42 49 <h2>Simulated environment</h2>
Chris@42 50 <table>
Chris@42 51 <tr>
Chris@42 52 <th>Distance<br>
Chris@42 53 <span class="description">In metres. Typical value: 0.9</span>
Chris@42 54 </th>
Chris@42 55 <td><input type="text" name="dist" size="8" value="${dist}"></td>
Chris@42 56 </tr>
Chris@42 57 <tr>
Chris@42 58 <th>Azimuth<br>
Chris@58 59 <span class="description">-90 to +90</span>
Chris@42 60 </th>
Chris@42 61 <td><input type="text" name="azim" size="8" value="${azim}" ></td>
Chris@42 62 </tr>
Chris@42 63 <tr>
Chris@42 64 <th>Orientation</th>
Chris@42 65 <td>
Chris@42 66 <input type="radio" name="orient" value="horz" checked> Horizontal<br>
Chris@42 67 <input type="radio" name="orient" value="angled"> Angled
Chris@42 68 </td>
Chris@42 69 </tr>
Chris@42 70 <tr>
Chris@42 71 <th>Dirweight<br>
Chris@42 72 <span class="description">Controls how easy it is to distinguish whether the reflector is to the left or the right (the lower dirweight is, the easier).</span>
Chris@42 73 </th>
Chris@42 74 <td>
Chris@42 75 <input type="text" name="dirweight" size="8" value="${dirweight}">
Chris@42 76 <br />
Chris@42 77 </td>
Chris@42 78 </tr>
Chris@42 79 <tr>
Chris@42 80 <td></td>
Chris@42 81 <td>
Chris@42 82 <input type="submit" value="Generate audio">
Chris@42 83 </td>
Chris@42 84 </tr>
Chris@42 85 </table>
Chris@42 86 </form>
luis@27 87
Chris@42 88 <div class="player">
Chris@42 89 <c:choose>
Chris@42 90 <c:when test="${distSet==true}">
Chris@56 91 <audio src="/echoapp/HumanEcho?dist=<c:out value="${dist}"/>&amp;azim=<c:out value="${azim}"/>&amp;dirweight=<c:out value="${dirweight}"/>&amp;orient=<c:out value="${orient}"/>" id="generated" controls preload="yes" autobuffer></audio>
Chris@42 92 </c:when>
Chris@42 93 <c:otherwise>
Chris@42 94 <c:out value="Please set the distance parameter and select 'Generate audio'"/>
Chris@42 95 </c:otherwise>
Chris@42 96 </c:choose>
Chris@42 97 </div>
Chris@42 98 <br />
luis@0 99
Chris@42 100 <div class="debug">
Chris@42 101 <h3>Debug info</h3>
Chris@42 102 <p>
Chris@42 103 Distance: <c:out value="${dist}"/>;
Chris@42 104 Azim: <c:out value="${azim}"/>;
Chris@42 105 Dirweight: <c:out value="${dirweight}"/>;
Chris@42 106 Orient: <c:out value="${orient}"/>
Chris@42 107 </p>
Chris@42 108 </div>
luis@39 109
Chris@42 110 </body>
luis@0 111 </html>
luis@0 112