You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
657 B
Lua

local base = string.match(..., "(.-)[^%.]+%.[^%.]+$")
local ffi = require("ffi")
local fh = require(base.."helper.ffi_struct")
local format = string.format
local mt, index = {}, {}
fh.gen_raw_accessor(index, "attack_length")
fh.gen_raw_accessor(index, "attack_level")
fh.gen_raw_accessor(index, "fade_length")
fh.gen_raw_accessor(index, "fade_level")
function index:tostring()
return format(
"ff_envelope{attack_length=%d, attack_level=%d, fade_length=%d, fade_level=%d}",
self.attack_length, self.attack_level, self.fade_length, self.fade_level)
end
mt.__tostring = index.tostring
return fh.base(mt, index, ffi.typeof("struct ff_envelope"))