mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Parse encoding fields
This commit is contained in:
parent
af0a03ab7d
commit
7a155ad3f1
|
@ -7,6 +7,7 @@ require File.dirname($0)+'/plistWriter'
|
||||||
require File.dirname($0)+'/vl'
|
require File.dirname($0)+'/vl'
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
require 'rexml/streamlistener'
|
require 'rexml/streamlistener'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
OUTPUT = {'measures' => []}
|
OUTPUT = {'measures' => []}
|
||||||
|
|
||||||
|
@ -58,6 +59,12 @@ class MusicXMLListener
|
||||||
@kind = 'textProp'
|
@kind = 'textProp'
|
||||||
@key = 'groove'
|
@key = 'groove'
|
||||||
end
|
end
|
||||||
|
when 'encoding-date' then
|
||||||
|
@kind = 'dateProp'
|
||||||
|
@key = 'saved'
|
||||||
|
when 'software' then
|
||||||
|
@kind = 'textProp'
|
||||||
|
@key = 'software'
|
||||||
when 'part' then
|
when 'part' then
|
||||||
@part = attrs['id'] || ""
|
@part = attrs['id'] || ""
|
||||||
@prop = {}
|
@prop = {}
|
||||||
|
@ -176,6 +183,8 @@ class MusicXMLListener
|
||||||
case @kind
|
case @kind
|
||||||
when 'textProp' then
|
when 'textProp' then
|
||||||
OUTPUT[@key] = @text
|
OUTPUT[@key] = @text
|
||||||
|
when 'dateProp' then
|
||||||
|
OUTPUT[@key] = Time.parse(@text)
|
||||||
when 'prop' then
|
when 'prop' then
|
||||||
@prop[@key] = @text.to_i
|
@prop[@key] = @text.to_i
|
||||||
when 'mode' then
|
when 'mode' then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user