view src/libst.h @ 1279:cd0abfdb9e9d

[xemacs-hg @ 2003-02-09 09:33:42 by ben] walk-windows, redisplay fixes console-stream.c: Abort when any attempts to output a stream console are made. Should be caught sooner. event-msw.c: Don't redisplay() during sizing when the frame has not yet been initialized completely. event-stream.c, menubar-msw.c, menubar-x.c, menubar.c, menubar.h: Restore in_menu_callback. Bind it in menubar-{msw,x}.c when calling filter functions and the like. Conditionalize on it, not in_modal_loop, when issuing error in `next-event', otherwise we bite the dust immediately -- event-msw.c purposely calls Fnext_event() in a modal loop, and knows what it's doing. redisplay-output.c: Formatting fixes. redisplay.c, window.c, winslots.h: Delete lots of carcasses of attempts to add redisplay support for font-lock -- `pre/post-redisplay-hook', unimplemented junk from FSF (redisplay-end-trigger, `window-scroll-functions', `window-size-change-functions'). If we want to port some redisplay support from FSF, port the `fontified' property. redisplay.c: Put in a check here (as well as redisplay_device()) for a stream frame. We can get here directly through Lisp fun `redisplay-frame'. Abort if frame not initialized. redisplay.c: Check for stream frames/devices. window.el: walk-windows was broken when a frame was given to WHICH-FRAMES. it would loop forever. The FSF version fixes this but i didn't sync to them because (a) it conses (bad for lazy-lock), (b) it calls select-window.
author ben
date Sun, 09 Feb 2003 09:33:48 +0000
parents 74fd4e045ea6
children 697ef44129c6
line wrap: on
line source

/* libst.h - include file for portable sound tools library
**
** Copyright (C) 1989 by Jef Poskanzer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation.  This software is provided "as is" without express or
** implied warranty.
*/

/* Synched up with: Not in FSF. */

#ifndef INCLUDED_libst_h_
#define INCLUDED_libst_h_

#define SAMPLES_PER_SECOND 8192

#define MINLIN -32768
#define MAXLIN 32767
#define LINCLIP(x) do { if ( x < MINLIN ) x = MINLIN ; else if ( x > MAXLIN ) x = MAXLIN; } while ( 0 )

unsigned char st_linear_to_ulaw( /* int sample */ );
int st_ulaw_to_linear_slow( /* unsigned char ulawbyte */ );

/*
** This macro converts from ulaw to 16 bit linear, faster.
**
** Jef Poskanzer
** 23 October 1989
**
** Input: 8 bit ulaw sample
** Output: signed 16 bit linear sample
*/
#define st_ulaw_to_linear(ulawbyte) ulaw_table[ulawbyte]

static int ulaw_table[256] = {
    -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956,
    -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764,
    -15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412,
    -11900, -11388, -10876, -10364,  -9852,  -9340,  -8828,  -8316,
     -7932,  -7676,  -7420,  -7164,  -6908,  -6652,  -6396,  -6140,
     -5884,  -5628,  -5372,  -5116,  -4860,  -4604,  -4348,  -4092,
     -3900,  -3772,  -3644,  -3516,  -3388,  -3260,  -3132,  -3004,
     -2876,  -2748,  -2620,  -2492,  -2364,  -2236,  -2108,  -1980,
     -1884,  -1820,  -1756,  -1692,  -1628,  -1564,  -1500,  -1436,
     -1372,  -1308,  -1244,  -1180,  -1116,  -1052,   -988,   -924,
      -876,   -844,   -812,   -780,   -748,   -716,   -684,   -652,
      -620,   -588,   -556,   -524,   -492,   -460,   -428,   -396,
      -372,   -356,   -340,   -324,   -308,   -292,   -276,   -260,
      -244,   -228,   -212,   -196,   -180,   -164,   -148,   -132,
      -120,   -112,   -104,    -96,    -88,    -80,    -72,    -64,
       -56,    -48,    -40,    -32,    -24,    -16,     -8,      0,
     32124,  31100,  30076,  29052,  28028,  27004,  25980,  24956,
     23932,  22908,  21884,  20860,  19836,  18812,  17788,  16764,
     15996,  15484,  14972,  14460,  13948,  13436,  12924,  12412,
     11900,  11388,  10876,  10364,   9852,   9340,   8828,   8316,
      7932,   7676,   7420,   7164,   6908,   6652,   6396,   6140,
      5884,   5628,   5372,   5116,   4860,   4604,   4348,   4092,
      3900,   3772,   3644,   3516,   3388,   3260,   3132,   3004,
      2876,   2748,   2620,   2492,   2364,   2236,   2108,   1980,
      1884,   1820,   1756,   1692,   1628,   1564,   1500,   1436,
      1372,   1308,   1244,   1180,   1116,   1052,    988,    924,
       876,    844,    812,    780,    748,    716,    684,    652,
       620,    588,    556,    524,    492,    460,    428,    396,
       372,    356,    340,    324,    308,    292,    276,    260,
       244,    228,    212,    196,    180,    164,    148,    132,
       120,    112,    104,     96,     88,     80,     72,     64,
	56,     48,     40,     32,     24,     16,      8,      0 };

#endif /* INCLUDED_libst_h_ */