shithub: pplay

Download patch

ref: cb5c7c76921d6e656102eac49178874fb3d60e3c
parent: 4979c45ce6223b28b1129fc79f3f007f6c3bb766
author: qwx <qwx@sciops.net>
date: Mon Aug 5 09:01:30 EDT 2024

small fixes

--- a/chunk.c
+++ b/chunk.c
@@ -61,12 +61,10 @@
 	c = r;
 	len = 0;
 	do{
-		fprint(2, "\t%χ\toff=%08zux\n", c, len);
 		assert(c->right->left == c);
 		len += c->len;
 		c = c->right;
 	}while(c != r);
-	fprint(2, "\n");
 }
 
 void
--- a/cmd.c
+++ b/cmd.c
@@ -238,16 +238,6 @@
 	return 0;
 }
 
-void
-quit(void)
-{
-	// FIXME: no, have yield/sleep/...
-	threadsetgrp(1);
-	threadkillgrp(0);
-	threadintgrp(0);
-	threadexits(nil);
-}
-
 int
 cmd(char *s)
 {
@@ -279,7 +269,7 @@
 	case 'j': x = jumpto(s); break;
 	//case 'm': x = mark(s); break;
 	case 'p': x = paste(s); break;
-	case 'q': quit();
+	case 'q': threadexitsall(nil);
 	case 'r': x = readfrom(s); break;
 	case 's': x = replicate(s); break;
 	case 'U': x = unpop(s); break;
--- a/dat.h
+++ b/dat.h
@@ -38,7 +38,7 @@
 	usize from;
 	usize to;
 	usize cur;
-	usize off;
+	ssize off;
 	usize totalsz;
 	Chunk *norris;
 };
@@ -45,6 +45,7 @@
 struct Track{
 	Dot;
 	Rekt;
+	int working;
 	// FIXME: both for samples:
 	vlong len;
 	s16int *graph[2];
--- a/pplay.c
+++ b/pplay.c
@@ -172,9 +172,9 @@
 		case 2:
 			switch(r){
 			case Kdel:
-			case 'q': quit();
+			case 'q': threadexitsall(nil);
 			case 'D': debugdraw ^= 1; refresh(Drawrender); break;
-			case 'S': stereo ^= 1; redraw(1); break;
+			case 'S': stereo ^= 1; refresh(Drawall); break;
 			case ' ': toggleplay(); break;
 			case 'b': setjump(current->from); break;
 			case Kesc: setrange(0, current->totalsz); break;