Properly show the sample and play it back, also closes #5288
This commit is contained in:
parent
ffbc2e56c9
commit
b9326e3f2b
|
@ -324,12 +324,13 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag
|
||||||
void SampleEditor::_update_sample() {
|
void SampleEditor::_update_sample() {
|
||||||
|
|
||||||
player->stop_all();
|
player->stop_all();
|
||||||
if (sample->get_format()==Sample::FORMAT_IMA_ADPCM)
|
|
||||||
return; //bye or unsupported
|
|
||||||
|
|
||||||
generate_preview_texture(sample,peakdisplay);
|
generate_preview_texture(sample,peakdisplay);
|
||||||
info_label->set_text(TTR("Length:")+" "+String::num(sample->get_length()/(float)sample->get_mix_rate(),2)+"s");
|
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);
|
library->add_sample("default",sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue