Clipboard support and various bug fixes

This commit is contained in:
Jack Andersen
2018-08-24 22:34:04 -10:00
parent cefa0ac18c
commit 27cdee0c14
38 changed files with 3022 additions and 854 deletions

View File

@@ -279,12 +279,7 @@ AudioGroupPool AudioGroupPool::CreateAudioGroupPool(SystemStringView groupPath)
smOut = MakeObj<SoundMacro>();
size_t cmdCount;
if (auto __v = r.enterSubVector(sm.first.c_str(), cmdCount))
{
smOut->m_cmds.reserve(cmdCount);
for (int c = 0; c < cmdCount; ++c)
if (auto __r2 = r.enterSubRecord(nullptr))
smOut->m_cmds.push_back(SoundMacro::CmdDo<MakeCmdOp, std::unique_ptr<SoundMacro::ICmd>>(r));
}
smOut->fromYAML(r, cmdCount);
}
}
@@ -416,6 +411,27 @@ void SoundMacro::buildFromPrototype(const SoundMacro& other)
m_cmds.push_back(CmdDo<MakeCopyCmdOp, std::unique_ptr<SoundMacro::ICmd>>(*cmd));
}
void SoundMacro::toYAML(athena::io::YAMLDocWriter& w) const
{
for (const auto& c : m_cmds)
{
if (auto __r2 = w.enterSubRecord(nullptr))
{
w.setStyle(athena::io::YAMLNodeStyle::Flow);
w.writeString("cmdOp", SoundMacro::CmdOpToStr(c->Isa()));
c->write(w);
}
}
}
void SoundMacro::fromYAML(athena::io::YAMLDocReader& r, size_t cmdCount)
{
m_cmds.reserve(cmdCount);
for (int c = 0; c < cmdCount; ++c)
if (auto __r2 = r.enterSubRecord(nullptr))
m_cmds.push_back(SoundMacro::CmdDo<MakeCmdOp, std::unique_ptr<SoundMacro::ICmd>>(r));
}
const SoundMacro* AudioGroupPool::soundMacro(ObjectId id) const
{
auto search = m_soundMacros.find(id);
@@ -1002,15 +1018,7 @@ bool AudioGroupPool::toYAML(SystemStringView groupPath) const
{
if (auto __v = w.enterSubVector(SoundMacroId::CurNameDB->resolveNameFromId(p.first).data()))
{
for (const auto& c : p.second.get()->m_cmds)
{
if (auto __r2 = w.enterSubRecord(nullptr))
{
w.setStyle(athena::io::YAMLNodeStyle::Flow);
w.writeString("cmdOp", SoundMacro::CmdOpToStr(c->Isa()));
c->write(w);
}
}
p.second.get()->toYAML(w);
}
}
}