[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] dumpOSC

as the broken dumpOSC is a little bit like having lost the last screwdriver, I have had a look if I can fix it with my limited means.

Trying to trace it down, using full text search, is this method that should be called, but apparently isn't:


static void dumpOSC(int mode, int size, char* inData)
	printf("here I am: dumpOSC\n"); // I added this.
	if (mode & 1)
		int indent = 0;
		bool contentPrinted;

		if (strcmp(inData, "#bundle") == 0)
			contentPrinted = dumpOSCbndl(indent, size, inData);
			contentPrinted = dumpOSCmsg(size, inData);

		if (contentPrinted)

	if (mode & 2) hexdump(size, inData);

I also added a debugging statement in SC_MiscCmds.cpp:

SCErr meth_dumpOSC(World *inWorld, int inSize, char *inData, ReplyAddress *inReply);
SCErr meth_dumpOSC(World *inWorld, int inSize, char *inData, ReplyAddress *inReply)
	sc_msg_iter msg(inSize, inData);
	inWorld->mDumpOSC = msg.geti();
		printf("meth_dumpOSC: %i\n", inWorld->mDumpOSC);
	return kSCErr_None;

Here I get a correct response.
It seems that the method is never called (in SC_ComPort.cpp)

SC_DLLEXPORT_C bool World_SendPacketWithContext(World *inWorld, int inSize, char *inData, ReplyFunc inFunc, void *inContext)
	if (inSize > 0) {
		//if (inWorld->mDumpOSC) dumpOSC(inWorld->mDumpOSC, inSize, inData);
		dumpOSC(inWorld->mDumpOSC, inSize, inData);

		OSC_Packet* packet = (OSC_Packet*)malloc(sizeof(OSC_Packet));

		packet->mReplyAddr.mAddress = boost::asio::ip::address();
		packet->mReplyAddr.mReplyFunc = inFunc;
		packet->mReplyAddr.mReplyData = inContext;
		packet->mReplyAddr.mSocket = 0;

		if(!UnrollOSCPacket(inWorld, inSize, inData, packet)) {
			return false;
	return true;

SC_DLLEXPORT_C bool World_SendPacket(World *inWorld, int inSize, char *inData, ReplyFunc inFunc)
	return World_SendPacketWithContext(inWorld, inSize, inData, inFunc, 0);

Any clues?
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/