Class: Ray::AudioSource
- Inherits:
-
Object
- Object
- Ray::AudioSource
- Defined in:
- ext/audio_source.c
Instance Method Summary collapse
-
#attenuation ⇒ Float
The source’s attenuation.
-
#attenuation=(attenuation) ⇒ Object
Sets the attenuation of a sound.
-
#min_distance ⇒ Float
The source’s minimal distance.
-
#min_distance=(dist) ⇒ Object
Sets the sounds minimal distance.
-
#pitch ⇒ Float
The pitch of the source.
-
#pitch=(pitch) ⇒ Object
Sets the pitch of the sound.
-
#pos ⇒ Ray::Vector3
The position of the source.
-
#pos=(pos) ⇒ Object
Sets the position of the sound.
-
#relative=(rel) ⇒ Object
Sets whether the sound should be relative.
-
#relative? ⇒ true, false
as opposed to being absolute.
-
#status ⇒ Symbol
Playing status.
-
#volume ⇒ Float
Volume of the source, between 0 and 100.
-
#volume=(vol) ⇒ Object
Sets the volume of the source.
Instance Method Details
#attenuation ⇒ Float
Returns The source’s attenuation.
136 137 138 139 140 |
# File 'ext/audio_source.c', line 136 static VALUE ray_audio_source_attenuation(VALUE self) { say_audio_source *source = ray_rb2audio_source(self); return rb_float_new(say_audio_source_get_attenuation(source)); } |
#attenuation=(attenuation) ⇒ Object
149 150 151 152 153 154 |
# File 'ext/audio_source.c', line 149
static
VALUE ray_audio_source_set_attenuation(VALUE self, VALUE att) {
rb_check_frozen(self);
say_audio_source_set_attenuation(ray_rb2audio_source(self), NUM2DBL(att));
return att;
}
|
#min_distance ⇒ Float
Returns the source’s minimal distance.
113 114 115 116 117 |
# File 'ext/audio_source.c', line 113 static VALUE ray_audio_source_min_distance(VALUE self) { say_audio_source *source = ray_rb2audio_source(self); return rb_float_new(say_audio_source_get_min_distance(source)); } |
#min_distance=(dist) ⇒ Object
125 126 127 128 129 130 131 132 133 |
# File 'ext/audio_source.c', line 125
static
VALUE ray_audio_source_set_min_distance(VALUE self, VALUE dist) {
rb_check_frozen(self);
say_audio_source *source = ray_rb2audio_source(self);
say_audio_source_set_min_distance(source, NUM2DBL(dist));
return dist;
}
|
#pitch ⇒ Float
Returns The pitch of the source.
42 43 44 45 46 |
# File 'ext/audio_source.c', line 42 static VALUE ray_audio_source_pitch(VALUE self) { say_audio_source *source = ray_rb2audio_source(self); return rb_float_new(say_audio_source_get_pitch(source)); } |
#pitch=(pitch) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'ext/audio_source.c', line 54
static
VALUE ray_audio_source_set_pitch(VALUE self, VALUE pitch) {
rb_check_frozen(self);
say_audio_source *source = ray_rb2audio_source(self);
say_audio_source_set_pitch(source, NUM2DBL(pitch));
return pitch;
}
|
#pos ⇒ Ray::Vector3
Returns The position of the source.
65 66 67 68 69 |
# File 'ext/audio_source.c', line 65 static VALUE ray_audio_source_pos(VALUE self) { say_audio_source *source = ray_rb2audio_source(self); return ray_vector3_to_rb(say_audio_source_get_pos(source)); } |
#pos=(pos) ⇒ Object
76 77 78 79 80 81 82 83 84 |
# File 'ext/audio_source.c', line 76
static
VALUE ray_audio_source_set_pos(VALUE self, VALUE pos) {
rb_check_frozen(self);
say_audio_source *source = ray_rb2audio_source(self);
say_audio_source_set_pos(source, ray_convert_to_vector3(pos));
return pos;
}
|
#relative=(rel) ⇒ Object
102 103 104 105 106 107 108 109 110 |
# File 'ext/audio_source.c', line 102
static
VALUE ray_audio_source_set_relative(VALUE self, VALUE val) {
rb_check_frozen(self);
say_audio_source *source = ray_rb2audio_source(self);
say_audio_source_set_relative(source, RTEST(val));
return val;
}
|
#relative? ⇒ true, false
as opposed to being absolute.
90 91 92 93 94 |
# File 'ext/audio_source.c', line 90 static VALUE ray_audio_source_is_relative(VALUE self) { say_audio_source *source = ray_rb2audio_source(self); return say_audio_source_get_relative(source) ? Qtrue : Qfalse; } |
#status ⇒ Symbol
Returns Playing status. One of playing, paused, stopped.
157 158 159 160 161 162 163 164 165 166 |
# File 'ext/audio_source.c', line 157
static
VALUE ray_audio_source_status(VALUE self) {
switch (say_audio_source_get_status(ray_rb2audio_source(self))) {
case SAY_STATUS_PAUSED: return RAY_SYM("paused");
case SAY_STATUS_PLAYING: return RAY_SYM("playing");
case SAY_STATUS_STOPPED: return RAY_SYM("stopped");
}
return Qnil; /* should never happen */
}
|
#volume ⇒ Float
Returns Volume of the source, between 0 and 100.
20 21 22 23 24 |
# File 'ext/audio_source.c', line 20 static VALUE ray_audio_source_volume(VALUE self) { say_audio_source *source = ray_rb2audio_source(self); return rb_float_new(say_audio_source_get_volume(source)); } |
#volume=(vol) ⇒ Object
Sets the volume of the source.
31 32 33 34 35 36 37 38 39 |
# File 'ext/audio_source.c', line 31
static
VALUE ray_audio_source_set_volume(VALUE self, VALUE value) {
rb_check_frozen(self);
say_audio_source *source = ray_rb2audio_source(self);
say_audio_source_set_volume(source, NUM2DBL(value));
return value;
}
|