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

[sc-dev] SF.net SVN: quarks:[2532] Ctk/Ctk classes/CTK.sc



Revision: 2532
          http://quarks.svn.sourceforge.net/quarks/?rev=2532&view=rev
Author:   joshpar
Date:     2013-01-04 16:53:32 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
update CtkEvent, fix for group freeing

Modified Paths:
--------------
    Ctk/Ctk classes/CTK.sc

Modified: Ctk/Ctk classes/CTK.sc
===================================================================
--- Ctk/Ctk classes/CTK.sc	2013-01-04 06:44:58 UTC (rev 2531)
+++ Ctk/Ctk classes/CTK.sc	2013-01-04 16:53:32 UTC (rev 2532)
@@ -256,7 +256,7 @@
 
 	freeGroups {
 		masterGroups.do({arg me;
-			//me.freeAll(endtime)
+			me.freeAll(endtime)
 			})
 		}
 	// builds everything except the buffers since they act
@@ -280,20 +280,21 @@
 			allScores = allScores.add(thisctkev.score)
 			});
 		allScores.do({arg thisscore;
-			this.grabEvents(thisscore.groups, thisscore.notes, 				thisscore.controls, thisscore.buffers, thisscore.messages);
+			this.grabEvents(thisscore.groups, thisscore.notes,
+				thisscore.controls, thisscore.buffers, thisscore.messages);
 			});
 //		rt.not.if({
 //			this.addBuffers;
 //			});
 //		masterMessages = masterMessages ++ messages;
-		this.freeGroups;
+/*		this.freeGroups;
 		masterGroups.do({arg thisgroup;
 			(thisgroup.messages.size > 0).if({
 				thisgroup.messages.do({arg me;
 					masterMessages = masterMessages.add(me);
 					})
 				});
-			});
+			});*/
 		masterControls.do({arg thiscontrol;
 			(thiscontrol.messages.size > 0).if({
 				thiscontrol.messages.do({arg me;
@@ -305,6 +306,7 @@
 			var bundle, endmsg, oldval, refsSort;
 			endmsg = thisnote.getFreeMsg;
 			endmsg.notNil.if({
+				this.checkEndTime(endmsg);
 				masterMessages = masterMessages.add(endmsg);
 				});
 			thisnote.refsDict.do({arg key, val;
@@ -351,6 +353,7 @@
 				});
 			(thisnote.messages.size > 0).if({
 				thisnote.messages.reverseDo({arg me;
+					this.checkEndTime(me);
 					masterMessages = masterMessages.add(me);
 					})
 				});
@@ -374,6 +377,14 @@
 				});
 			});
 		masterNotes = masterNotes ++ allReleases;
+		this.freeGroups;
+		masterGroups.do({arg thisgroup;
+			(thisgroup.messages.size > 0).if({
+				thisgroup.messages.do({arg me;
+					masterMessages = masterMessages.add(me);
+					})
+				});
+			});
 //		rt.if({
 //			"Not rt!".postln;
 //			masterBuffers.do({arg thisbuffer;
@@ -1735,7 +1746,7 @@
 		}
 
 	deepFree {arg time = 0.0;
-		//this.freeAll(time);
+		this.freeAll(time);
 		}
 
 	}
@@ -2826,7 +2837,8 @@
 	// the CtkScore ... or WOW! I THINK IT WILL JUST WORK!)
 
 	score {arg sustime = 0;
-		var curtime, idx, eventEnd;
+		var curtime, idx, eventEnd, localEndtime;
+		localEndtime = 0.0;
 		// check first to make sure the condition, if it is an Env, has a definite duration
 		condition.isKindOf(Env).if({
 			condition.releaseNode.notNil.if({
@@ -2867,9 +2879,17 @@
 					(me.starttime > eventEnd).if({
 						score.notes.remove(me)
 						}, {
+							(me.endtime < localEndtime).if({
+
+								localEndtime = me.endtime
+							});
 						score.add(me)
 						});
 					}, {
+						(me.endtime < localEndtime).if({
+
+								localEndtime = me.endtime
+						});
 					score.add(me)
 					})
 				});
@@ -2878,7 +2898,7 @@
 			this.checkCond;
 			});
 		group.setStarttime(starttime);
-		group.setDuration(score.endtime);
+		group.endtime_(score.endtime);
 		score.add(group);
 		this.scoreClear;
 		^score;

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/