aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LV2/lib/makeplugin/plugin_info.rb
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/LV2/lib/makeplugin/plugin_info.rb')
-rw-r--r--plugins/LV2/lib/makeplugin/plugin_info.rb25
1 files changed, 19 insertions, 6 deletions
diff --git a/plugins/LV2/lib/makeplugin/plugin_info.rb b/plugins/LV2/lib/makeplugin/plugin_info.rb
index 686a8e8..0cb945c 100644
--- a/plugins/LV2/lib/makeplugin/plugin_info.rb
+++ b/plugins/LV2/lib/makeplugin/plugin_info.rb
@@ -32,12 +32,13 @@ module MakePlugin
def initialize(root, name)
@name = name
- @ctrl_ports = []
+ @ctrl_ports = {}
@var_decls = []
@var_inits = []
self.find_plugin_info(root)
if @n_ctrl_ports != @ctrl_ports.length
- raise "Expected #{@n_ctrl_ports} but found #{@ctrl_ports.length}"
+ pp @ctrl_ports
+ raise "Expected #{@n_ctrl_ports} control ports, but found #{@ctrl_ports.length}"
end
end
@@ -121,12 +122,10 @@ module MakePlugin
File.open(class_file) do |f|
f.each_line do |line|
- if line =~ /void #{@name}::(\w+)/
- fun = $1
+ if line =~ /^(void|float) #{@name}::(\w+)/
+ fun = $2
elsif line =~ /^#{@name}::#{@name}/
fun = 'constructor_'
- elsif fun == 'getParameterName' and line =~ /case\s+kParam([A-Z])\:\s+vst_strncpy\s*\([^,]*,\s*\"([^"]+)\",/
- @ctrl_ports << { sym: $1, name: $2 }
elsif fun == 'constructor_' and line =~ /\{\s*$/
fun = 'constructor'
elsif fun == 'constructor'
@@ -135,6 +134,20 @@ module MakePlugin
else
@var_inits << line.chomp
end
+ elsif fun == 'getParameterName' and line =~ /case\s+kParam([A-Z])\:\s+vst_strncpy\s*\([^,]*,\s*\"([^"]+)\",/
+ puts "getParameterName(#{$1}, #{$2})"
+ if @ctrl_ports.has_key?($1)
+ @ctrl_ports[$1][:name] = $2
+ else
+ @ctrl_ports[$1] = { name: $2 }
+ end
+ elsif fun == 'getParameter' and line =~ /case\s+kParam([A-Z])\: return (\w+);/
+ puts "getParameter(#{$1}, #{$2})"
+ if @ctrl_ports.has_key?($1)
+ @ctrl_ports[$1][:sym] = $2
+ else
+ @ctrl_ports[$1] = { sym: $2 }
+ end
end
end
end