#include "beeps/ruby/filter.h" #include "beeps/ruby/processor.h" #include "defs.h" RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Beeps::PitchShift) #define THIS to(self) #define CHECK RUCY_CHECK_OBJ(Beeps::PitchShift, self) static VALUE alloc(VALUE klass) { return value(new Beeps::RubyProcessor, klass); } static VALUE set_shift(VALUE self, VALUE shift) { CHECK; THIS->set_shift(to(shift)); return shift; } static VALUE get_shift(VALUE self) { CHECK; return value(THIS->shift()); } static Class cPitchShift; void Init_beeps_pitch_shift () { Module mBeeps = rb_define_module("Beeps"); cPitchShift = mBeeps.define_class("PitchShift", Beeps::processor_class()); rb_define_alloc_func(cPitchShift, alloc); rb_define_method(cPitchShift, "shift=", RUBY_METHOD_FUNC(set_shift), 1); rb_define_method(cPitchShift, "shift", RUBY_METHOD_FUNC(get_shift), 0); } namespace Beeps { Class pitch_shift_class () { return cPitchShift; } }// Beeps