/* draw_wave.q: render a wave on a GGI visual 09-25-03 AG */ /* This file is part of the Q programming system. The Q programming system is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. The Q programming system is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ import ggi; /* Render one channel of a wave on a visual. The wave is scaled to match the given dimensions. The arguments are as follows: - VIS = the visual to draw on; - P, DIM = upper-left corner (X,Y) and dimensions (W,H) of the target rectangle in which to draw the wave; - CHAN = the channel to draw (must be in the range 0..CHANNELS-1); - CHANNELS = number of channels (>=1); - FORMAT = sample format (must be one of PA_FLOAT32, PA_INT16 and PA_INT32); - DATA = the wave itself, as a byte string. The waveform is drawn in the current foreground color. At unit scale, one pixel is drawn for each sample. When zooming in (scale > 1), the samples are shown as tiny dots which are connected with straight lines. When zooming out (scale < 1), the range between the minimum and maximum sample values is shown for each pixel; moreoever, inside the waveform, the RMS (root mean square of sample values for each pixel) is shown in a shaded color. */ public extern draw_wave VIS P DIM CHAN CHANNELS FORMAT DATA;