mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Preserve ordering of grooves within a style
This commit is contained in:
parent
c3d4e6d2b8
commit
d33b9ed728
|
@ -21,7 +21,7 @@
|
||||||
[[NSBundle mainBundle] pathForResource:@"Grooves" ofType:@"plist"]];
|
[[NSBundle mainBundle] pathForResource:@"Grooves" ofType:@"plist"]];
|
||||||
fSubStyleFilter =
|
fSubStyleFilter =
|
||||||
[[NSPredicate predicateWithFormat:
|
[[NSPredicate predicateWithFormat:
|
||||||
@"!(SELF like[c] '.DESC') AND !(SELF matches[c] '.*(Intro|End)\\\\d*$')"]
|
@"!(SELF matches[c] '.*(Intro|End)\\\\d*$')"]
|
||||||
retain];
|
retain];
|
||||||
fDocument = [view document];
|
fDocument = [view document];
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
[fSubStyleList release];
|
[fSubStyleList release];
|
||||||
fStyle = [[[fBrowser selectedCellInColumn:0] stringValue] retain];
|
fStyle = [[[fBrowser selectedCellInColumn:0] stringValue] retain];
|
||||||
fSubStyles = [fGrooves objectForKey:fStyle];
|
fSubStyles = [fGrooves objectForKey:fStyle];
|
||||||
fSubStyleList = [[[fSubStyles allKeys]
|
fSubStyleList = [[[fSubStyles objectForKey:@".ORDER"]
|
||||||
filteredArrayUsingPredicate:fSubStyleFilter]
|
filteredArrayUsingPredicate:fSubStyleFilter]
|
||||||
retain];
|
retain];
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ Find.find(ARGV[0]) do |f|
|
||||||
elsif f =~ %r|.*/(\S+?).mma$|
|
elsif f =~ %r|.*/(\S+?).mma$|
|
||||||
style = $1
|
style = $1
|
||||||
g = {}
|
g = {}
|
||||||
|
o = []
|
||||||
doc = ""
|
doc = ""
|
||||||
groove= ""
|
groove= ""
|
||||||
File.open(f) do |file|
|
File.open(f) do |file|
|
||||||
|
@ -33,6 +34,7 @@ Find.find(ARGV[0]) do |f|
|
||||||
elsif line =~ /^\s*DefGroove\s+(\S+)\s+(.+?)\s*$/
|
elsif line =~ /^\s*DefGroove\s+(\S+)\s+(.+?)\s*$/
|
||||||
groove = $1
|
groove = $1
|
||||||
gdoc = $2
|
gdoc = $2
|
||||||
|
o.push(groove)
|
||||||
if gdoc =~ /(.*?)\s+\\\s*$/
|
if gdoc =~ /(.*?)\s+\\\s*$/
|
||||||
gdoc = $1
|
gdoc = $1
|
||||||
inCont = true
|
inCont = true
|
||||||
|
@ -49,7 +51,8 @@ Find.find(ARGV[0]) do |f|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
unless g.empty?
|
unless g.empty?
|
||||||
g[".DESC"] = doc.lstrip
|
g[".DESC"] = doc.lstrip
|
||||||
|
g[".ORDER"] = o
|
||||||
grooves[style] = g
|
grooves[style] = g
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -73,7 +76,15 @@ grooves.each do |style,grooves|
|
||||||
OUT.puts "\t<dict>"
|
OUT.puts "\t<dict>"
|
||||||
grooves.each do |name,desc|
|
grooves.each do |name,desc|
|
||||||
OUT.puts "\t\t<key>#{xmlesc(name)}</key>"
|
OUT.puts "\t\t<key>#{xmlesc(name)}</key>"
|
||||||
OUT.puts "\t\t<string>#{xmlesc(desc)}</string>"
|
if name == ".ORDER"
|
||||||
|
OUT.puts "\t\t<array>"
|
||||||
|
desc.each do |name|
|
||||||
|
OUT.puts "\t\t\t<string>#{xmlesc(name)}</string>"
|
||||||
|
end
|
||||||
|
OUT.puts "\t\t</array>"
|
||||||
|
else
|
||||||
|
OUT.puts "\t\t<string>#{xmlesc(desc)}</string>"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
OUT.puts "\t</dict>"
|
OUT.puts "\t</dict>"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user