home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / windows3 / mtlabsnd.zip / SKELEFF.C < prev    next >
Text File  |  1993-04-26  |  2KB  |  101 lines

  1.  
  2. /*
  3.  * July 5, 1991
  4.  * Copyright 1991 Lance Norskog And Sundry Contributors
  5.  * This source code is freely redistributable and may be used for
  6.  * any purpose.  This copyright notice must be maintained. 
  7.  * Lance Norskog And Sundry Contributors are not responsible for 
  8.  * the consequences of using this software.
  9.  */
  10.  
  11. /*
  12.  * Sound Tools skeleton effect file.
  13.  */
  14.  
  15. #include "st.h"
  16. #include <math.h>
  17.  
  18. /* Private data for SKEL file */
  19. typedef struct skelstuff {
  20.     int    rest;            /* bytes remaining in current block */
  21. } *skel_t;
  22.  
  23. /*
  24.  * Process options
  25.  */
  26. skel_getopts(effp, n, argv) 
  27. eff_t effp;
  28. int n;
  29. char **argv;
  30. {
  31.     if (n)
  32.         fail("Copy effect takes no options.");
  33. }
  34.  
  35. /*
  36.  * Prepare processing.
  37.  */
  38. skel_start(effp)
  39. eff_t effp;
  40. {
  41.     /* nothing to do */
  42.     /* stuff data into delaying effects here */
  43. }
  44.  
  45. /*
  46.  * Processed signed long samples from ibuf to obuf.
  47.  * Return number of samples processed.
  48.  */
  49.  
  50. skel_flow(effp, ibuf, obuf, isamp, osamp)
  51. eff_t effp;
  52. long *ibuf, *obuf;
  53. int *isamp, *osamp;
  54. {
  55.     skel_t skel = (skel_t) effp->priv;
  56.     int len, done;
  57.     
  58.     char c;
  59.     unsigned char uc;
  60.     short s;
  61.     unsigned short us;
  62.     long l;
  63.     unsigned long ul;
  64.     float f;
  65.     double d;
  66.  
  67.     len = ((*isamp > *osamp) ? *osamp : *isamp);
  68.     for(done = 0; done < len; done++) {
  69.         if no more samples
  70.             break
  71.         get a sample
  72.         l = sample converted to signed long
  73.         *buf++ = l;
  74.     }
  75.     *isamp = 
  76.     *osamp = 
  77. }
  78.  
  79. /*
  80.  * Drain out remaining samples if the effect generates any.
  81.  */
  82.  
  83. skel_drain(effp, obuf, osamp)
  84. long *obuf;
  85. int *osamp;
  86. {
  87.     *osamp = 0;
  88. }
  89.  
  90. /*
  91.  * Do anything required when you stop reading samples.  
  92.  *    (free allocated memory, etc.)
  93.  */
  94. skel_stop(effp)
  95. eff_t effp;
  96. {
  97.     /* nothing to do */
  98. }
  99.  
  100.  
  101.