Add session timer in the post window
This commit is contained in:
@ -70,20 +70,25 @@ Boot {
|
||||
|
||||
*installServerTreeBehavior {
|
||||
CmdPeriod.add({
|
||||
BuboUtils.fancyPrint("\nBubo SuperCollider Session\nTempo: % | Peers: %\nCPU: % | Peak: %\n".format(
|
||||
this.clock.tempo * 60, this.clock.numPeers, Server.default.avgCPU.round(2), Server.default.peakCPU.round(2)), 40);
|
||||
BuboUtils.fancyPrint("\nBubo SuperCollider Session\nTempo: % | Peers: %\nCPU: % | Peak: %\n".format(
|
||||
this.clock.tempo * 60,
|
||||
this.clock.numPeers,
|
||||
Server.default.avgCPU.round(2),
|
||||
Server.default.peakCPU.round(2)),
|
||||
40
|
||||
);
|
||||
|
||||
// This Routine prints the current server state
|
||||
Tdef(\log, {
|
||||
loop {
|
||||
"TP: %/% CPU: %".format(
|
||||
TempoClock.default.bar,
|
||||
TempoClock.default.beats,
|
||||
Server.default.avgCPU
|
||||
).postln;
|
||||
1.0.wait;
|
||||
}
|
||||
}).play;
|
||||
Tdef(\log, {
|
||||
loop {
|
||||
"[TIME: %] | [TP: %/%] | [CPU: % ]".format(
|
||||
BuboUtils.timer(),
|
||||
TempoClock.default.bar, TempoClock.default.beats,
|
||||
Server.default.avgCPU.asInteger
|
||||
).postln;
|
||||
1.0.wait;
|
||||
}
|
||||
}).play;
|
||||
|
||||
}, Server.default);
|
||||
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
BuboUtils {
|
||||
|
||||
*timer {
|
||||
var time = Main.elapsedTime;
|
||||
var hours = (time / 3600).asInteger;
|
||||
var minutes = ((time % 3600) / 60).asInteger;
|
||||
var secs = (time % 60).asInteger;
|
||||
^("%:%:%".format(hours, minutes, secs))
|
||||
}
|
||||
|
||||
*banner {
|
||||
var banner = "┳┓ ┓ ┳┓ ┓ ┳┓\n"
|
||||
"┣┫┓┏┣┓┏┓┣┫┓┏┣┓┏┓ ┣┫┏┓┏┓╋\n"
|
||||
|
||||
Reference in New Issue
Block a user