SLOG(LOG_DEBUG, tts_tag(), "-----------------------");
}
-#endif
-int __data_show_sound_list(app_data_s& app_data)
+static void __data_show_sound_list(app_data_s& app_data)
{
SLOG(LOG_DEBUG, tts_tag(), "----- Sound list -----");
}
SLOG(LOG_DEBUG, tts_tag(), "----------------------");
- return TTSD_ERROR_NONE;
}
-int __data_show_text_list(app_data_s& app_data)
+static void __data_show_text_list(app_data_s& app_data)
{
SLOG(LOG_DEBUG, tts_tag(), "----- Text list -----");
}
SLOG(LOG_DEBUG, tts_tag(), "---------------------");
- return TTSD_ERROR_NONE;
}
-int __data_show_used_voice_list(app_data_s& app_data)
+static void __data_show_used_voice_list(app_data_s& app_data)
{
SLOG(LOG_DEBUG, tts_tag(), "----- Used voice list -----");
}
SLOG(LOG_DEBUG, tts_tag(), "---------------------------");
- return TTSD_ERROR_NONE;
}
+#endif
/*
* ttsd data functions
return TTSD_ERROR_NONE;
}
-int __get_speak_data(app_data_s* app_data, speak_data_s** data)
+static speak_data_s* __get_speak_data(app_data_s* app_data)
{
if (app_data->m_speak_data.empty()) {
#ifdef DATA_DEBUG
SLOG(LOG_WARN, tts_tag(), "[DATA WARNING] There is no speak data");
#endif
- return -1;
+ return nullptr;
}
- *data = app_data->m_speak_data.front();
- app_data->m_speak_data.pop_front();
-
#ifdef DATA_DEBUG
__data_show_text_list(*app_data);
#endif
- return 0;
+
+ return app_data->m_speak_data.front();
}
int ttsd_data_get_speak_data(unsigned int uid, speak_data_s** data)
return TTSD_ERROR_INVALID_PARAMETER;
}
- if (0 != __get_speak_data(app_data, data)) {
+ speak_data_s* speakData = __get_speak_data(app_data);
+ if (nullptr == speakData) {
SLOG(LOG_WARN, tts_tag(), "[DATA WARNING] There is no speak data");
- return -1;
+ return TTSD_ERROR_OPERATION_FAILED;
}
+ app_data->m_speak_data.pop_front();
+ *data = speakData;
+
return TTSD_ERROR_NONE;
}
return TTSD_ERROR_NONE;
}
-int __get_sound_data(app_data_s* app_data, sound_data_s** data)
+static sound_data_s* __get_sound_data(app_data_s* app_data)
{
if (app_data->m_wav_data.empty()) {
#ifdef DATA_DEBUG
SLOG(LOG_DEBUG, tts_tag(), "[DATA] There is no wav data");
#endif
- return -1;
+ return nullptr;
}
- *data = app_data->m_wav_data.front();
- app_data->m_wav_data.pop_front();
-
#ifdef DATA_DEBUG
__data_show_sound_list(*app_data);
#endif
- return 0;
+
+ return app_data->m_wav_data.front();
}
int ttsd_data_get_sound_data(unsigned int uid, sound_data_s** data)
return TTSD_ERROR_INVALID_PARAMETER;
}
- if (0 != __get_sound_data(app_data, data)) {
+ sound_data_s* soundData = __get_sound_data(app_data);
+ if (nullptr == soundData) {
SLOG(LOG_DEBUG, tts_tag(), "[DATA] There is no wav data");
- return -1;
+ return TTSD_ERROR_OPERATION_FAILED;
}
+ app_data->m_wav_data.pop_front();
+ *data = soundData;
+
return TTSD_ERROR_NONE;
}