o Output resulting size after pixel mapping.

o Always print reason for exit. Print it after Matrix has been shut
  down, so that we print after the last refresh-rate output has been
  done, thus we end with a clean newline at end of our output.
  (otherwise, the command-line editing afterwards is a little challenging
   as bash has trouble when the prompt does not start at zero)
This commit is contained in:
Henner Zeller 2016-09-05 10:17:33 -07:00
parent b008c315ff
commit 58ca02982e

View file

@ -1160,6 +1160,8 @@ int main(int argc, char *argv[]) {
matrix->ApplyStaticTransformer(RotateTransformer(rotation));
}
printf("Size: %dx%d\n", matrix->width(), matrix->height());
Canvas *canvas = matrix;
// The ThreadedCanvasManipulator objects are filling
@ -1245,12 +1247,13 @@ int main(int argc, char *argv[]) {
while (!interrupt_received) {
sleep(1); // Time doesn't really matter. The syscall will be interrupted.
}
fprintf(stderr, "\nReceived interrupt. Stopping.\n");
}
// Stop image generating thread. The delete triggers
delete image_gen;
delete canvas;
printf("\%s. Exiting.\n",
interrupt_received ? "Received CTRL-C" : "Timeout reached");
return 0;
}