Sha256: 3be010295c8694d75becd68d9466f5321df20e40b123dd30bbf674ca18445813

Contents?: true

Size: 1.19 KB

Versions: 16

Compression:

Stored size: 1.19 KB

Contents

#include "beeps/ruby/generator.h"


#include "beeps/ruby/processor.h"
#include "defs.h"


RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Beeps::MicIn)

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

#define CHECK RUCY_CHECK_OBJ(Beeps::MicIn, self)


static
VALUE alloc(VALUE klass)
{
	return value(new Beeps::RubyProcessor<Beeps::MicIn>, klass);
}

static
VALUE start(VALUE self)
{
	CHECK;

	THIS->start();
	return self;
}

static
VALUE stop(VALUE self)
{
	CHECK;

	THIS->stop();
	return self;
}

static
VALUE get_sample_rate(VALUE self)
{
	CHECK;

	return value(THIS->sample_rate());
}

static
VALUE get_nchannels(VALUE self)
{
	CHECK;

	return value(THIS->nchannels());
}


static Class cMicIn;

void
Init_beeps_mic_in ()
{
	Module mBeeps = rb_define_module("Beeps");

	cMicIn = mBeeps.define_class("MicIn", Beeps::processor_class());
	rb_define_alloc_func(cMicIn, alloc);
	rb_define_method(cMicIn, "start", RUBY_METHOD_FUNC(start), 0);
	rb_define_method(cMicIn, "stop", RUBY_METHOD_FUNC(stop), 0);
	rb_define_method(cMicIn, "sample_rate", RUBY_METHOD_FUNC(get_sample_rate), 0);
	rb_define_method(cMicIn, "nchannels", RUBY_METHOD_FUNC(get_nchannels), 0);
}


namespace Beeps
{


	Class
	mic_in_class ()
	{
		return cMicIn;
	}


}// Beeps

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
beeps-0.2.1 .doc/ext/beeps/mic_in.cpp
beeps-0.2 .doc/ext/beeps/mic_in.cpp
beeps-0.1.46 .doc/ext/beeps/mic_in.cpp
beeps-0.1.45 .doc/ext/beeps/mic_in.cpp
beeps-0.1.44 .doc/ext/beeps/mic_in.cpp
beeps-0.1.43 .doc/ext/beeps/mic_in.cpp
beeps-0.1.42 .doc/ext/beeps/mic_in.cpp
beeps-0.1.41 .doc/ext/beeps/mic_in.cpp
beeps-0.1.40 .doc/ext/beeps/mic_in.cpp
beeps-0.1.39 .doc/ext/beeps/mic_in.cpp
beeps-0.1.38 .doc/ext/beeps/mic_in.cpp
beeps-0.1.37 .doc/ext/beeps/mic_in.cpp
beeps-0.1.36 .doc/ext/beeps/mic_in.cpp
beeps-0.1.35 .doc/ext/beeps/mic_in.cpp
beeps-0.1.34 .doc/ext/beeps/mic_in.cpp
beeps-0.1.33 .doc/ext/beeps/mic_in.cpp