Class: AudioFile

Inherits:
Object
  • Object
show all
Defined in:
ext/audiofile/audiofile.c

Class Method Summary collapse

Class Method Details

.new(*args) ⇒ Object



242
243
244
245
246
247
248
249
# File 'ext/audiofile/audiofile.c', line 242

static VALUE af_s_new(int argc, VALUE *argv, VALUE klass)
{
    /* i don't know what the last param is in this 'call' */

    VALUE obj = Data_Wrap_Struct(klass, 0, free_af, 0);
    rb_obj_call_init(obj, argc, argv);
    return obj;
}

.open(*args) ⇒ Object

—————- fundamental methods ————————-



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'ext/audiofile/audiofile.c', line 253

static VALUE af_s_open(int argc, VALUE *argv, VALUE klass) 
{
   
    VALUE obj = Data_Wrap_Struct(klass, 0, free_af, 0);

    if(NIL_P(af_initialize(argc, argv, obj))) {
        return Qnil;
    }

    if(rb_block_given_p()) {
        return rb_ensure(rb_yield, obj, af_close, obj);
    }

    return obj;
}