diff options
Diffstat (limited to 'scene/resources/sample.cpp')
-rw-r--r-- | scene/resources/sample.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp index aae4e85a27..e07e4d3767 100644 --- a/scene/resources/sample.cpp +++ b/scene/resources/sample.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 */ @@ -119,18 +119,18 @@ int Sample::get_length() const { return length; } -void Sample::set_data(const DVector<uint8_t>& p_buffer) { +void Sample::set_data(const PoolVector<uint8_t>& p_buffer) { if (sample.is_valid()) AudioServer::get_singleton()->sample_set_data(sample,p_buffer); } -DVector<uint8_t> Sample::get_data() const { +PoolVector<uint8_t> Sample::get_data() const { if (sample.is_valid()) return AudioServer::get_singleton()->sample_get_data(sample); - return DVector<uint8_t>(); + return PoolVector<uint8_t>(); } @@ -192,23 +192,23 @@ RID Sample::get_rid() const { void Sample::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("create","format","stereo","length"),&Sample::create); - ObjectTypeDB::bind_method(_MD("get_format"),&Sample::get_format); - ObjectTypeDB::bind_method(_MD("is_stereo"),&Sample::is_stereo); - ObjectTypeDB::bind_method(_MD("get_length"),&Sample::get_length); - ObjectTypeDB::bind_method(_MD("set_data","data"),&Sample::set_data); - ObjectTypeDB::bind_method(_MD("get_data"),&Sample::get_data); - ObjectTypeDB::bind_method(_MD("set_mix_rate","hz"),&Sample::set_mix_rate); - ObjectTypeDB::bind_method(_MD("get_mix_rate"),&Sample::get_mix_rate); - ObjectTypeDB::bind_method(_MD("set_loop_format","format"),&Sample::set_loop_format); - ObjectTypeDB::bind_method(_MD("get_loop_format"),&Sample::get_loop_format); - ObjectTypeDB::bind_method(_MD("set_loop_begin","pos"),&Sample::set_loop_begin); - ObjectTypeDB::bind_method(_MD("get_loop_begin"),&Sample::get_loop_begin); - ObjectTypeDB::bind_method(_MD("set_loop_end","pos"),&Sample::set_loop_end); - ObjectTypeDB::bind_method(_MD("get_loop_end"),&Sample::get_loop_end); - - ObjectTypeDB::bind_method(_MD("_set_data"),&Sample::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&Sample::_get_data); + ClassDB::bind_method(_MD("create","format","stereo","length"),&Sample::create); + ClassDB::bind_method(_MD("get_format"),&Sample::get_format); + ClassDB::bind_method(_MD("is_stereo"),&Sample::is_stereo); + ClassDB::bind_method(_MD("get_length"),&Sample::get_length); + ClassDB::bind_method(_MD("set_data","data"),&Sample::set_data); + ClassDB::bind_method(_MD("get_data"),&Sample::get_data); + ClassDB::bind_method(_MD("set_mix_rate","hz"),&Sample::set_mix_rate); + ClassDB::bind_method(_MD("get_mix_rate"),&Sample::get_mix_rate); + ClassDB::bind_method(_MD("set_loop_format","format"),&Sample::set_loop_format); + ClassDB::bind_method(_MD("get_loop_format"),&Sample::get_loop_format); + ClassDB::bind_method(_MD("set_loop_begin","pos"),&Sample::set_loop_begin); + ClassDB::bind_method(_MD("get_loop_begin"),&Sample::get_loop_begin); + ClassDB::bind_method(_MD("set_loop_end","pos"),&Sample::set_loop_end); + ClassDB::bind_method(_MD("get_loop_end"),&Sample::get_loop_end); + + ClassDB::bind_method(_MD("_set_data"),&Sample::_set_data); + ClassDB::bind_method(_MD("_get_data"),&Sample::_get_data); ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"), _SCS("_get_data") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "stereo"), _SCS(""), _SCS("is_stereo") ); |