Changeset 663

Show
Ignore:
Timestamp:
11/15/09 08:38:12 (2 years ago)
Author:
conrad
Message:

add save/load of tempo

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • beatfish/trunk/src/beatfish.c

    r662 r663  
    283283} 
    284284 
     285static Evas_Object * tempo_slider; 
    285286static Evas_Object * tempo_label; 
    286287 
     
    353354  evas_object_show(ob); 
    354355   
    355   bg = ob; 
     356  tempo_slider = bg = ob; 
    356357 
    357358  ob = evas_object_rectangle_add (evas); 
     
    10051006  xdrstdio_create (&xdrs, fp, XDR_ENCODE); 
    10061007 
     1008  { 
     1009  double tempo; 
     1010 
     1011  tempo = remix_get_tempo (remix); 
     1012 
     1013  printf ("Saving tempo %g\n", tempo); 
     1014  xdr_double (&xdrs, &tempo); 
     1015  } 
     1016 
    10071017  printf ("Saving delay1_x %f, delay2_x %f\n", delay1_x, delay2_x); 
    10081018  xdr_float (&xdrs, &delay1_x); 
     
    10211031 
    10221032  fp = fopen (SAVE_FILE_PATH, "rb"); 
     1033  if (fp == NULL) return; 
     1034 
    10231035  xdrstdio_create (&xdrs, fp, XDR_DECODE); 
     1036 
     1037  { 
     1038  double tempo; 
     1039  float canvas_x; 
     1040 
     1041  xdr_double (&xdrs, &tempo); 
     1042  printf ("Loaded tempo %g\n", tempo); 
     1043 
     1044  canvas_x = ((tempo - 60)/180) * (WIDTH/2); 
     1045  tempo_set_x (tempo_slider, canvas_x); 
     1046  remix_set_tempo (remix, tempo); 
     1047  } 
    10241048 
    10251049  xdr_float (&xdrs, &delay1_x);