Sha256: f9645fb5c9b0ecb8368c7f6f31c634ac982c8717d819be718c9a94e277d13a63
Contents?: true
Size: 949 Bytes
Versions: 3
Compression:
Stored size: 949 Bytes
Contents
#include "beeps/ruby/sound.h" #include <rucy.h> #include "beeps/exception.h" #include "defs.h" using namespace Rucy; RUCY_DEFINE_VALUE_FROM_TO(Beeps::Sound) #define THIS to<Beeps::Sound*>(self) #define CHECK RUCY_CHECK_OBJECT(Beeps::Sound, self) static RUCY_DEF_ALLOC(alloc, klass) { return new_type<Beeps::Sound>(klass); } RUCY_END static RUCY_DEF2(initialize, processor, seconds) { RUCY_CHECK_OBJ(Beeps::Sound, self); *THIS = Beeps::Sound(to<Beeps::Processor*>(processor), to<float>(seconds)); return self; } RUCY_END static RUCY_DEF0(play) { CHECK; THIS->play(); return self; } RUCY_END static Class cSound; void Init_sound () { Module mBeeps = define_module("Beeps"); cSound = mBeeps.define_class("Sound"); cSound.define_alloc_func(alloc); cSound.define_private_method("initialize", initialize); cSound.define_method("play", play); } namespace Beeps { Class sound_class () { return cSound; } }// Beeps
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
beeps-0.1.12 | ext/beeps/sound.cpp |
beeps-0.1.11 | ext/beeps/sound.cpp |
beeps-0.1.10 | ext/beeps/sound.cpp |