[DEV] update new ejson interface
This commit is contained in:
parent
0dd1fe108c
commit
19c847f066
@ -37,20 +37,20 @@ void audio::ess::unInit() {
|
|||||||
void audio::ess::soundSetParse(const std::string& _data) {
|
void audio::ess::soundSetParse(const std::string& _data) {
|
||||||
ejson::Document doc;
|
ejson::Document doc;
|
||||||
doc.parse(_data);
|
doc.parse(_data);
|
||||||
std::shared_ptr<ejson::Object> obj = doc.getObject("musics");
|
ejson::Object obj = doc["musics"].toObject();
|
||||||
if ( obj != nullptr
|
if ( obj.exist() == true
|
||||||
&& g_music != nullptr) {
|
&& g_music != nullptr) {
|
||||||
for (auto &it : obj->getKeys()) {
|
for (auto &it : obj.getKeys()) {
|
||||||
std::string file = obj->getStringValue(it);
|
std::string file = obj.getStringValue(it);
|
||||||
EWOLSA_INFO("load Music : '" << it << "' file=" << file);
|
EWOLSA_INFO("load Music : '" << it << "' file=" << file);
|
||||||
g_music->load(file, it);
|
g_music->load(file, it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
obj = doc.getObject("effects");
|
obj = doc["effects"].toObject();
|
||||||
if ( obj != nullptr
|
if ( obj.exist() == true
|
||||||
&& g_effects != nullptr) {
|
&& g_effects != nullptr) {
|
||||||
for (auto &it : obj->getKeys()) {
|
for (auto &it : obj.getKeys()) {
|
||||||
std::string file = obj->getStringValue(it);
|
std::string file = obj.getStringValue(it);
|
||||||
EWOLSA_INFO("load Effect : '" << it << "' file=" << file);
|
EWOLSA_INFO("load Effect : '" << it << "' file=" << file);
|
||||||
g_effects->load(file, it);
|
g_effects->load(file, it);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user