1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2016 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
22 /** \file
23  * \ingroup bke
24  */
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct CacheFile;
31 struct CacheReader;
32 struct Depsgraph;
33 struct Main;
34 struct Object;
35 
36 void BKE_cachefiles_init(void);
37 void BKE_cachefiles_exit(void);
38 
39 void *BKE_cachefile_add(struct Main *bmain, const char *name);
40 
41 void BKE_cachefile_reload(struct Depsgraph *depsgraph, struct CacheFile *cache_file);
42 
43 void BKE_cachefile_eval(struct Main *bmain,
44                         struct Depsgraph *depsgraph,
45                         struct CacheFile *cache_file);
46 
47 bool BKE_cachefile_filepath_get(const struct Main *bmain,
48                                 const struct Depsgraph *depsgrah,
49                                 const struct CacheFile *cache_file,
50                                 char r_filename[1024]);
51 
52 float BKE_cachefile_time_offset(const struct CacheFile *cache_file,
53                                 const float time,
54                                 const float fps);
55 
56 /* Modifiers and constraints open and free readers through these. */
57 void BKE_cachefile_reader_open(struct CacheFile *cache_file,
58                                struct CacheReader **reader,
59                                struct Object *object,
60                                const char *object_path);
61 void BKE_cachefile_reader_free(struct CacheFile *cache_file, struct CacheReader **reader);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66