Skip to content

Commit 47f7a09

Browse files
committed
move app files to cmd directory.
1 parent e239450 commit 47f7a09

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ git clone https://github.com/noriah/catnip.git
4646
cd catnip
4747

4848
# build and install catnip
49-
go install
49+
go install ./cmd/catnip
5050

5151
# with portaudio
52-
go install -tags withportaudio
52+
go install ./cmd/catnip -tags withportaudio
5353

5454
# with fftw3
55-
go install -tags withfftw
55+
go install ./cmd/catnip -tags withfftw
5656

5757
# with both portaudio and fftw3
58-
go install -tags withportaudio,withfftw
58+
go install ./cmd/catnip -tags withportaudio,withfftw
5959
```
6060

6161
## run it

catnip.go renamed to cmd/catnip/catnip.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ func catnip(cfg *config) error {
5151
// PROCESSOR SETUP
5252

5353
inputBuffers := input.MakeBuffers(cfg.channelCount, cfg.sampleSize)
54-
// visBuffers := input.MakeBuffers(cfg.channelCount, cfg.sampleSize)
5554

5655
procConfig := processor.Config{
5756
SampleRate: cfg.sampleRate,
File renamed without changes.
File renamed without changes.

graphic/display.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ func (d *Display) inputProcessor() {
193193

194194
default:
195195
switch ev.Ch {
196+
case 'i', 'I':
197+
d.SetInvertDraw(!d.invertDraw)
198+
196199
case '+', '=':
197200
d.AdjustBase(1)
198201

@@ -282,7 +285,7 @@ func (d *Display) fillStyleBuffer(left, center, right int) {
282285
}
283286

284287
// Draw takes data and draws.
285-
func (d *Display) Write(bufs [][]float64, channels int, peak float64) error {
288+
func (d *Display) Write(buffers [][]float64, channels int, peak float64) error {
286289

287290
scale := 1.0
288291
// do some scaling if we are above the PeakThreshold
@@ -308,22 +311,22 @@ func (d *Display) Write(bufs [][]float64, channels int, peak float64) error {
308311

309312
switch d.drawType {
310313
case DrawUp:
311-
d.DrawUp(bufs, channels, scale)
314+
d.DrawUp(buffers, channels, scale)
312315

313316
case DrawUpDown:
314-
d.DrawUpDown(bufs, channels, scale)
317+
d.DrawUpDown(buffers, channels, scale)
315318

316319
case DrawDown:
317-
d.DrawDown(bufs, channels, scale)
320+
d.DrawDown(buffers, channels, scale)
318321

319322
case DrawLeft:
320-
d.DrawLeft(bufs, channels, scale)
323+
d.DrawLeft(buffers, channels, scale)
321324

322325
case DrawLeftRight:
323-
d.DrawLeftRight(bufs, channels, scale)
326+
d.DrawLeftRight(buffers, channels, scale)
324327

325328
case DrawRight:
326-
d.DrawRight(bufs, channels, scale)
329+
d.DrawRight(buffers, channels, scale)
327330

328331
default:
329332
return nil

processor/processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (vis *processor) Start(ctx context.Context) context.Context {
9393

9494
func (vis *processor) Stop() {}
9595

96-
// Process runs one draw refresh with the processor on the termbox screen.
96+
// Process runs processing on sample sets and calls Write on the output once per sample set.
9797
func (vis *processor) Process(ctx context.Context, kickChan chan bool, mu *sync.Mutex) {
9898

9999
if vis.frameRate <= 0 {

0 commit comments

Comments
 (0)