.doc/ext/beeps/sound.cpp in beeps-0.1.34 vs .doc/ext/beeps/sound.cpp in beeps-0.1.35

- old
+ new

@@ -35,19 +35,10 @@ return value(THIS->play()); } static -VALUE save(VALUE self, VALUE path) -{ - CHECK; - - THIS->save(path.c_str()); - return self; -} - -static VALUE get_sample_rate(VALUE self) { CHECK; return value(THIS->sample_rate()); @@ -102,10 +93,19 @@ return value(THIS->loop()); } static +VALUE save(VALUE self, VALUE path) +{ + CHECK; + + THIS->save(path.c_str()); + return self; +} + +static VALUE load(VALUE self, VALUE path) { return value(Beeps::load_sound(to<const char*>(path))); } @@ -119,17 +119,17 @@ cSound = rb_define_class_under(mBeeps, "Sound", rb_cObject); rb_define_alloc_func(cSound, alloc); rb_define_private_method(cSound, "setup", RUBY_METHOD_FUNC(setup), 4); cSound.define_private_method("play!", play); - rb_define_method(cSound, "save", RUBY_METHOD_FUNC(save), 1); rb_define_method(cSound, "sample_rate", RUBY_METHOD_FUNC(get_sample_rate), 0); rb_define_method(cSound, "nchannels", RUBY_METHOD_FUNC(get_nchannels), 0); rb_define_method(cSound, "seconds", RUBY_METHOD_FUNC(get_seconds), 0); rb_define_method(cSound, "gain=", RUBY_METHOD_FUNC(set_gain), 1); rb_define_method(cSound, "gain", RUBY_METHOD_FUNC(get_gain), 0); rb_define_method(cSound, "loop=", RUBY_METHOD_FUNC(set_loop), 1); rb_define_method(cSound, "loop", RUBY_METHOD_FUNC(get_loop), 0); + rb_define_method(cSound, "save", RUBY_METHOD_FUNC(save), 1); rb_define_singleton_method(cSound, "load", RUBY_METHOD_FUNC(load), 1); } namespace Beeps