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

[sc-dev] SF.net SVN: supercollider:[8139] trunk



Revision: 8139
          http://supercollider.svn.sourceforge.net/supercollider/?rev=8139&view=rev
Author:   ctrl-t
Date:     2008-12-15 08:44:21 +0000 (Mon, 15 Dec 2008)

Log Message:
-----------
Buffers send bufnum with SendDone msg

Modified Paths:
--------------
    trunk/Headers/server/SC_Prototypes.h
    trunk/Headers/server/SC_SequencedCommand.h
    trunk/Source/server/SC_Lib.cpp
    trunk/Source/server/SC_SequencedCommand.cpp

Modified: trunk/Headers/server/SC_Prototypes.h
===================================================================
--- trunk/Headers/server/SC_Prototypes.h	2008-12-15 08:41:56 UTC (rev 8138)
+++ trunk/Headers/server/SC_Prototypes.h	2008-12-15 08:44:21 UTC (rev 8139)
@@ -183,6 +183,7 @@
 ////////////////////////////////////////////////////////////////////////
 
 void SendDone(struct ReplyAddress *inReply, const char *inCommandName);
+void SendDoneWithIntValue(struct ReplyAddress *inReply, const char *inCommandName, int value);
 void SendFailure(struct ReplyAddress *inReply, const char *inCommandName, const char *errString);
 void ReportLateness(struct ReplyAddress *inReply, float32 seconds);
 void DumpReplyAddress(struct ReplyAddress *inReplyAddress);

Modified: trunk/Headers/server/SC_SequencedCommand.h
===================================================================
--- trunk/Headers/server/SC_SequencedCommand.h	2008-12-15 08:41:56 UTC (rev 8138)
+++ trunk/Headers/server/SC_SequencedCommand.h	2008-12-15 08:44:21 UTC (rev 8139)
@@ -69,7 +69,9 @@
 	virtual void Stage4();	// non real time
 	
 	void SendDone(const char *inCommandName);
+	void SendDoneWithIntValue(const char *inCommandName, int value);
 	
+	
 protected:
 	int mNextStage;
 	ReplyAddress mReplyAddress;

Modified: trunk/Source/server/SC_Lib.cpp
===================================================================
--- trunk/Source/server/SC_Lib.cpp	2008-12-15 08:41:56 UTC (rev 8138)
+++ trunk/Source/server/SC_Lib.cpp	2008-12-15 08:44:21 UTC (rev 8139)
@@ -41,6 +41,19 @@
 	SendReply(inReply, packet.data(), packet.size());
 };
 
+void SendDoneWithIntValue(ReplyAddress *inReply, const char *inCommandName, int value)
+{
+	small_scpacket packet;
+	packet.adds("/done");
+	packet.maketags(3);
+	packet.addtag(',');
+	packet.addtag('s');
+	packet.adds(inCommandName);
+	packet.addtag('i');
+	packet.addi(value);	
+	SendReply(inReply, packet.data(), packet.size());
+};
+
 void SendFailure(ReplyAddress *inReply, const char *inCommandName, const char *errString)
 {
 	small_scpacket packet;

Modified: trunk/Source/server/SC_SequencedCommand.cpp
===================================================================
--- trunk/Source/server/SC_SequencedCommand.cpp	2008-12-15 08:41:56 UTC (rev 8138)
+++ trunk/Source/server/SC_SequencedCommand.cpp	2008-12-15 08:44:21 UTC (rev 8139)
@@ -135,6 +135,11 @@
 	::SendDone(&mReplyAddress, inCommandName);
 };
 
+void SC_SequencedCommand::SendDoneWithIntValue(const char *inCommandName, int value)
+{
+	::SendDoneWithIntValue(&mReplyAddress, inCommandName, value);
+};
+
 void SC_SequencedCommand::CallEveryStage()
 {
 	switch (mNextStage) {
@@ -320,7 +325,7 @@
 void BufAllocCmd::Stage4()
 {
 	free(mFreeData);
-	SendDone("/b_alloc");
+	SendDoneWithIntValue("/b_alloc", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -386,7 +391,7 @@
 void BufGenCmd::Stage4()
 {
 	free(mFreeData);
-	SendDone("/b_gen");
+	SendDoneWithIntValue("/b_gen", mBufIndex);
 }
 
 
@@ -439,7 +444,7 @@
 void BufFreeCmd::Stage4()
 {
 	free(mFreeData);
-	SendDone("/b_free");
+	SendDoneWithIntValue("/b_free", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -480,7 +485,7 @@
 
 void BufZeroCmd::Stage4()
 {
-	SendDone("/b_zero");
+	SendDoneWithIntValue("/b_zero", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -580,7 +585,7 @@
 void BufAllocReadCmd::Stage4()
 {
 	free(mFreeData);
-	SendDone("/b_allocRead");
+	SendDoneWithIntValue("/b_allocRead", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -692,7 +697,7 @@
 
 void BufReadCmd::Stage4()
 {
-	SendDone("/b_read");
+	SendDoneWithIntValue("/b_read", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -856,7 +861,7 @@
 void BufAllocReadChannelCmd::Stage4()
 {
 	free(mFreeData);
-	SendDone("/b_allocReadChannel");
+	SendDoneWithIntValue("/b_allocReadChannel", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -984,7 +989,7 @@
 
 void BufReadChannelCmd::Stage4()
 {
-	SendDone("/b_readChannel");
+	SendDoneWithIntValue("/b_readChannel", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -1077,7 +1082,7 @@
 
 void BufWriteCmd::Stage4()
 {
-	SendDone("/b_write");
+	SendDoneWithIntValue("/b_write", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////
@@ -1120,7 +1125,7 @@
 
 void BufCloseCmd::Stage4()
 {
-	SendDone("/b_close");
+	SendDoneWithIntValue("/b_close", mBufIndex);
 }
 
 ///////////////////////////////////////////////////////////////////////////


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

_______________________________________________
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/