14 class new_Video_frame : public Video_frameLoc {
16 int copy(Db::ObjectLoc &o);
17 new_Video_frame(Db::Entity &e) : Video_frameLoc(e) {}
22 copy(Db::ObjectLoc &o)
24 old::Video_frameLoc &t = *(old::Video_frameLoc *)&o;
26 Frame_mean( t.Frame_mean() );
27 Frame_mean( t.Frame_mean() );
28 Frame_std_dev( t.Frame_std_dev() );
29 Frame_cx( t.Frame_cx() );
30 Frame_cy( t.Frame_cy() );
31 Frame_moment( t.Frame_moment() );
32 Frame_data(t._Frame_data(), t.size_Frame_data());
36 class new_Timeline : public TimelineLoc {
38 int copy(Db::ObjectLoc &o);
39 new_Timeline(Db::Entity &e) : TimelineLoc(e) {}
44 copy(Db::ObjectLoc &o)
46 old::TimelineLoc &t = *(old::TimelineLoc *)&o;
48 Clip_id( t.Clip_id() );
49 Sequence_no( t.Sequence_no() );
50 Frame_id( t.Frame_id() );
52 Time_offset( t.Time_offset() );
56 class new_Clip_set : public Clip_setLoc {
58 int copy(Db::ObjectLoc &o);
59 new_Clip_set(Db::Entity &e) : Clip_setLoc(e) {}
64 copy(Db::ObjectLoc &o)
66 old::Clip_setLoc &t = *(old::Clip_setLoc *)&o;
68 int title_sz = t.size_Title();
69 char title[1024]; memcpy(title, t._Title(), title_sz);
70 if( !title_sz || title[title_sz-1] != 0 ) title[title_sz++] = 0;
71 Title( title, title_sz );
72 int apath_sz = t.size_Asset_path();
73 char apath[1024]; memcpy(apath, t._Asset_path(), apath_sz);
74 if( !apath_sz || apath[apath_sz-1] != 0 ) apath[apath_sz++] = 0;
75 Asset_path( apath, apath_sz );
76 Position( t.Position() );
78 Clip_setLoc aloc(entity);
79 if( Clip_setLoc::ikey_Clip_path_pos(aloc, apath, Position(), tid).Find() ) {
80 Clip_setLoc::rkey_Clip_path_pos rkey(*this);
81 if( entity->index("Clip_path_pos")->Insert(rkey,&tid) ) {
82 printf("err inserting Clip_path_pos for id %d\n", tid);
85 Framerate( t.Framerate() );
86 Average_weight( t.Average_weight() );
88 Prefix_size( t.Prefix_size() );
89 Suffix_size( t.Suffix_size() );
90 Weights(t._Weights(), t.size_Weights());
91 System_time( t.System_time() );
92 Creation_time( t.Creation_time() );
96 class new_Clip_views : public Clip_viewsLoc {
98 int copy(Db::ObjectLoc &o);
99 new_Clip_views(Db::Entity &e) : Clip_viewsLoc(e) {}
104 copy(Db::ObjectLoc &o)
106 old::Clip_viewsLoc &t = *(old::Clip_viewsLoc *)&o;
108 Access_clip_id( t.Access_clip_id() );
109 Access_time( t.Access_time() );
110 Access_count( t.Access_count() );
116 int main(int ac, char **av)
119 if( ac < 3 ) { printf("usage: %s in.db out.db\n",av[0]); exit(1); }
121 const char *ifn = av[1];
122 if( idb.open(ifn) || !idb.opened() || idb.error() ) {
123 fprintf(stderr,"unable to open idb \"%s\"\n",ifn); exit(1);
126 const char *ofn = av[2];
128 if( odb.create(ofn) ) {
129 fprintf(stderr,"unable to create odb \"%s\"\n",ofn); exit(1);
131 if( odb.open(ofn) || !odb.opened() || odb.error() ) {
132 fprintf(stderr,"unable to open odb \"%s\"\n",ofn); exit(1);
135 new_Video_frame new_video_frame(odb.Video_frame);
136 new_Timeline new_timeline(odb.Timeline);
137 new_Clip_set new_clip_set(odb.Clip_set);
138 new_Clip_views new_clip_views(odb.Clip_views);
140 Db::Objects new_objects = 0;
141 new_objects = new Db::ObjectList(new_objects, new_video_frame);
142 new_objects = new Db::ObjectList(new_objects, new_timeline);
143 new_objects = new Db::ObjectList(new_objects, new_clip_set);
144 new_objects = new Db::ObjectList(new_objects, new_clip_views);
146 odb.copy(&idb, new_objects);