Sha256: 25806e7a579d0636b9397045c473a60e5646bb0d32f9633b317e4f20f577299f

Contents?: true

Size: 955 Bytes

Versions: 15

Compression:

Stored size: 955 Bytes

Contents

#include "beeps/ruby/processor.h"


#include "defs.h"


RUCY_DEFINE_VALUE_FROM_TO(Beeps::SawtoothWave)

#define THIS  to<Beeps::SawtoothWave*>(self)

#define CHECK RUCY_CHECK_OBJECT(Beeps::SawtoothWave, self)


static
RUCY_DEF_ALLOC(alloc, klass)
{
	return new_type<Beeps::SawtoothWave>(klass);
}
RUCY_END

static
RUCY_DEF1(set_frequency, frequency)
{
	CHECK;
	THIS->set_frequency(frequency.as_f(true));
	return self;
}
RUCY_END

static
RUCY_DEF0(frequency)
{
	CHECK;
	return to<float>(THIS->frequency());
}
RUCY_END


static Class cSawtoothWave;

void
Init_sawtooth_wave ()
{
	Module mBeeps = define_module("Beeps");

	cSawtoothWave = mBeeps.define_class("SawtoothWave", Beeps::processor_class());
	cSawtoothWave.define_alloc_func(alloc);
	cSawtoothWave.define_method("frequency=", set_frequency);
	cSawtoothWave.define_method("frequency",      frequency);
}


namespace Beeps
{


	Class
	sawtooth_wave_class ()
	{
		return cSawtoothWave;
	}


}// Beeps

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
beeps-0.1.29 ext/beeps/sawtooth_wave.cpp
beeps-0.1.28 ext/beeps/sawtooth_wave.cpp
beeps-0.1.27 ext/beeps/sawtooth_wave.cpp
beeps-0.1.26 ext/beeps/sawtooth_wave.cpp
beeps-0.1.25 ext/beeps/sawtooth_wave.cpp
beeps-0.1.24 ext/beeps/sawtooth_wave.cpp
beeps-0.1.23 ext/beeps/sawtooth_wave.cpp
beeps-0.1.22 ext/beeps/sawtooth_wave.cpp
beeps-0.1.21 ext/beeps/sawtooth_wave.cpp
beeps-0.1.20 ext/beeps/sawtooth_wave.cpp
beeps-0.1.18 ext/beeps/sawtooth_wave.cpp
beeps-0.1.16 ext/beeps/sawtooth_wave.cpp
beeps-0.1.15 ext/beeps/sawtooth_wave.cpp
beeps-0.1.14 ext/beeps/sawtooth_wave.cpp
beeps-0.1.13 ext/beeps/sawtooth_wave.cpp