summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-30 18:29:47 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-30 18:29:47 -0300
commitb9326e3f2bf08026b1b1a990432606c7633fad32 (patch)
tree92c19f1d171008b9bb47323d487ef7e40b7025f8 /tools
parentffbc2e56c90b632382b9deb280ee62d2f907d722 (diff)
Properly show the sample and play it back, also closes #5288
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/plugins/sample_editor_plugin.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp
index b094184a29..69602ac995 100644
--- a/tools/editor/plugins/sample_editor_plugin.cpp
+++ b/tools/editor/plugins/sample_editor_plugin.cpp
@@ -324,12 +324,13 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag
void SampleEditor::_update_sample() {
player->stop_all();
- if (sample->get_format()==Sample::FORMAT_IMA_ADPCM)
- return; //bye or unsupported
generate_preview_texture(sample,peakdisplay);
info_label->set_text(TTR("Length:")+" "+String::num(sample->get_length()/(float)sample->get_mix_rate(),2)+"s");
+ if (library->has_sample("default"))
+ library->remove_sample("default");
+
library->add_sample("default",sample);
}