Class: FMODAudioPlayer::SoundPlayer

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.newObject



6
7
8
9
10
11
12
13
# File 'ext/fmod_audioplayer/soundplayer.c', line 6

static VALUE rb_soundplayer_new(VALUE klass)
{
	fmod_handle* handle = fmod_handle_new();
	fmod_handle_init(handle);

	return Data_Wrap_Struct(rb_cSoundPlayer, 0,
			fmod_handle_cleanup, handle);
}

Instance Method Details

#play(name_or_data) ⇒ Object



21
22
23
24
25
26
27
# File 'ext/fmod_audioplayer/soundplayer.c', line 21

static VALUE rb_soundplayer_play(VALUE self, const VALUE name_or_data)
{
	Check_Type(name_or_data, T_STRING);
	fmod_handle_sound_create(DATA_PTR(self), RSTRING_PTR(name_or_data));
	fmod_handle_sound_play(DATA_PTR(self));
	return self;
}

#positionObject



46
47
48
49
# File 'ext/fmod_audioplayer/soundplayer.c', line 46

static VALUE rb_soundplayer_position(VALUE self)
{
	return INT2FIX(fmod_handle_sound_position(DATA_PTR(self)));
}

#song_lengthObject



41
42
43
44
# File 'ext/fmod_audioplayer/soundplayer.c', line 41

static VALUE rb_soundplayer_length(VALUE self)
{
	return INT2FIX(fmod_handle_sound_length(DATA_PTR(self)));
}

#stopObject



29
30
31
32
33
# File 'ext/fmod_audioplayer/soundplayer.c', line 29

static VALUE rb_soundplayer_stop(VALUE self)
{
	fmod_handle_sound_stop(DATA_PTR(self));
	return self;
}

#system_updateObject



15
16
17
18
19
# File 'ext/fmod_audioplayer/soundplayer.c', line 15

static VALUE rb_soundplayer_system_update(VALUE self)
{
	fmod_handle_system_update(DATA_PTR(self));
	return self;
}

#toggleObject



35
36
37
38
39
# File 'ext/fmod_audioplayer/soundplayer.c', line 35

static VALUE rb_soundplayer_toggle(VALUE self)
{
	fmod_handle_sound_toggle(DATA_PTR(self));
	return self;
}