monoscope.h 784 Bytes
Newer Older
Richard Boulton's avatar
Richard Boulton committed
1 2 3 4
#ifndef _MONOSCOPE_H
#define _MONOSCOPE_H

#include <glib.h>
5
#include "convolve.h"
Richard Boulton's avatar
Richard Boulton committed
6

7 8 9
#define convolver_depth 8
#define convolver_small (1 << convolver_depth)
#define convolver_big (2 << convolver_depth)
10 11 12
#define scope_width 256
#define scope_height 128

Johan Dahlin's avatar
Johan Dahlin committed
13
struct monoscope_state {
14 15 16 17
  short copyEq[convolver_big];
  int avgEq[convolver_small];      /* a running average of the last few. */
  int avgMax;                     /* running average of max sample. */
  guint32 display[scope_width * scope_height];
18

19 20
  convolve_state *cstate;
  guint32 colors[64];
21 22
};

Johan Dahlin's avatar
Johan Dahlin committed
23
struct monoscope_state * monoscope_init (guint32 resx, guint32 resy);
24
guint32 * monoscope_update (struct monoscope_state * stateptr, gint16 data [convolver_big]);
Johan Dahlin's avatar
Johan Dahlin committed
25
void monoscope_close (struct monoscope_state * stateptr);
Richard Boulton's avatar
Richard Boulton committed
26 27

#endif