diff options
Diffstat (limited to 'scene/2d/sound_player_2d.cpp')
-rw-r--r-- | scene/2d/sound_player_2d.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/scene/2d/sound_player_2d.cpp b/scene/2d/sound_player_2d.cpp index 41ce87faf9..7861fb5855 100644 --- a/scene/2d/sound_player_2d.cpp +++ b/scene/2d/sound_player_2d.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 */ @@ -87,8 +87,8 @@ float SoundPlayer2D::get_param( Param p_param) const { void SoundPlayer2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&SoundPlayer2D::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&SoundPlayer2D::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&SoundPlayer2D::set_param); + ClassDB::bind_method(_MD("get_param","param"),&SoundPlayer2D::get_param); BIND_CONSTANT( PARAM_VOLUME_DB ); BIND_CONSTANT( PARAM_PITCH_SCALE ); @@ -97,11 +97,13 @@ void SoundPlayer2D::_bind_methods() { BIND_CONSTANT( PARAM_ATTENUATION_DISTANCE_EXP ); BIND_CONSTANT( PARAM_MAX ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/volume_db",PROPERTY_HINT_RANGE, "-80,24,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_VOLUME_DB); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/pitch_scale",PROPERTY_HINT_RANGE, "0.001,32,0.001"),_SCS("set_param"),_SCS("get_param"),PARAM_PITCH_SCALE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/min_distance",PROPERTY_HINT_EXP_RANGE, "16,16384,1"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MIN_DISTANCE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/max_distance",PROPERTY_HINT_EXP_RANGE, "16,16384,1"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MAX_DISTANCE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/distance_exp",PROPERTY_HINT_EXP_EASING, "attenuation"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_DISTANCE_EXP); + ADD_GROUP("Parameters",""); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "volume_db",PROPERTY_HINT_RANGE, "-80,24,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_VOLUME_DB); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "pitch_scale",PROPERTY_HINT_RANGE, "0.001,32,0.001"),_SCS("set_param"),_SCS("get_param"),PARAM_PITCH_SCALE); + ADD_GROUP("Attenuation","attenuation_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_min_distance",PROPERTY_HINT_EXP_RANGE, "16,16384,1"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MIN_DISTANCE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_max_distance",PROPERTY_HINT_EXP_RANGE, "16,16384,1"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MAX_DISTANCE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_distance_exp",PROPERTY_HINT_EXP_EASING, "attenuation"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_DISTANCE_EXP); } @@ -114,7 +116,7 @@ SoundPlayer2D::SoundPlayer2D() { params[PARAM_ATTENUATION_MAX_DISTANCE]=2048; params[PARAM_ATTENUATION_DISTANCE_EXP]=1.0; //linear (and not really good) - + set_notify_transform(true); } SoundPlayer2D::~SoundPlayer2D() { |