initial commit
[goodguy/history.git] / cinelerra-5.0 / db / utils / clip_weights.C
1 #include<stdio.h>
2 #include<stdarg.h>
3 #include<time.h>
4
5 #include "tdb.h"
6 #include "s.C"
7
8 int main(int ac, char **av)
9 {
10   int ret;  setbuf(stdout,0);
11   theDb db;
12   db.open(av[1]);
13   //db.access(av[1], 34543, 0);
14   if( !db.opened() || db.error() ) exit(1);
15
16   if( !(ret=db.clip_set.FirstId()) ) do {
17     char fn[1024];  sprintf(fn,"%s/w%05d.txt",av[2],db.clip_set.id());
18     FILE *fp = fopen(fn,"w");
19     double *weights = (double *)db.clip_set._Weights();
20     int frames = db.clip_set.Frames();
21     for( int i=0; i<frames; ++i )
22       fprintf(fp,"%f\n",weights[i]);
23     fclose(fp);
24   } while( !(ret=db.clip_set.NextId()) );
25
26   db.close();
27   return 0;
28 }
29