mirror of
https://github.com/microtherion/VocalEasel.git
synced 2025-01-12 13:13:59 +00:00
Improve robustness
This commit is contained in:
parent
7a155ad3f1
commit
5696f5d649
|
@ -35,10 +35,14 @@ def _identification
|
||||||
poet.add_attribute('type', 'poet')
|
poet.add_attribute('type', 'poet')
|
||||||
ident.add_element(poet)
|
ident.add_element(poet)
|
||||||
encoding = REXML::Element.new('encoding')
|
encoding = REXML::Element.new('encoding')
|
||||||
date = newTextElement('encoding-date', INPUT['saved'].strftime("%Y-%m-%d"))
|
if INPUT['saved']
|
||||||
encoding.add_element(date)
|
date = newTextElement('encoding-date', INPUT['saved'].strftime("%Y-%m-%d"))
|
||||||
software = newTextElement('software', INPUT['software'])
|
encoding.add_element(date)
|
||||||
encoding.add_element(software)
|
end
|
||||||
|
if INPUT['software']
|
||||||
|
software = newTextElement('software', INPUT['software']) if INPUT['software']
|
||||||
|
encoding.add_element(software)
|
||||||
|
end
|
||||||
ident.add_element(encoding)
|
ident.add_element(encoding)
|
||||||
|
|
||||||
return ident
|
return ident
|
||||||
|
@ -215,7 +219,7 @@ def _melody
|
||||||
end
|
end
|
||||||
meas['melody'].each do |note|
|
meas['melody'].each do |note|
|
||||||
dur = (note['durNum'] * $DIVISIONS * 4) / note['durDenom']
|
dur = (note['durNum'] * $DIVISIONS * 4) / note['durDenom']
|
||||||
n = _note(note['pitch'], dur, note['tied'])
|
n = _note(note['pitch'], dur, note['tied'] || 0)
|
||||||
stanza = 1
|
stanza = 1
|
||||||
note['lyrics'].each do |syll|
|
note['lyrics'].each do |syll|
|
||||||
if syll['text']
|
if syll['text']
|
||||||
|
@ -226,7 +230,7 @@ def _melody
|
||||||
n.add_element(lyr)
|
n.add_element(lyr)
|
||||||
end
|
end
|
||||||
stanza += 1
|
stanza += 1
|
||||||
end
|
end if note['lyrics']
|
||||||
m.add_element(n)
|
m.add_element(n)
|
||||||
end
|
end
|
||||||
if r = meas['end-repeat']
|
if r = meas['end-repeat']
|
||||||
|
|
|
@ -47,7 +47,7 @@ class PlistListener
|
||||||
def text(text)
|
def text(text)
|
||||||
case @kind
|
case @kind
|
||||||
when "string", "key" then
|
when "string", "key" then
|
||||||
@obj = text
|
@obj += text
|
||||||
when "data" then
|
when "data" then
|
||||||
@obj = Base64.decode(text)
|
@obj = Base64.decode(text)
|
||||||
when "date" then
|
when "date" then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user