diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-03-14 14:11:22 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-03-27 16:06:07 +0100 |
commit | 777f3406871ec6ea488602c108182444366d9137 (patch) | |
tree | d5342c3933913b5d5273b0f823353c026ebdb002 | |
parent | edcadc2599216491a85e19994bbb0c95ce501540 (diff) | |
download | airwindows-lv2-port-777f3406871ec6ea488602c108182444366d9137.tar.gz airwindows-lv2-port-777f3406871ec6ea488602c108182444366d9137.tar.bz2 airwindows-lv2-port-777f3406871ec6ea488602c108182444366d9137.zip |
LV2/makeplugin: Move type mapping to PluginInfo class.
-rw-r--r-- | plugins/LV2/lib/makeplugin/plugin_info.rb | 16 | ||||
-rwxr-xr-x | plugins/LV2/makeplugin | 14 |
2 files changed, 17 insertions, 13 deletions
diff --git a/plugins/LV2/lib/makeplugin/plugin_info.rb b/plugins/LV2/lib/makeplugin/plugin_info.rb index b9cae0d..0cbc896 100644 --- a/plugins/LV2/lib/makeplugin/plugin_info.rb +++ b/plugins/LV2/lib/makeplugin/plugin_info.rb @@ -24,7 +24,6 @@ module MakePlugin attr_reader :name attr_reader :n_ctrl_ports attr_reader :ctrl_ports - attr_reader :type attr_reader :use attr_reader :desc attr_reader :comment @@ -38,6 +37,21 @@ module MakePlugin end end + def type + case @type + when 'Saturation' + 'DistortionPlugin' + when 'EQ' + 'EQPlugin' + else + 'EffectsPlugin' + end + end + + def raw_type + @type + end + private def find_plugin_info(root) diff --git a/plugins/LV2/makeplugin b/plugins/LV2/makeplugin index ac9c353..809b967 100755 --- a/plugins/LV2/makeplugin +++ b/plugins/LV2/makeplugin @@ -63,23 +63,13 @@ plugin_slug = plugin_name.downcase target_dir = File.join(root, 'src', plugin_name) template_dir = File.join(root, 'Template') -def get_lv2_plugin_type(plugin_info) - case plugin_info.type - when 'Saturation' - 'DistortionPlugin' - when 'EQ' - 'EQPlugin' - else - 'EffectsPlugin' - end -end puts "Reading plugin info from cheatsheet..." pi = MakePlugin::PluginInfo.new(root, plugin_name) puts "Creating plugin #{pi.name}..." -puts "Type: #{pi.type}" +puts "Type: #{pi.type} (#{pi.raw_type})" puts "CTRL ports: #{pi.ctrl_ports.length}" Templates = %w{ @@ -99,7 +89,7 @@ begin .gsub('@NCtrlPorts@', pi.n_ctrl_ports.to_s) .gsub('@AssignParams@', make_param_assigns(pi.n_ctrl_ports)) .gsub('@TTLPortDefs@', make_lv2_port_defs(pi)) - .gsub('@TTLPluginType@', get_lv2_plugin_type(pi)) + .gsub('@TTLPluginType@', pi.type) fname = t.sub('Plugin', pi.name) |