Method: PM::PatchWindow#draw_connection

Defined in:
lib/patchmaster/curses/patch_window.rb

#draw_connection(connection) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/patchmaster/curses/patch_window.rb', line 34

def draw_connection(connection)
  str =  " #{'%16s' % connection.input.name}"
  str << " #{connection.input_chan ? ('%2d' % (connection.input_chan+1)) : '  '} |"
  str << " #{'%16s' % connection.output.name}"
  str << " #{'%2d' % (connection.output_chan+1)} |"
  str << if connection.pc?
           "  #{'%3d' % connection.pc_prog} |"
         else
           "      |"
         end
  str << if connection.zone
           " #{'%3s' % connection.note_num_to_name(connection.zone.begin)}" +
           " - #{'%3s' % connection.note_num_to_name(connection.zone.end)} |"
         else
           '           |'
         end
  str << if connection.xpose && connection.xpose != 0
           "   #{connection.xpose < 0 ? '' : ' '}#{'%2d' % connection.xpose.to_i} |"
         else
           "       |"
         end
  str << " #{filter_string(connection.filter)}"
  @win.addstr(make_fit(str))
end