-florian66-

sing sing sing

May 7th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.34 KB | None | 0 0
  1.  
  2. int AddIn_main(int isAppli, unsigned short OptionNum)
  3. {
  4.        // double length=1.0; // a 60 batt/minute
  5.         //double freq=440;
  6.         int i=0;
  7.         unsigned short taille_file;
  8.         unsigned int key;
  9.         char x;
  10.         char buffer[50];
  11.         short* ID_note; // On crée un pointeur sur int
  12.    
  13.     char **files = memory_alloc(20);
  14.  
  15. char ch[25];
  16. x = memory_find("\\\\fls0\\*cff*",files,20);
  17. x = memory_user_select(files,x,1,0);
  18. sprintf(ch,"\\\\fls0\\%s",files[x]);
  19. //sprintf(ch,"\\\\crd0\\%s",files[memory_user_select(files,memory_find("\\\\crd0\\*sav*",files,20),1,0)]);
  20. ID_note = memory_load(ch);
  21.  
  22.  
  23. if(ID_note==NULL) ID_note=malloc(100*sizeof(short));
  24.  
  25. /* while(*(data+taille_file)) taille_file++;
  26.  
  27. for(i=0;i<taille_file;i++)
  28.     *(ID_note+i)=*(data+i); */
  29.        
  30.  
  31. edit_part(ID_note);
  32.  
  33. while(1)
  34. {
  35.     draw_part(ID_note, 0);
  36.  
  37.     Mini("edit", 0);
  38.     //Mini("save", 1);
  39.     Mini("clear", 2);
  40.     Mini("play", 5);
  41.    
  42.  
  43.    
  44.     GetKey(&key);
  45.     switch(key)
  46.     {
  47.     case KEY_CTRL_EXIT : free(ID_note); memory_free(files,20); return 1;
  48.     case KEY_CTRL_F1 : edit_part(ID_note); break;
  49.     case KEY_CTRL_F2 : memory_save(ch,ID_note,i); Sleep(100); break;
  50.     case KEY_CTRL_F3 : {
  51.                         for(i=0;*(ID_note+i);i++)
  52.                             {
  53.                             *(ID_note+i)=0;
  54.                             }
  55.                         edit_part(ID_note);
  56.                         break;
  57.                         }
  58.     case KEY_CTRL_F6 :jouer_partition(ID_note); break;
  59.     }
  60.  
  61. }
  62. return 1;      
  63. }
Advertisement
Add Comment
Please, Sign In to add comment