#define TTS_TAG_ENGINE_VOICE "voice"
#define TTS_TAG_ENGINE_VOICE_TYPE "type"
-#define TTS_CONFIG_BASE tzplatform_mkpath(TZ_USER_HOME, "share/.voice")
-#define TTS_HOME tzplatform_mkpath(TZ_USER_HOME, "share/.voice/tts")
-#define TTS_ENGINE_BASE tzplatform_mkpath(TZ_USER_HOME, "share/.voice/tts/1.0")
-#define TTS_ENGINE_INFO tzplatform_mkpath(TZ_USER_SHARE, ".voice/tts/1.0/engine-info")
+#define TTS_GLOBAL_CONFIG_BASE tzplatform_mkpath(tzplatform_getid("TZ_SYS_GLOBALUSER_DATA"), ".voice")
+#define TTS_GLOBAL_HOME tzplatform_mkpath(tzplatform_getid("TZ_SYS_GLOBALUSER_DATA"), ".voice/tts")
+#define TTS_GLOBAL_ENGINE_INFO tzplatform_mkpath(tzplatform_getid("TZ_SYS_GLOBALUSER_DATA"), ".voice/tts/engine-info")
#define TTS_METADATA_LANGUAGE "http://tizen.org/metadata/tts-engine-language-pack/language"
LOGD("=== Save engine info doc");
/* Make directories */
- if (0 != access(TTS_CONFIG_BASE, F_OK)) {
- if (0 != mkdir(TTS_CONFIG_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
- LOGE("[ERROR] Fail to make directory : %s", TTS_CONFIG_BASE);
+ if (0 != access(TTS_GLOBAL_CONFIG_BASE, F_OK)) {
+ if (0 != mkdir(TTS_GLOBAL_CONFIG_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
+ LOGE("[ERROR] Fail to make directory : %s", TTS_GLOBAL_CONFIG_BASE);
return -1;
} else {
- LOGD("Success to make directory : %s", TTS_CONFIG_BASE);
+ LOGD("Success to make directory : %s", TTS_GLOBAL_CONFIG_BASE);
}
}
- if (0 != access(TTS_HOME, F_OK)) {
- if (0 != mkdir(TTS_HOME, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
- LOGE("[ERROR] Fail to make directory : %s", TTS_HOME);
+ if (0 != access(TTS_GLOBAL_HOME, F_OK)) {
+ if (0 != mkdir(TTS_GLOBAL_HOME, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
+ LOGE("[ERROR] Fail to make directory : %s", TTS_GLOBAL_HOME);
return -1;
} else {
- LOGD("Success to make directory : %s", TTS_HOME);
+ LOGD("Success to make directory : %s", TTS_GLOBAL_HOME);
}
}
- if (0 != access(TTS_ENGINE_BASE, F_OK)) {
- if (0 != mkdir(TTS_ENGINE_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
- LOGE("[ERROR] Fail to make directory : %s", TTS_ENGINE_BASE);
+ if (0 != access(TTS_GLOBAL_ENGINE_INFO, F_OK)) {
+ if (0 != mkdir(TTS_GLOBAL_ENGINE_INFO, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
+ LOGE("[ERROR] Fail to make directory : %s", TTS_GLOBAL_ENGINE_INFO);
return -1;
} else {
- LOGD("Success to make directory : %s", TTS_ENGINE_BASE);
- }
- }
-
- if (0 != access(TTS_ENGINE_INFO, F_OK)) {
- if (0 != mkdir(TTS_ENGINE_INFO, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) {
- LOGE("[ERROR] Fail to make directory : %s", TTS_ENGINE_INFO);
- return -1;
- } else {
- LOGD("Success to make directory : %s", TTS_ENGINE_INFO);
+ LOGD("Success to make directory : %s", TTS_GLOBAL_ENGINE_INFO);
}
}
char path[256] = {'\0',};
- snprintf(path, 256, "%s/%s.xml", TTS_ENGINE_INFO, pkgid);
+ snprintf(path, 256, "%s/%s.xml", TTS_GLOBAL_ENGINE_INFO, pkgid);
int ret = xmlSaveFormatFile(path, g_doc, 1);
LOGD("xmlSaveFile (%d)", ret);
LOGD("===");
{
LOGD("=== Remove engine info doc");
char path[256] = {'\0',};
- snprintf(path, 256, "%s/%s.xml", TTS_ENGINE_INFO, pkgid);
+ snprintf(path, 256, "%s/%s.xml", TTS_GLOBAL_ENGINE_INFO, pkgid);
if (0 == access(path, F_OK)) {
LOGD("Remove engine info xml(%s)", path);
remove(path);