You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
935B

  1. require_relative '../module'
  2. module DHE
  3. class Func < DHE::Module
  4. def initialize
  5. super(name: 'FUNC', hp: 3, foreground: [220, 100, 40], background: [40, 50, 96])
  6. center = @width / 2.0
  7. top = 23.0
  8. bottom = 108.0
  9. row_count = 6
  10. last_row = row_count - 1
  11. delta_y = (bottom - top) / last_row
  12. port_offset = 1.25
  13. y = top
  14. input_port(x: center, y: y + port_offset)
  15. y += delta_y
  16. toggle(x: center, y: y, labels: %w(ADD MULT), selection: 1)
  17. y += delta_y
  18. large_knob(x: center, y: y, label: ' ')
  19. y += delta_y
  20. counter(x: center, y: y, name: 'add', labels: %w(0–5 ±5 0–10 ±10), selection: 2)
  21. counter(x: center, y: y, name: 'mult', labels: %w(0–1 ±1 0–2 ±2), selection: 2, enabled: false)
  22. y += 2.0 * delta_y
  23. output_port(x: center, y: y + port_offset)
  24. end
  25. end
  26. end
  27. MODULE_TO_FILENAME[DHE::Func.new] = __FILE__