From d33b9ed7281a3a3e9412c464bb816550285f21f5 Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Wed, 2 May 2007 05:28:22 +0000 Subject: [PATCH] Preserve ordering of grooves within a style --- Sources/VLGrooveController.mm | 4 ++-- Tools/rebuildGrooves | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Sources/VLGrooveController.mm b/Sources/VLGrooveController.mm index e4230d5..802f116 100644 --- a/Sources/VLGrooveController.mm +++ b/Sources/VLGrooveController.mm @@ -21,7 +21,7 @@ [[NSBundle mainBundle] pathForResource:@"Grooves" ofType:@"plist"]]; fSubStyleFilter = [[NSPredicate predicateWithFormat: - @"!(SELF like[c] '.DESC') AND !(SELF matches[c] '.*(Intro|End)\\\\d*$')"] + @"!(SELF matches[c] '.*(Intro|End)\\\\d*$')"] retain]; fDocument = [view document]; @@ -78,7 +78,7 @@ [fSubStyleList release]; fStyle = [[[fBrowser selectedCellInColumn:0] stringValue] retain]; fSubStyles = [fGrooves objectForKey:fStyle]; - fSubStyleList = [[[fSubStyles allKeys] + fSubStyleList = [[[fSubStyles objectForKey:@".ORDER"] filteredArrayUsingPredicate:fSubStyleFilter] retain]; } diff --git a/Tools/rebuildGrooves b/Tools/rebuildGrooves index 904f2ae..08170bf 100755 --- a/Tools/rebuildGrooves +++ b/Tools/rebuildGrooves @@ -16,6 +16,7 @@ Find.find(ARGV[0]) do |f| elsif f =~ %r|.*/(\S+?).mma$| style = $1 g = {} + o = [] doc = "" groove= "" File.open(f) do |file| @@ -33,6 +34,7 @@ Find.find(ARGV[0]) do |f| elsif line =~ /^\s*DefGroove\s+(\S+)\s+(.+?)\s*$/ groove = $1 gdoc = $2 + o.push(groove) if gdoc =~ /(.*?)\s+\\\s*$/ gdoc = $1 inCont = true @@ -49,7 +51,8 @@ Find.find(ARGV[0]) do |f| end end unless g.empty? - g[".DESC"] = doc.lstrip + g[".DESC"] = doc.lstrip + g[".ORDER"] = o grooves[style] = g end end @@ -73,7 +76,15 @@ grooves.each do |style,grooves| OUT.puts "\t" grooves.each do |name,desc| OUT.puts "\t\t#{xmlesc(name)}" - OUT.puts "\t\t#{xmlesc(desc)}" + if name == ".ORDER" + OUT.puts "\t\t" + desc.each do |name| + OUT.puts "\t\t\t#{xmlesc(name)}" + end + OUT.puts "\t\t" + else + OUT.puts "\t\t#{xmlesc(desc)}" + end end OUT.puts "\t" end