Skip to content

Commit af76ad6

Browse files
committed
fix some issues with number writer.
1 parent 9d97c13 commit af76ad6

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

cmd/catnip/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func newZeroConfig() config {
7575
useThreaded: false,
7676
invertDraw: false,
7777
useNumberWriter: false,
78-
numberWriterBins: 0,
78+
numberWriterBins: 50,
7979
}
8080
}
8181

cmd/catnip/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func main() {
5959
} else {
6060
writer := NewWriter()
6161
writer.Init(cfg.sampleRate, cfg.sampleSize)
62+
writer.SetBinCount(cfg.numberWriterBins)
6263
writer.SetInvertDraw(cfg.invertDraw)
6364
output = writer
6465
}
@@ -184,8 +185,8 @@ func doFlags(cfg *config) bool {
184185
parser.Bool(&cfg.useThreaded, "t", "threaded", "use the threaded processor")
185186
parser.Bool(&cfg.invertDraw, "i", "invert", "invert the direction of bin drawing")
186187

187-
parser.Bool(&cfg.useNumberWriter, "nw", "number-writer", "use writer (default: false)")
188-
parser.Int(&cfg.numberWriterBins, "nwb", "number-writer-bins", "number of bins for the number writer per channel. (default 50)")
188+
parser.Bool(&cfg.useNumberWriter, "nw", "number-writer", "use writer")
189+
parser.Int(&cfg.numberWriterBins, "nwb", "number-writer-bins", "number of bins for the number writer per channel.")
189190

190191
fg, bg, center := graphic.DefaultStyles().AsUInt16s()
191192
parser.UInt16(&fg, "fg", "foreground",

cmd/catnip/number_writer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ func (d *Writer) Close() error {
4747
return nil
4848
}
4949

50+
func (d *Writer) SetBinCount(count int) {
51+
d.binCount = count
52+
}
53+
5054
func (d *Writer) SetInvertDraw(invert bool) {
5155
d.invertDraw = invert
5256
}

0 commit comments

Comments
 (0)