Sha256: c22aa25f8add7365fb002a1b647a8eca9b3a1123a23fe231d59c405e4eef9273
Contents?: true
Size: 1.62 KB
Versions: 4
Compression:
Stored size: 1.62 KB
Contents
#include "beeps/ruby/generator.h" #include "beeps/ruby/processor.h" #include "defs.h" RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Oscillator) #define THIS to<Beeps::Oscillator*>(self) #define CHECK RUCY_CHECK_OBJ(Beeps::Oscillator, self) static RUCY_DEF_ALLOC(alloc, klass) { return value(new Beeps::RubyProcessor<Beeps::Oscillator>, klass); } RUCY_END static RUCY_DEF1(set_type, type) { CHECK; THIS->set_type((Beeps::Oscillator::Type) to<uint>(type)); return type; } RUCY_END static RUCY_DEF0(get_type) { CHECK; return value(THIS->type()); } RUCY_END static RUCY_DEF1(set_frequency, frequency) { CHECK; THIS->set_frequency(to<float>(frequency)); return frequency; } RUCY_END static RUCY_DEF0(get_frequency) { CHECK; return value(THIS->frequency()); } RUCY_END static Class cOscillator; void Init_beeps_oscillator () { Module mBeeps = define_module("Beeps"); cOscillator = mBeeps.define_class("Oscillator", Beeps::processor_class()); cOscillator.define_alloc_func(alloc); cOscillator.define_method("type=", set_type); cOscillator.define_method("type", get_type); cOscillator.define_method("frequency=", set_frequency); cOscillator.define_method("frequency", get_frequency); cOscillator.define_const("TYPE_NONE", Beeps::Oscillator::TYPE_NONE); cOscillator.define_const("SINE", Beeps::Oscillator::SINE); cOscillator.define_const("TRIANGLE", Beeps::Oscillator::TRIANGLE); cOscillator.define_const("SQUARE", Beeps::Oscillator::SQUARE); cOscillator.define_const("SAWTOOTH", Beeps::Oscillator::SAWTOOTH); } namespace Beeps { Class oscillator_class () { return cOscillator; } }// Beeps
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
beeps-0.3.3 | ext/beeps/oscillator.cpp |
beeps-0.3.2 | ext/beeps/oscillator.cpp |
beeps-0.3.1 | ext/beeps/oscillator.cpp |
beeps-0.3 | ext/beeps/oscillator.cpp |