diff org/hearing.org @ 340:4f5a5d5f1613

added time dialation display for test suite.
author Robert McIntyre <rlm@mit.edu>
date Sat, 21 Jul 2012 11:18:47 -0500
parents e6233ef22a80
children 516a029e0be9
line wrap: on
line diff
     1.1 --- a/org/hearing.org	Sat Jul 21 10:03:02 2012 -0500
     1.2 +++ b/org/hearing.org	Sat Jul 21 11:18:47 2012 -0500
     1.3 @@ -1027,8 +1027,8 @@
     1.4     hearing. When you play a sound, the bar should display a waveform.
     1.5  
     1.6     Keys:
     1.7 -   <enter> : play sound"
     1.8 -
     1.9 +   <enter> : play sound
    1.10 +       l   : play hymn"
    1.11    ([] (test-worm-hearing false))
    1.12    ([record?] 
    1.13       (let [the-worm (doto (worm) (body!))
    1.14 @@ -1051,14 +1051,17 @@
    1.15                    (if value (.play hymn)))})
    1.16          (fn [world]
    1.17            (light-up-everything world)
    1.18 +          (let [timer (IsoTimer. 60)]
    1.19 +            (.setTimer world timer)
    1.20 +            (display-dilated-time world timer))
    1.21            (if record?
    1.22              (do 
    1.23                (com.aurellem.capture.Capture/captureVideo
    1.24                 world
    1.25 -               (File."/home/r/proj/cortex/render/worm-audio/frames"))
    1.26 +               (File. "/home/r/proj/cortex/render/worm-audio/frames"))
    1.27                (com.aurellem.capture.Capture/captureAudio
    1.28                 world
    1.29 -               (File."/home/r/proj/cortex/render/worm-audio/audio.wav")))))
    1.30 +               (File. "/home/r/proj/cortex/render/worm-audio/audio.wav")))))
    1.31          
    1.32          (fn [world tpf]
    1.33            (hearing-display
    1.34 @@ -1067,6 +1070,9 @@
    1.35               (File. "/home/r/proj/cortex/render/worm-audio/hearing-data"))))))))
    1.36  #+end_src
    1.37  
    1.38 +#+results: test-hearing-2
    1.39 +: #'cortex.test.hearing/test-worm-hearing
    1.40 +
    1.41  In this test, I load the worm with its newly formed ear and let it
    1.42  hear sounds. The sound the worm is hearing is localized to the origin
    1.43  of the world, and you can see that as the worm moves farther away from
    1.44 @@ -1170,9 +1176,13 @@
    1.45    (:import java.io.File)
    1.46    (:import com.jme3.scene.Node
    1.47  	   com.jme3.system.AppSettings
    1.48 -           com.jme3.math.Vector3f))
    1.49 +           com.jme3.math.Vector3f)
    1.50 +  (:import (com.aurellem.capture Capture IsoTimer RatchetTimer)))
    1.51  #+end_src
    1.52  
    1.53 +#+results: test-header
    1.54 +: com.aurellem.capture.RatchetTimer
    1.55 +
    1.56  * Source Listing
    1.57    - [[../src/cortex/hearing.clj][cortex.hearing]]
    1.58    - [[../src/cortex/test/hearing.clj][cortex.test.hearing]]