#include "beeps/ruby/filter.h" #include "beeps/ruby/processor.h" #include "defs.h" RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Beeps::TimeStretch) #define THIS to(self) #define CHECK RUCY_CHECK_OBJ(Beeps::TimeStretch, self) static VALUE alloc(VALUE klass) { return value(new Beeps::RubyProcessor, klass); } static VALUE set_scale(VALUE self, VALUE scale) { CHECK; THIS->set_scale(to(scale)); return scale; } static VALUE get_scale(VALUE self) { CHECK; return value(THIS->scale()); } static Class cTimeStretch; void Init_beeps_time_stretch () { Module mBeeps = rb_define_module("Beeps"); cTimeStretch = mBeeps.define_class("TimeStretch", Beeps::processor_class()); rb_define_alloc_func(cTimeStretch, alloc); rb_define_method(cTimeStretch, "scale=", RUBY_METHOD_FUNC(set_scale), 1); rb_define_method(cTimeStretch, "scale", RUBY_METHOD_FUNC(get_scale), 0); } namespace Beeps { Class time_stretch_class () { return cTimeStretch; } }// Beeps