summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-02-22 16:05:07 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-02-22 16:05:17 +0200
commit97062ddf2b492c33703c51a6e2a4e8359029c437 (patch)
tree7945008260b69f9714c4d01eb4ce9e9199c51bf1
parent5f3dee5988391deffcc0de1039dd50e05e266913 (diff)
[Linux TTS] Use Callable instead of registering methods.
-rw-r--r--platform/linuxbsd/tts_linux.cpp9
-rw-r--r--platform/linuxbsd/tts_linux.h2
2 files changed, 2 insertions, 9 deletions
diff --git a/platform/linuxbsd/tts_linux.cpp b/platform/linuxbsd/tts_linux.cpp
index 6b8584ef6c..ce0199e87f 100644
--- a/platform/linuxbsd/tts_linux.cpp
+++ b/platform/linuxbsd/tts_linux.cpp
@@ -35,11 +35,6 @@
TTS_Linux *TTS_Linux::singleton = nullptr;
-void TTS_Linux::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_speech_event", "msg_id", "client_id", "type"), &TTS_Linux::_speech_event);
- ClassDB::bind_method(D_METHOD("_speech_index_mark", "msg_id", "client_id", "type", "index_mark"), &TTS_Linux::_speech_index_mark);
-}
-
void TTS_Linux::speech_init_thread_func(void *p_userdata) {
TTS_Linux *tts = (TTS_Linux *)p_userdata;
if (tts) {
@@ -82,7 +77,7 @@ void TTS_Linux::speech_init_thread_func(void *p_userdata) {
void TTS_Linux::speech_event_index_mark(size_t p_msg_id, size_t p_client_id, SPDNotificationType p_type, char *p_index_mark) {
TTS_Linux *tts = TTS_Linux::get_singleton();
if (tts) {
- tts->call_deferred(SNAME("_speech_index_mark"), p_msg_id, p_client_id, (int)p_type, String::utf8(p_index_mark));
+ callable_mp(tts, &TTS_Linux::_speech_index_mark).call_deferred(p_msg_id, p_client_id, (int)p_type, String::utf8(p_index_mark));
}
}
@@ -97,7 +92,7 @@ void TTS_Linux::_speech_index_mark(size_t p_msg_id, size_t p_client_id, int p_ty
void TTS_Linux::speech_event_callback(size_t p_msg_id, size_t p_client_id, SPDNotificationType p_type) {
TTS_Linux *tts = TTS_Linux::get_singleton();
if (tts) {
- tts->call_deferred(SNAME("_speech_event"), p_msg_id, p_client_id, (int)p_type);
+ callable_mp(tts, &TTS_Linux::_speech_event).call_deferred(p_msg_id, p_client_id, (int)p_type);
}
}
diff --git a/platform/linuxbsd/tts_linux.h b/platform/linuxbsd/tts_linux.h
index 3fcbe3207b..4134f8fa2f 100644
--- a/platform/linuxbsd/tts_linux.h
+++ b/platform/linuxbsd/tts_linux.h
@@ -46,7 +46,6 @@
#endif
class TTS_Linux : public Object {
- GDCLASS(TTS_Linux, Object);
_THREAD_SAFE_CLASS_
List<DisplayServer::TTSUtterance> queue;
@@ -65,7 +64,6 @@ class TTS_Linux : public Object {
static TTS_Linux *singleton;
protected:
- static void _bind_methods();
void _speech_event(size_t p_msg_id, size_t p_client_id, int p_type);
void _speech_index_mark(size_t p_msg_id, size_t p_client_id, int p_type, const String &p_index_mark);