Sha256: 0aee2bd7a29e0d4b6cb0c94a0c5158ce007e212cff6d9d5241773f6df14798fc

Contents?: true

Size: 884 Bytes

Versions: 3

Compression:

Stored size: 884 Bytes

Contents

#include "beeps/ruby/sound.h"


#include "defs.h"


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_beeps_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.32 ext/beeps/sound.cpp
beeps-0.1.31 ext/beeps/sound.cpp
beeps-0.1.30 ext/beeps/sound.cpp