#include "beeps/ruby/filter.h" #include "beeps/ruby/processor.h" #include "defs.h" RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Beeps::Gain) #define THIS to(self) #define CHECK RUCY_CHECK_OBJ(Beeps::Gain, self) static VALUE alloc(VALUE klass) { return value(new Beeps::RubyProcessor, klass); } static VALUE set_gain(VALUE self, VALUE gain) { CHECK; THIS->set_gain(to(gain)); return gain; } static VALUE get_gain(VALUE self) { CHECK; return value(THIS->gain()); } static Class cGain; void Init_beeps_gain () { Module mBeeps = rb_define_module("Beeps"); cGain = mBeeps.define_class("Gain", Beeps::processor_class()); rb_define_alloc_func(cGain, alloc); rb_define_method(cGain, "gain=", RUBY_METHOD_FUNC(set_gain), 1); rb_define_method(cGain, "gain", RUBY_METHOD_FUNC(get_gain), 0); } namespace Beeps { Class gain_class () { return cGain; } }// Beeps