示例#1
0
void write_osc_bundle_element_start(byte_vector& destination, const byte_vector& message)
{		
	destination.resize(4);

	int32_t* bundle_element_size = reinterpret_cast<int32_t*>(destination.data());

#ifdef OSC_HOST_LITTLE_ENDIAN
	*bundle_element_size = swap_byte_order(static_cast<int32_t>(message.size()));
#else
	*bundle_element_size = static_cast<int32_t>(bundle.size());
#endif
}
示例#2
0
void dump(byte_vector test_bytes)
{
    size_t i;
    printf("Encoded Data: %u bytes\n", (unsigned int)test_bytes.size());
    for (i = 0; (i < test_bytes.size()) && (i < 16); i++)
    {
        printf(" %02X", test_bytes[i]);
    }
    if (i < test_bytes.size())
    {
        printf(" ...");
    }
    printf("\n");
}
示例#3
0
void write_osc_event(byte_vector& destination, const core::monitor::message& e)
{		
	destination.resize(4096);

	::osc::OutboundPacketStream o(reinterpret_cast<char*>(destination.data()), static_cast<unsigned long>(destination.size()));
	o << ::osc::BeginMessage(e.path().c_str());
				
	param_visitor<decltype(o)> param_visitor(o);
	BOOST_FOREACH(const auto& data, e.data())
		boost::apply_visitor(param_visitor, data);
				
	o << ::osc::EndMessage;
		
	destination.resize(o.Size());
}