diff options
Diffstat (limited to 'scene/3d/spatial_stream_player.cpp')
-rw-r--r-- | scene/3d/spatial_stream_player.cpp | 86 |
1 files changed, 45 insertions, 41 deletions
diff --git a/scene/3d/spatial_stream_player.cpp b/scene/3d/spatial_stream_player.cpp index 11debb9bce..1f9765c1d3 100644 --- a/scene/3d/spatial_stream_player.cpp +++ b/scene/3d/spatial_stream_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -153,10 +153,12 @@ void SpatialStreamPlayer::play(float p_from_offset) { SpatialSoundServer::get_singleton()->source_set_audio_stream(get_source_rid(),&internal_stream); -// AudioServer::get_singleton()->stream_set_active(stream_rid,true); -// AudioServer::get_singleton()->stream_set_volume_scale(stream_rid,volume); -// if (stream->get_update_mode()!=AudioStream::UPDATE_NONE) -// set_idle_process(true); + /* + AudioServer::get_singleton()->stream_set_active(stream_rid,true); + AudioServer::get_singleton()->stream_set_volume_scale(stream_rid,volume); + if (stream->get_update_mode()!=AudioStream::UPDATE_NONE) + set_idle_process(true); + */ } @@ -289,8 +291,10 @@ bool SpatialStreamPlayer::has_autoplay() const { void SpatialStreamPlayer::set_paused(bool p_paused) { paused=p_paused; - //if (stream.is_valid()) - // stream->set_paused(p_paused); + /* + if (stream.is_valid()) + stream->set_paused(p_paused); + */ } bool SpatialStreamPlayer::is_paused() const { @@ -329,54 +333,54 @@ int SpatialStreamPlayer::get_buffering_msec() const{ void SpatialStreamPlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_stream","stream:AudioStream"),&SpatialStreamPlayer::set_stream); - ObjectTypeDB::bind_method(_MD("get_stream:AudioStream"),&SpatialStreamPlayer::get_stream); + ClassDB::bind_method(_MD("set_stream","stream:AudioStream"),&SpatialStreamPlayer::set_stream); + ClassDB::bind_method(_MD("get_stream:AudioStream"),&SpatialStreamPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play","offset"),&SpatialStreamPlayer::play,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("stop"),&SpatialStreamPlayer::stop); + ClassDB::bind_method(_MD("play","offset"),&SpatialStreamPlayer::play,DEFVAL(0)); + ClassDB::bind_method(_MD("stop"),&SpatialStreamPlayer::stop); - ObjectTypeDB::bind_method(_MD("is_playing"),&SpatialStreamPlayer::is_playing); + ClassDB::bind_method(_MD("is_playing"),&SpatialStreamPlayer::is_playing); - ObjectTypeDB::bind_method(_MD("set_paused","paused"),&SpatialStreamPlayer::set_paused); - ObjectTypeDB::bind_method(_MD("is_paused"),&SpatialStreamPlayer::is_paused); + ClassDB::bind_method(_MD("set_paused","paused"),&SpatialStreamPlayer::set_paused); + ClassDB::bind_method(_MD("is_paused"),&SpatialStreamPlayer::is_paused); - ObjectTypeDB::bind_method(_MD("set_loop","enabled"),&SpatialStreamPlayer::set_loop); - ObjectTypeDB::bind_method(_MD("has_loop"),&SpatialStreamPlayer::has_loop); + ClassDB::bind_method(_MD("set_loop","enabled"),&SpatialStreamPlayer::set_loop); + ClassDB::bind_method(_MD("has_loop"),&SpatialStreamPlayer::has_loop); - ObjectTypeDB::bind_method(_MD("set_volume","volume"),&SpatialStreamPlayer::set_volume); - ObjectTypeDB::bind_method(_MD("get_volume"),&SpatialStreamPlayer::get_volume); + ClassDB::bind_method(_MD("set_volume","volume"),&SpatialStreamPlayer::set_volume); + ClassDB::bind_method(_MD("get_volume"),&SpatialStreamPlayer::get_volume); - ObjectTypeDB::bind_method(_MD("set_volume_db","db"),&SpatialStreamPlayer::set_volume_db); - ObjectTypeDB::bind_method(_MD("get_volume_db"),&SpatialStreamPlayer::get_volume_db); + ClassDB::bind_method(_MD("set_volume_db","db"),&SpatialStreamPlayer::set_volume_db); + ClassDB::bind_method(_MD("get_volume_db"),&SpatialStreamPlayer::get_volume_db); - ObjectTypeDB::bind_method(_MD("set_buffering_msec","msec"),&SpatialStreamPlayer::set_buffering_msec); - ObjectTypeDB::bind_method(_MD("get_buffering_msec"),&SpatialStreamPlayer::get_buffering_msec); + ClassDB::bind_method(_MD("set_buffering_msec","msec"),&SpatialStreamPlayer::set_buffering_msec); + ClassDB::bind_method(_MD("get_buffering_msec"),&SpatialStreamPlayer::get_buffering_msec); - ObjectTypeDB::bind_method(_MD("set_loop_restart_time","secs"),&SpatialStreamPlayer::set_loop_restart_time); - ObjectTypeDB::bind_method(_MD("get_loop_restart_time"),&SpatialStreamPlayer::get_loop_restart_time); + ClassDB::bind_method(_MD("set_loop_restart_time","secs"),&SpatialStreamPlayer::set_loop_restart_time); + ClassDB::bind_method(_MD("get_loop_restart_time"),&SpatialStreamPlayer::get_loop_restart_time); - ObjectTypeDB::bind_method(_MD("get_stream_name"),&SpatialStreamPlayer::get_stream_name); - ObjectTypeDB::bind_method(_MD("get_loop_count"),&SpatialStreamPlayer::get_loop_count); + ClassDB::bind_method(_MD("get_stream_name"),&SpatialStreamPlayer::get_stream_name); + ClassDB::bind_method(_MD("get_loop_count"),&SpatialStreamPlayer::get_loop_count); - ObjectTypeDB::bind_method(_MD("get_pos"),&SpatialStreamPlayer::get_pos); - ObjectTypeDB::bind_method(_MD("seek_pos","time"),&SpatialStreamPlayer::seek_pos); + ClassDB::bind_method(_MD("get_pos"),&SpatialStreamPlayer::get_pos); + ClassDB::bind_method(_MD("seek_pos","time"),&SpatialStreamPlayer::seek_pos); - ObjectTypeDB::bind_method(_MD("set_autoplay","enabled"),&SpatialStreamPlayer::set_autoplay); - ObjectTypeDB::bind_method(_MD("has_autoplay"),&SpatialStreamPlayer::has_autoplay); + ClassDB::bind_method(_MD("set_autoplay","enabled"),&SpatialStreamPlayer::set_autoplay); + ClassDB::bind_method(_MD("has_autoplay"),&SpatialStreamPlayer::has_autoplay); - ObjectTypeDB::bind_method(_MD("get_length"),&SpatialStreamPlayer::get_length); + ClassDB::bind_method(_MD("get_length"),&SpatialStreamPlayer::get_length); - ObjectTypeDB::bind_method(_MD("_set_play","play"),&SpatialStreamPlayer::_set_play); - ObjectTypeDB::bind_method(_MD("_get_play"),&SpatialStreamPlayer::_get_play); + ClassDB::bind_method(_MD("_set_play","play"),&SpatialStreamPlayer::_set_play); + ClassDB::bind_method(_MD("_get_play"),&SpatialStreamPlayer::_get_play); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream/stream", PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"), _SCS("set_stream"), _SCS("get_stream") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/play"), _SCS("_set_play"), _SCS("_get_play") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); - 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::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"), _SCS("set_stream"), _SCS("get_stream") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "play"), _SCS("_set_play"), _SCS("_get_play") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "loop"), _SCS("set_loop"), _SCS("has_loop") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), _SCS("set_paused"), _SCS("is_paused") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); } |