From 84db28be5081d7489925742652ca17a5b25dd3a9 Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Thu, 15 Jul 2010 18:29:48 +0200
Subject: [PATCH] Handle all five types of barlines (and repeat barlines)

---
 pae2xml.pl                      | 39 +++++++++++++++++++++++++++------
 sample_files/Barlines-basic.pae |  7 ++++++
 2 files changed, 39 insertions(+), 7 deletions(-)
 create mode 100644 sample_files/Barlines-basic.pae

diff --git a/pae2xml.pl b/pae2xml.pl
index 4648fb3..e67b4ed 100755
--- a/pae2xml.pl
+++ b/pae2xml.pl
@@ -288,20 +288,45 @@ sub parse_notes {
       $timesig = timesignature($timesig);
       print OUT "			<attributes>\n$timesig
 			</attributes>\n";
-    } elsif ($notes =~ /^\/(.*)$/) {
-      $notes = $1;
-      if ($notes =~ /^\/(.*)$/) {
-	$notes = $1;
-	print OUT '       <barline location="right">
+    } elsif ($notes =~ /^(:?\/+:?)(.*)$/) {
+      $barline = $1;
+      $notes = $2;
+      if ($barline =~ /^:\/\/:/) {
+	print OUT '			<barline location="right">
 				<bar-style>light-light</bar-style>
-
+				<repeat direction="backward"/>
+			</barline>
+';
+      } elsif ($barline =~ /^:\/\/$/ ) {
+	  print OUT '			<barline location="right">
+				<bar-style>light-heavy</bar-style>
+				<repeat direction="backward"/>
+			</barline>
+';
+      } elsif ($barline =~ /^\/\/$/) {
+        print OUT '			<barline location="right">
+				<bar-style>light-light</bar-style>
+				<repeat direction="backward"/>
 			</barline>
 ';
       }
       print OUT "		</measure>\n";
       if ($notes ne "") {
 	print OUT '		<measure number="'.$meas.'">
-'.$clefattr;
+';
+        if ($barline =~ /^\/\/:$/) {
+          print OUT '			<barline location="left">
+				<bar-style>heavy-light</bar-style>
+				<repeat direction="forward"/>
+			</barline>
+';
+        } elsif ($barline =~ /^:\/\/:$/) {
+	  print OUT '			<barline location="left">
+				<repeat direction="forward"/>
+			</barline>
+';
+	}
+	print OUT $clefattr;
 	$meas++;
       } else {
 	$mopen = 0;
diff --git a/sample_files/Barlines-basic.pae b/sample_files/Barlines-basic.pae
new file mode 100644
index 0000000..5fe639a
--- /dev/null
+++ b/sample_files/Barlines-basic.pae
@@ -0,0 +1,7 @@
+Test Composer
+Test case for barline types
+1.1.1: S One repeat
+plain&easy: %C-1@c$bB� '4CDE/GABG://CDEF//:GABD//FGAB://:AGFC://
+
+Test Library
+00000000
\ No newline at end of file
-- 
GitLab