home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / dir_nm20.zip / Dir_NM_2.0 / NM.h < prev    next >
C/C++ Source or Header  |  1992-07-16  |  5KB  |  197 lines

  1. /*                             =====  IM.h  ===== 
  2. */
  3.  
  4. #include <X11/Xlib.h>
  5. #include <X11/Xutil.h>
  6. #include <X11/Xos.h>
  7. #include <X11/keysym.h>
  8. #include <math.h>
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include <sys/types.h>
  13. #include <sys/stat.h>
  14. #include <dirent.h>
  15. #include <sys/time.h>
  16.  
  17. /* Some global Xlib variables used in all files: */
  18.  
  19. extern Display *display;
  20. extern int      screen;
  21. extern Window win;
  22. extern GC gc;
  23.  
  24. extern XFontStruct  *font_info;
  25. extern XWindowAttributes attribs;
  26. extern char tmpstr[128];
  27. extern Colormap theCmap,cmap;
  28. extern XColor mycolor,exactcolor,mine;
  29.  
  30. #define Sign(A) ((A) > 0 ? 1.0 : ( (A) < 0 ? -1.0 : 0.0))
  31. #define Max(A,B) ((A) >= (B) ? (A) : (B))
  32. #define Min(A,B) ((A) <= (B) ? (A) : (B))
  33.  
  34. #define St_Start       30
  35. #define Text_Base      35
  36. #define Max_kind       36
  37. #define Max_Row      1000
  38. #define Max_Column     37
  39.  
  40. #define Input_On        1
  41. #define List_On         2
  42. #define Output_On       3
  43.  
  44. #define Re_Name_On      4
  45. #define Move_On         5
  46. #define Delete_On       6
  47.  
  48. #define Value_On        7
  49. #define Check_Tmp_On    8
  50. #define Switch_On       9
  51.  
  52. #define Combine_On     10
  53.  
  54. #define Load_Text_On   13
  55. #define Tempo_Set_On   14
  56.  
  57. #define Timbre_On      16
  58. #define Words_On       17
  59. #define Dance_On       18
  60. #define Sounds_On      19
  61. #define Voice_On       20
  62. #define Piano_On       21
  63. #define Print_On       22
  64.  
  65. #define M_Len         630
  66.  
  67. typedef unsigned char BYTE;
  68. typedef int two[2][7];
  69. typedef char str16[17];
  70. typedef int ary16[16];
  71.  
  72.  
  73. typedef struct Chord {
  74.   int nt[4],act,vol;
  75. } Chord;
  76.  
  77. typedef struct Chord_Used {
  78.   int Num;
  79.   int Next;
  80.   int Nt[10][3];
  81. } Chord_Used;
  82.  
  83. typedef struct Tempo_Unit {
  84.   int note,act;
  85. } Tempo_Unit;
  86.  
  87. typedef struct fast 
  88. {
  89.   int nt[4],at,cm;
  90. } fast;
  91.  
  92. typedef struct contmp 
  93. {
  94.   char Set_name[50];
  95.   int tempo[6],instru[6];
  96. } Tempo_Set;
  97.  
  98. typedef struct more 
  99. {
  100.   char tool[13];
  101.   int freq[20];
  102. } more;
  103.  
  104. typedef struct stater 
  105. {
  106.   char word[17];
  107.   ary16 say;
  108.   struct stater *nxtone;
  109. } stater;
  110.  
  111. typedef struct midstate 
  112. {
  113.   char word[17];
  114.   ary16 say;
  115. } midstate;
  116.  
  117. typedef struct pair 
  118. {
  119.   int a,b;
  120. } pair;
  121.  
  122. Chord St[1000][M_Len][3],sample[M_Len][3],pm;
  123. Tempo_Unit tmp[1000][30],tmp_buf[1000][30];
  124.  
  125. Chord_Used Chord_Bank[320];
  126.  
  127. fast ptr_;
  128. Tempo_Set cont[1000],con;
  129.  
  130. more *tim[100],tim_pt;
  131.  
  132.    
  133. int Menu_On,Row_On,Column_On,Atom_On,Map_SX,Text_SY,Show_Row_Line,Tour_On,
  134.     Back_Id,Show_Column_Line,Row_Aim,Column_Aim,Max_num,Copy,Delete,Move,Switch,
  135.     Replace,Load_On,At_Value,Mix;
  136.  
  137. int Action,    /*  Insert_On  Copy_To_On  Delete_On  Move_To_On  Switch_On   */
  138.            /*  Re_Name_On  */
  139.     Old_Motion,
  140.     Motion;    /*  Input_On  List_On  Output_On   Timbre_On */
  141.                /*  Words_On  Tempo_Set_On  Sounds_On  Dance_On  Sing_On      */
  142.                /*  Voice_On  Piano_On  Print_On                      */
  143.  
  144. int Row_Id,Column_Id,Map_Row_Id,Map_Column_Id,Text_Row_Id,Text_Column_Id,
  145.     Table_Width,Table_Height,Head_Len,Table_Row_Num,Table_Column_Num,
  146.     Row_Pointer,Column_Pointer,Map_Dx,Map_Dy,Set_Column,Set_Row,Value_Column,
  147.     Value_Row,Sample_Column,Sample_Row,Fixer_Column,Fixer_Row,P_S,P_E;
  148.  
  149. typedef struct Range {
  150.   int Position,Delta;
  151. } Range;
  152.  
  153. Range Column_Range[36],Row_Range[1000];
  154.  
  155. char *Table_Name,*Old_name[Max_Column],*In_name[Max_Column],
  156.      *Out_name[Max_Column],*Atom_array[Max_Row][Max_Column],*Buffer[Max_Column];
  157.  
  158.  
  159. int V_Ht,Dist,Del,M_i,j,M_Id,M_Bar_Num,n,lf,hf,fn,t,M_p,duration,Timer,Measure,
  160.     code,now,contain,Timbre_num,total,pct,sum,page,way,nx,ny,x,z,marker,head,
  161.     tail,calm,Now_Bank,next,rn,hold,nt,at,step,sn,five,lock,unite,rpter[3],
  162.     delt[3],size,Signal,Host,Host_X,Host_Y,X_bar,Y_bar,W_bar,H_bar,Dx_bar,
  163.     Dy_bar,Piano_X,Piano_Y,In_Menu,On_High,On_Text,Word_Pos,Word_Num,New_Word,
  164.     Word_X,Word_Y,Volumn,Set_X,Set_Y,Set_W,Set_H,Set_Id,Value_X,Value_Y,Value_W,
  165.     Value_H,Value_H_X,Value_H_Y,Value_H_W,Value_H_H, /* For highlight */
  166.     Interval;
  167.  
  168.  
  169. int mix[40],uniset[100][11],content[36],d_t[3],Times[3],add[3],pt[3],front[3],
  170.     Words_Array[1000]; /* Id of the melodies have words  */
  171.  
  172. double freq,d,rlact,speed,br[10];
  173.  
  174. two place;
  175.  
  176. char ch;
  177. char *names[35000],*Sample_names[1000],*sample_name,filname[100],*S_bf,top[180],
  178.      Word_Top[5004],buf[2048],ch1[2],ch2[2],wd[17],*Race,*Words[1000];
  179.  
  180. FILE *melodyfile,*timfile,*unifile,*filvar,*confile,*wordfile,*midifile,
  181.      *Textfile;
  182.  
  183. ary16 sy;
  184.  
  185. struct stater *firststate,*atstate,*laststate,*newstate;
  186. midstate *mid;
  187.  
  188. /* XImage *pt0,*pt1,*pt2; */ 
  189. /* XImage *pic[2][33],*ptdcr;  */
  190.  
  191.  
  192. int Print_pt,Debug;   /* 10 --- Curve details   20 --- seter / tmp values  */
  193.                          /* 100 --- Analyze Table  */
  194.  
  195.  
  196. /*     Finish :  Note = 200    */
  197.