summaryrefslogtreecommitdiff
path: root/modules/minimp3
diff options
context:
space:
mode:
Diffstat (limited to 'modules/minimp3')
-rw-r--r--modules/minimp3/audio_stream_mp3.cpp8
-rw-r--r--modules/minimp3/doc_classes/AudioStreamMP3.xml2
-rw-r--r--modules/minimp3/register_types.cpp4
-rw-r--r--modules/minimp3/resource_importer_mp3.cpp6
4 files changed, 10 insertions, 10 deletions
diff --git a/modules/minimp3/audio_stream_mp3.cpp b/modules/minimp3/audio_stream_mp3.cpp
index aaa05a910c..2cc974322d 100644
--- a/modules/minimp3/audio_stream_mp3.cpp
+++ b/modules/minimp3/audio_stream_mp3.cpp
@@ -35,7 +35,7 @@
#include "audio_stream_mp3.h"
-#include "core/os/file_access.h"
+#include "core/io/file_access.h"
void AudioStreamPlaybackMP3::_mix_internal(AudioFrame *p_buffer, int p_frames) {
ERR_FAIL_COND(!active);
@@ -126,7 +126,7 @@ Ref<AudioStreamPlayback> AudioStreamMP3::instance_playback() {
"to it. AudioStreamMP3 should not be created from the "
"inspector or with `.new()`. Instead, load an audio file.");
- mp3s.instance();
+ mp3s.instantiate();
mp3s->mp3_stream = Ref<AudioStreamMP3>(this);
mp3s->mp3d = (mp3dec_ex_t *)memalloc(sizeof(mp3dec_ex_t));
@@ -172,7 +172,7 @@ void AudioStreamMP3::set_data(const Vector<uint8_t> &p_data) {
clear_data();
data = memalloc(src_data_len);
- copymem(data, src_datar, src_data_len);
+ memcpy(data, src_datar, src_data_len);
data_len = src_data_len;
}
@@ -183,7 +183,7 @@ Vector<uint8_t> AudioStreamMP3::get_data() const {
vdata.resize(data_len);
{
uint8_t *w = vdata.ptrw();
- copymem(w, data, data_len);
+ memcpy(w, data, data_len);
}
}
diff --git a/modules/minimp3/doc_classes/AudioStreamMP3.xml b/modules/minimp3/doc_classes/AudioStreamMP3.xml
index 92e777ca0f..5507329a18 100644
--- a/modules/minimp3/doc_classes/AudioStreamMP3.xml
+++ b/modules/minimp3/doc_classes/AudioStreamMP3.xml
@@ -11,7 +11,7 @@
<methods>
</methods>
<members>
- <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray( )">
+ <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()">
Contains the audio data in bytes.
</member>
<member name="loop" type="bool" setter="set_loop" getter="has_loop" default="false">
diff --git a/modules/minimp3/register_types.cpp b/modules/minimp3/register_types.cpp
index 4ab4c743d6..63f2589f42 100644
--- a/modules/minimp3/register_types.cpp
+++ b/modules/minimp3/register_types.cpp
@@ -41,11 +41,11 @@ void register_minimp3_types() {
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint()) {
Ref<ResourceImporterMP3> mp3_import;
- mp3_import.instance();
+ mp3_import.instantiate();
ResourceFormatImporter::get_singleton()->add_importer(mp3_import);
}
#endif
- ClassDB::register_class<AudioStreamMP3>();
+ GDREGISTER_CLASS(AudioStreamMP3);
}
void unregister_minimp3_types() {
diff --git a/modules/minimp3/resource_importer_mp3.cpp b/modules/minimp3/resource_importer_mp3.cpp
index afd26fb79e..dc360c12ba 100644
--- a/modules/minimp3/resource_importer_mp3.cpp
+++ b/modules/minimp3/resource_importer_mp3.cpp
@@ -30,8 +30,8 @@
#include "resource_importer_mp3.h"
+#include "core/io/file_access.h"
#include "core/io/resource_saver.h"
-#include "core/os/file_access.h"
#include "scene/resources/texture.h"
String ResourceImporterMP3::get_importer_name() const {
@@ -79,7 +79,7 @@ Error ResourceImporterMP3::import(const String &p_source_file, const String &p_s
ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
- size_t len = f->get_len();
+ uint64_t len = f->get_length();
Vector<uint8_t> data;
data.resize(len);
@@ -90,7 +90,7 @@ Error ResourceImporterMP3::import(const String &p_source_file, const String &p_s
memdelete(f);
Ref<AudioStreamMP3> mp3_stream;
- mp3_stream.instance();
+ mp3_stream.instantiate();
mp3_stream->set_data(data);
ERR_FAIL_COND_V(!mp3_stream->get_data().size(), ERR_FILE_CORRUPT);