Class: PM::TriggerWindow

Inherits:
PmWindow
  • Object
show all
Includes:
Curses
Defined in:
lib/patchmaster/curses/trigger_window.rb

Instance Attribute Summary

Attributes inherited from PmWindow

#title, #title_prefix, #win

Instance Method Summary collapse

Methods inherited from PmWindow

#make_fit, #move_and_resize, #set_max_contents_len, #visible_height

Constructor Details

#initialize(rows, cols, row, col) ⇒ TriggerWindow

Returns a new instance of TriggerWindow.



8
9
10
11
# File 'lib/patchmaster/curses/trigger_window.rb', line 8

def initialize(rows, cols, row, col)
  super(rows, cols, row, col, nil)
  @title = 'Triggers '
end

Instance Method Details

#drawObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/patchmaster/curses/trigger_window.rb', line 13

def draw
  super
  pm = PM::PatchMaster.instance
  i = 0
  pm.inputs.each do |instrument|
    instrument.triggers.each do |trigger|
      if i < visible_height
        @win.setpos(i+1, 1)
        @win.addstr(make_fit(":#{instrument.sym} #{trigger.to_s}"))
      end
      i += 1
    end
  end
end