Example #1
0
void add_command_handlers(
    clk_command_processor& processor,
    const safe_ptr<core::video_channel>& channel)
{
    auto context = make_safe<command_context>(channel);

    processor
    .add_handler(L"DUR",
                 create_send_xml_handler(L"DUR", true, true, context))
    .add_handler(L"NEWDUR",
                 create_send_xml_handler(L"NEWDUR", true, true, context))
    .add_handler(L"UNTIL",
                 create_send_xml_handler(L"UNTIL", true, true, context))
    .add_handler(L"NEXTEVENT",
                 create_send_xml_handler(L"NEXTEVENT", true, false, context))
    .add_handler(L"STOP",
                 create_send_xml_handler(L"STOP", true, false, context))
    .add_handler(L"ADD",
                 create_send_xml_handler(L"ADD", true, true, context))
    .add_handler(L"SUB",
                 create_send_xml_handler(L"SUB", true, true, context))
    .add_handler(L"TIMELINE_LOAD",
                 create_send_xml_handler(L"TIMELINE_LOAD", false, false, context))
    .add_handler(L"TIMELINE_PLAY",
                 create_send_xml_handler(L"TIMELINE_PLAY", false, false, context))
    .add_handler(L"TIMELINE_STOP",
                 create_send_xml_handler(L"TIMELINE_STOP", false, false, context))
    .add_handler(L"RESET", [=] (const std::vector<std::wstring>& params)
    {
        context->reset();
    })
    ;
}
Example #2
0
void add_command_handlers(clk_command_processor&                                      processor,
                          const std::vector<spl::shared_ptr<core::video_channel>>&    channels,
                          const spl::shared_ptr<core::video_channel>&                 channel,
                          const spl::shared_ptr<core::cg_producer_registry>&          cg_registry,
                          const spl::shared_ptr<const core::frame_producer_registry>& producer_registry)
{
    auto context = spl::make_shared<command_context>(channels, channel, cg_registry, producer_registry);

    processor.add_handler(L"DUR", create_send_xml_handler(L"DUR", true, true, context))
        .add_handler(L"NEWDUR", create_send_xml_handler(L"NEWDUR", true, true, context))
        .add_handler(L"UNTIL", create_send_xml_handler(L"UNTIL", true, true, context))
        .add_handler(L"NEXTEVENT", create_send_xml_handler(L"NEXTEVENT", true, false, context))
        .add_handler(L"STOP", create_send_xml_handler(L"STOP", true, false, context))
        .add_handler(L"ADD", create_send_xml_handler(L"ADD", true, true, context))
        .add_handler(L"SUB", create_send_xml_handler(L"SUB", true, true, context))
        .add_handler(L"TIMELINE_LOAD", create_send_xml_handler(L"TIMELINE_LOAD", false, false, context))
        .add_handler(L"TIMELINE_PLAY", create_send_xml_handler(L"TIMELINE_PLAY", false, false, context))
        .add_handler(L"TIMELINE_STOP", create_send_xml_handler(L"TIMELINE_STOP", false, false, context))
        .add_handler(L"RESET", [=](const std::vector<std::wstring>& params) { context->reset(); });
}