/*==================================================================
  ==================================================================
  ==	XMusic -- An Interactive Interface to Csound		  ==
  ==       Copyright (C) 1988 by George D. Drapeau                ==
  ==                  All Rights Reserved                         ==
  ==================================================================
  ==================================================================
*/
/* $Log:	defs.h,v $
 * Revision 1.4  89/08/06  17:59:43  drapeau
 *  Cleaned up the code for first X11 release.
 *  */

#define SineTool	0
#define EnvTool		1
#define SumTool		2
#define AmpTool		3
#define ParamTool	4
#define NoiseTool	5
#define EQTool		6
#define AmpSide		0
#define FreqSide	1
#define Middle		2
#define AudioRate	0
#define ControlRate	1
#define InitRate	2
#define TOOLSIZE	64
#define NUMTOOLS	7
#define MAXSTRLEN	63
#define INFOSTRLEN	24
#define MINWIDTH	600
#define MINHEIGHT	300
#define DEFWIDTH	MINWIDTH
#define DEFHEIGHT	MINHEIGHT
#define EXITSIZE	3
#define HELPSIZE	20
#define INFOSIZE	12
#define MUSICFONTNAME	"*times-medium-r-normal--18*"
#define min(x,y) x<y ? x : y
#define max(x,y) x>y ? x : y
#define EQ(s,t) (!strcmp((s),(t)))

#ifdef USEBITMAPS
#include "bitmaps/mCursor.bitmap"
#include "bitmaps/tCursor.bitmap"
#include "bitmaps/sine64.bitmap"
#include "bitmaps/sum64.bitmap"
#include "bitmaps/env64.bitmap"
#include "bitmaps/amp64.bitmap"
#include "bitmaps/mIcon.bitmap"
#include "bitmaps/param64.bitmap"
#include "bitmaps/noise64.bitmap"
#include "bitmaps/eq64.bitmap"
#endif

typedef struct ToolNode
{
  int			type;					    /* e.g. SineTool, EQTool, etc. */
  int			toolNum;				    /* What number tool is it in the list of tools? */
  int			visited;				    /* Used for writing the Csound file from a diagram */
  int			rate;					    /* Audio, Control, or Init time for this tool */
  Pixmap		map;					    /* id of the Pixmap to use when drawing this tool */
  int			x,y;					    /* Coordinates of the tool */
  char			*name;					    /* Given to a tool as it's created */
  struct ToolNode	*input1, *input2, *output, *next;	    /* Pointers to other tools */
  struct ToolNode       *input3, *input4, *input5, *input6;	    /* 		.	       */
  struct ToolNode	*input7, *input8;			    /* 		.	       */
  char			*fName;					    /* Name of Csound function, e.g. "oscil" */
  char			*arg1,*arg2,*arg3,*arg4,*arg5,*arg6,*arg7,*arg8; /* Arguments to the Csound function */
} Tool;

#ifdef USEFILES
typedef struct FileNode						    /* Structure to hold tools written to a diagram file */
{
  int			type,toolNum,rate;
  int			x,y, in1,in2,out,nameLen,fNameLen;
  int			in3,in4,in5,in6,in7,in8;
  int			arg1Len,arg2Len,arg3Len,arg4Len;
  int			arg5Len,arg6Len,arg7Len,arg8Len;
  char			name[MAXSTRLEN], fName[MAXSTRLEN];
  char			arg1[MAXSTRLEN], arg2[MAXSTRLEN], arg3[MAXSTRLEN];
  char			arg4[MAXSTRLEN], arg5[MAXSTRLEN], arg6[MAXSTRLEN];
  char			arg7[MAXSTRLEN], arg8[MAXSTRLEN];
} FileTool;
#endif
