Class: Lydown::Rendering::Barline

Inherits:
Base
  • Object
show all
Defined in:
lib/lydown/rendering/music.rb

Constant Summary collapse

LILYPOND_BARLINES =
{
  '|:' => '.|:',
  ':|' => ':|.',
  '|\''=> '\halfBarline',
  '?|' => ''
}

Instance Method Summary collapse

Methods inherited from Base

#find_prev_event, #initialize, #next_event, #prev_event

Constructor Details

This class inherits a constructor from Lydown::Rendering::Base

Instance Method Details

#translateObject



290
291
292
293
294
295
296
297
298
# File 'lib/lydown/rendering/music.rb', line 290

def translate
  barline = @event[:barline]
  barline = LILYPOND_BARLINES[barline] || barline
  if barline =~ /^\\/
    @context.emit(:music, "#{barline} ")
  else
    @context.emit(:music, "\\bar \"#{barline}\" ")
  end
end