Add session timer in the post window

This commit is contained in:
2024-05-14 11:20:18 +02:00
parent 176004f7c4
commit 6034e63638
3 changed files with 46 additions and 12 deletions

View File

@ -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);

View File

@ -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"