diff options
Diffstat (limited to 'scene/audio')
-rw-r--r-- | scene/audio/sample_player.cpp | 8 | ||||
-rw-r--r-- | scene/audio/sample_player.h | 2 | ||||
-rw-r--r-- | scene/audio/stream_player.cpp | 6 |
3 files changed, 13 insertions, 3 deletions
diff --git a/scene/audio/sample_player.cpp b/scene/audio/sample_player.cpp index d7605ed1a9..b4a237c60f 100644 --- a/scene/audio/sample_player.cpp +++ b/scene/audio/sample_player.cpp @@ -600,6 +600,14 @@ float SamplePlayer::get_default_reverb() const { return _default.reverb_send; } +String SamplePlayer::get_configuration_warning() const { + + if (library.is_null()) { + return TTR("A SampleLibrary resource must be created or set in the 'samples' property in order for SamplePlayer to play sound."); + } + + return String(); +} void SamplePlayer::_bind_methods() { diff --git a/scene/audio/sample_player.h b/scene/audio/sample_player.h index 1821c671dc..833fac3868 100644 --- a/scene/audio/sample_player.h +++ b/scene/audio/sample_player.h @@ -188,6 +188,8 @@ public: ReverbRoomType get_default_reverb_room() const; float get_default_reverb() const; + String get_configuration_warning() const; + SamplePlayer(); ~SamplePlayer(); }; diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp index c1799ec12c..050e945c8f 100644 --- a/scene/audio/stream_player.cpp +++ b/scene/audio/stream_player.cpp @@ -342,8 +342,8 @@ int StreamPlayer::get_buffering_msec() const{ void StreamPlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_stream","stream:Stream"),&StreamPlayer::set_stream); - ObjectTypeDB::bind_method(_MD("get_stream:Stream"),&StreamPlayer::get_stream); + ObjectTypeDB::bind_method(_MD("set_stream","stream:AudioStream"),&StreamPlayer::set_stream); + ObjectTypeDB::bind_method(_MD("get_stream:AudioStream"),&StreamPlayer::get_stream); ObjectTypeDB::bind_method(_MD("play","offset"),&StreamPlayer::play,DEFVAL(0)); ObjectTypeDB::bind_method(_MD("stop"),&StreamPlayer::stop); @@ -388,7 +388,7 @@ void StreamPlayer::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); ADD_SIGNAL(MethodInfo("finished")); |