ext/beeps/sound_player.cpp in beeps-0.1.40 vs ext/beeps/sound_player.cpp in beeps-0.1.41
- old
+ new
@@ -57,37 +57,19 @@
return self;
}
RUCY_END
static
-RUCY_DEF0(is_playing)
+RUCY_DEF0(get_state)
{
CHECK;
- return value(THIS->is_playing());
+ return value(THIS->state());
}
RUCY_END
static
-RUCY_DEF0(is_paused)
-{
- CHECK;
-
- return value(THIS->is_paused());
-}
-RUCY_END
-
-static
-RUCY_DEF0(is_stopped)
-{
- CHECK;
-
- return value(THIS->is_stopped());
-}
-RUCY_END
-
-static
RUCY_DEF1(set_gain, gain)
{
CHECK;
THIS->set_gain(to<float>(gain));
@@ -142,17 +124,20 @@
cSoundPlayer.define_alloc_func(alloc);
cSoundPlayer.define_method("play", play);
cSoundPlayer.define_method("pause", pause);
cSoundPlayer.define_method("rewind", rewind);
cSoundPlayer.define_method("stop", stop);
- cSoundPlayer.define_method("playing?", is_playing);
- cSoundPlayer.define_method("paused?", is_paused);
- cSoundPlayer.define_method("stopped?", is_stopped);
+ cSoundPlayer.define_method("state", get_state);
cSoundPlayer.define_method("gain=", set_gain);
cSoundPlayer.define_method("gain", get_gain);
cSoundPlayer.define_method("loop=", set_loop);
cSoundPlayer.define_method("loop", get_loop);
cSoundPlayer.define_singleton_method("stop_all", stop_all);
+
+ cSoundPlayer.define_const("STATE_UNKNOWN", Beeps::SoundPlayer::STATE_UNKNOWN);
+ cSoundPlayer.define_const("PLAYING", Beeps::SoundPlayer::PLAYING);
+ cSoundPlayer.define_const("PAUSED", Beeps::SoundPlayer::PAUSED);
+ cSoundPlayer.define_const("STOPPED", Beeps::SoundPlayer::STOPPED);
}
namespace Beeps
{