13
0
livetrax/libs/surfaces/mackie/scripts/generate-surface.rb
Paul Davis 45d3ec1437 merged with 1697 revision of trunk (which is post-rc1 but pre-rc2
git-svn-id: svn://localhost/ardour2/branches/2.1-staging@1698 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-04-11 13:07:51 +00:00

27 lines
779 B
Ruby
Executable File

#! /usr/bin/ruby
require 'erb'
require File.dirname(__FILE__) + '/controls.rb'
cc_template = ''
File.open( File.dirname(__FILE__) + "/surface-cc-template.erb", "r" ) { |f| cc_template = f.read }
h_template = ''
File.open( File.dirname(__FILE__) + "/surface-h-template.erb", "r" ) { |f| h_template = f.read }
sf = Surface.new( ARGV[0] )
control_data = ''
File.open( File.dirname(__FILE__) + "/#{sf.name.downcase}-controls.csv", "r") { |f| control_data = f.read }
sf.parse control_data
@result = ""
erb = ERB.new( cc_template , 0, "%<>-", "@result" )
erb.result
File.open( "#{sf.name.downcase}_surface.cc", "w" ) { |f| f.write @result }
erb = ERB.new( h_template , 0, "%<>-", "@result" )
erb.result
File.open( "#{sf.name.downcase}_surface.h", "w" ) { |f| f.write @result }