template.esl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. (lambda (transport s)
  2. (function group () (return
  3. (/h ".btngroup" (Array.prototype.slice.call arguments))))
  4. (function btn (name text highlighted disabled)
  5. (var selector (+ "button.btn." name))
  6. (if (&& highlighted (! disabled)) (+= selector ".green"))
  7. (var attrs (object))
  8. (if (get ./events name) (= attrs.onclick (/emit (get ./events name))))
  9. (if disabled (= attrs.disabled "disabled"))
  10. (return (/h selector attrs text)))
  11. (return (/h ".toolbar" (array
  12. (group
  13. (btn "rewind"
  14. "REW")
  15. (btn (?: transport.rolling "stop" "play")
  16. "PLAY" transport.rolling)
  17. (btn "record"
  18. "REC"))
  19. (group
  20. (btn "server"
  21. "Server" s.server)
  22. (btn "jack"
  23. "JACK" s.jack.started (! s.server))
  24. (btn "fps"
  25. (+ (|| transport.fps "?????") " Hz") false (! s.server)))
  26. (group
  27. (btn "bpm"
  28. (+ (|| transport.bpm "???") " BPM"))
  29. (btn "meter"
  30. (+ (|| transport.meter-top "?") "/"
  31. (|| transport.meter-bottom "?")))
  32. (btn "quant"
  33. "Q 1 bar"))
  34. ))))
  35. ; (/h ".btngroup" (array
  36. ; (/h ".btn.osc" "OSC")
  37. ; (/h ".btn.midi" "MIDI")
  38. ; (/h ".btn.kbd" "KBD")))
  39. ; (/h ".btngroup" (array
  40. ; (/h ".btn.cpu" "CPU")
  41. ; (/h ".btn.mem" "RAM")
  42. ; (/h ".btn.audio" "Audio")))))))