From 7a155ad3f12c13ea421c0f0b79e0645d9e17e894 Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Thu, 30 Aug 2007 22:34:04 +0000 Subject: [PATCH] Parse encoding fields --- Filters/VLMusicXMLType.reader | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Filters/VLMusicXMLType.reader b/Filters/VLMusicXMLType.reader index 8c76511..0c6e2e7 100755 --- a/Filters/VLMusicXMLType.reader +++ b/Filters/VLMusicXMLType.reader @@ -7,6 +7,7 @@ require File.dirname($0)+'/plistWriter' require File.dirname($0)+'/vl' require 'rexml/document' require 'rexml/streamlistener' +require 'time' OUTPUT = {'measures' => []} @@ -58,6 +59,12 @@ class MusicXMLListener @kind = 'textProp' @key = 'groove' end + when 'encoding-date' then + @kind = 'dateProp' + @key = 'saved' + when 'software' then + @kind = 'textProp' + @key = 'software' when 'part' then @part = attrs['id'] || "" @prop = {} @@ -176,6 +183,8 @@ class MusicXMLListener case @kind when 'textProp' then OUTPUT[@key] = @text + when 'dateProp' then + OUTPUT[@key] = Time.parse(@text) when 'prop' then @prop[@key] = @text.to_i when 'mode' then