Class: Zgomot::UI::Output

Inherits:
Object show all
Defined in:
lib/zgomot/ui/output.rb

Constant Summary collapse

HEADER_COLOR =
'#666666'
STREAM_OUTPUT_FORMAT_WIDTHS =
[30, 9, 6, 11, 9, 8, 7]
STREAM_HEADER =
%w(Name Status Chan Time Count Limit Delay)
STREAM_STATUS_PLAY_COLOR =
'#19D119'
STREAM_STATUS_PAUSE_COLOR =
'#EAC117'
CC_OUTPUT_FORMAT_WIDTHS =
[30, 10, 8, 8, 8, 8, 8]
CC_HEADER =
%w(Name Value CC Chan Type Max Min)
CC_COLOR =
'#EAC117'
CONFIG_COLOR =
'#EAC117'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cc_mgrObject (readonly)

Returns the value of attribute cc_mgr.



16
17
18
# File 'lib/zgomot/ui/output.rb', line 16

def cc_mgr
  @cc_mgr
end

.clk_mgrObject (readonly)

Returns the value of attribute clk_mgr.



16
17
18
# File 'lib/zgomot/ui/output.rb', line 16

def clk_mgr
  @clk_mgr
end

.stream_mgrObject (readonly)

Returns the value of attribute stream_mgr.



16
17
18
# File 'lib/zgomot/ui/output.rb', line 16

def stream_mgr
  @stream_mgr
end

Class Method Details

.lcc(name = nil) ⇒ Object



21
22
23
24
# File 'lib/zgomot/ui/output.rb', line 21

def lcc(name=nil)
  puts format_for_color(CC_OUTPUT_FORMAT_WIDTHS, HEADER_COLOR) % color(CC_HEADER, HEADER_COLOR)
  format_ccs(name).each{|cc| puts cc}; nil
end

.lconfigObject



25
26
27
28
29
30
31
# File 'lib/zgomot/ui/output.rb', line 25

def lconfig
  format = '%-35s %-25s'
  puts format % ['Time Signature'.foreground(HEADER_COLOR), clk_mgr.time_signature.foreground(CONFIG_COLOR)]
  puts format % ['Beats/Minute'.foreground(HEADER_COLOR), clk_mgr.beats_per_minute.to_i.to_s.foreground(CONFIG_COLOR)]
  puts format % ['Resolution'.foreground(HEADER_COLOR), "1/#{clk_mgr.resolution.to_i}".foreground(CONFIG_COLOR)]
  puts format % ['Seconds/Beat'.foreground(HEADER_COLOR), clk_mgr.beat_sec.to_s.foreground(CONFIG_COLOR)]
end

.lstr(name = nil) ⇒ Object



17
18
19
20
# File 'lib/zgomot/ui/output.rb', line 17

def lstr(name=nil)
  puts format_for_color(STREAM_OUTPUT_FORMAT_WIDTHS, HEADER_COLOR) % color(STREAM_HEADER, HEADER_COLOR)
  format_streams(name).each{|stream| puts stream}; nil
end