home *** CD-ROM | disk | FTP | other *** search
/ Audio 4.94 - Over 11,000 Files / audio-11000.iso / amiga / utils / exp_iv / player.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-21  |  4.5 KB  |  169 lines

  1. /* player.h */
  2.  
  3. /* data structure for the song, and such
  4.  */
  5.  
  6. /* $Author: Espie $
  7.  * $Date: 91/05/20 22:44:10 $
  8.  * $Revision: 1.21 $
  9.  * $Log:    player.h,v $
  10.  * Revision 1.21  91/05/20  22:44:10  Espie
  11.  * *** empty log message ***
  12.  * 
  13.  * Revision 1.20  91/05/12  16:01:27  Espie
  14.  * *** empty log message ***
  15.  *
  16.  * Revision 1.19  91/05/06  15:14:30  Espie
  17.  * *** empty log message ***
  18.  *
  19.  * Revision 1.18  91/05/05  19:06:04  Espie
  20.  * Added some new private fields.
  21.  *
  22.  * Revision 1.17  91/05/05  15:38:42  Espie
  23.  * Augmented private structure, still searching its self.
  24.  *
  25.  * Revision 1.16  91/05/02  01:29:08  Espie
  26.  * Needs some more simplification.
  27.  *
  28.  * Revision 1.15  91/04/30  00:35:30  Espie
  29.  * Stable version III.
  30.  *
  31.  * Revision 1.14  91/04/29  15:06:13  Espie
  32.  * No real modification this time.
  33.  *
  34.  * Revision 1.13  91/04/28  22:53:18  Espie
  35.  * tranpose added.
  36.  *
  37.  * Revision 1.12  91/04/28  20:36:29  Espie
  38.  * New fields for finespeed.
  39.  * Plus timerbase/effectbase.
  40.  *
  41.  * Revision 1.11  91/04/27  20:49:31  Espie
  42.  * New t
  43.  * timing speed.
  44.  *
  45.  * Revision 1.10  91/04/27  16:43:39  Espie
  46.  * Added some new fields, and some comments.
  47.  * Beginning the cleanup of that structure.
  48.  *
  49.  * Revision 1.9  91/04/27  03:59:55  Espie
  50.  * New fields, needs some editing anyway.
  51.  * ---> specify an interface for the player.
  52.  *
  53.  * Revision 1.8  91/04/27  00:24:20  Espie
  54.  * See player.c, interrupt.c (new state variable, switch to a function variable,
  55.  * i.e., case folding).
  56.  *
  57.  * Revision 1.7  91/04/26  16:31:30  Espie
  58.  * New fields for timing management, not yet perfect.
  59.  *
  60.  * Revision 1.6  91/04/23  21:29:37  Espie
  61.  * Some new commands for in the player
  62.  *
  63.  * Revision 1.5  91/04/21  20:05:29  Espie
  64.  * Notes added.
  65.  *
  66.  * Revision 1.4  91/04/21  12:11:52  Espie
  67.  * Stable version, known as bunch II.
  68.  * Also features ``right'' log description.
  69.  *
  70.  * Revision 1.3  91/04/20  18:12:54  Espie
  71.  *
  72.  * Revision 1.2  91/04/19  13:20:08  Espie
  73.  * New control structure for signalling tasks.
  74.  *
  75.  * Revision 1.1  91/04/19  02:20:36  Espie
  76.  * Initial revision
  77.  *
  78.  */
  79.  
  80. #include "periods.h"
  81.  
  82. #define NUMBER_TRACKS 4
  83. #define NUMBER_COMMANDS 16
  84. #define LENGTH_SINE 32
  85.  
  86. typedef void (*COMMAND)(struct play *play, struct automaton *cst);
  87.  
  88. struct automaton {
  89.         COMMAND pursue;                 /* what to do to continue the current note */
  90.         struct sample_info *instr;      /* the current sample */
  91.         int period;                                     /* the current period */
  92.         int pergoal;                            /* the period to achieve */
  93.         int volume;                                     /* the current volume */
  94.         int rate;                                       /* parameters for effects, and fold values */
  95.         int offset;                                     /* could use an union there... */
  96.         int depth;
  97.         int speed;
  98.         UWORD *p_table;
  99.         UBYTE channel, note;
  100.         UBYTE arp1, arp2;
  101.         BOOL newnote;                           /* have we played a new note (must set up replay) */
  102.         };
  103.  
  104.  
  105. struct priv_play
  106.         {
  107.                 void (*state)(struct play *play);
  108.                 int volume;
  109.                 BOOL filter;
  110.                 struct automaton *track[NUMBER_TRACKS];
  111. /* sine table for vibrato command */
  112.                 BYTE *sine_table;
  113.                 COMMAND *setup;
  114. /* periods.c value */
  115.                 UWORD **period_table;
  116.                 UBYTE *channel_mask;
  117.  
  118.  
  119.                 struct block *block;
  120.  
  121. /* the particular event we're processing
  122.  */
  123.                 struct event *e;
  124.  
  125.                 UBYTE counter, speed;
  126.                 UWORD finespeed;
  127.                 BOOL replay, tempo_change, has_ended;
  128.  
  129. /* used for the change patterns command
  130.  * (code: -1 ==> nothing.
  131.  * else pattern, or position)
  132.  */
  133.                 BYTE skip, fastskip;
  134.  
  135. /* used for the change speed command
  136.  * code: -1 ==> nothing.
  137.  */
  138.                 WORD newspeed;
  139.  
  140.                 volatile UBYTE *latchlo, *latchhi;
  141.                 volatile UBYTE *control;
  142.  
  143. /* the timing values are finally private */
  144.                 UWORD maintimer, smalltimer, effecttimer;
  145.  
  146. /* measures the time already spent, for restarting dma after a delay,
  147.  * which relatch normally does not provide.
  148.  */
  149.                 int spent;
  150.  
  151. /* the last value we put into the latch,
  152.  *      the current elapsed time since last timer restart.
  153.  */
  154.                 int latched, current;
  155.  
  156. /* some values we keep a private copy of
  157.  */
  158.  
  159.                 UBYTE pattern, position;
  160.  
  161.  
  162. /* audio_hard values */
  163.                 ULONG mask;
  164.                 UBYTE saved_filter;
  165.  
  166.  
  167.  
  168.         };
  169.