10 #include "defaults.inc"
12 #include "filexml.inc"
15 #include "pluginserver.inc"
16 #include "sharedlocation.h"
18 class Assets
: public List
<Asset
>
24 int load(ArrayList
<PluginServer
*> *plugindb
,
27 int save(ArrayList
<PluginServer
*> *plugindb
,
30 Assets
& operator=(Assets
&assets
);
32 // Enter a new asset into the table.
33 // If the asset already exists return the asset which exists.
34 // If the asset doesn't exist, store a copy of the argument and return the copy.
35 Asset
* update(Asset
*asset
);
36 // Update the index information for assets with the same path
37 void update_index(Asset
*asset
);
54 // return the asset containing this path or create a new asset containing this path
55 Asset
* update(const char *path
);
57 // Insert the asset into the list if it doesn't exist already but
58 // don't create a new asset.
59 void update_ptr(Asset
*asset
);
61 // return the asset containing this path or 0 if not found
62 Asset
* get_asset(const char *filename
);
63 // remove asset from table
64 Asset
* remove_asset(Asset
*asset
);
66 // return number of the asset
67 int number_of(Asset
*asset
);
68 Asset
* asset_number(int number
);
70 int update_old_filename(char *old_filename
, char *new_filename
);
75 // Asset can be one of the following:
76 // 1) a pure media file
79 // The EDL can reference itself if it contains a media file
80 class Asset
: public ListItem
<Asset
>
85 Asset(const char *path
);
86 Asset(const int plugin_type
, const char *plugin_path
);
92 void copy_from(Asset
*asset
, int do_index
);
93 void copy_location(Asset
*asset
);
94 void copy_format(Asset
*asset
, int do_index
= 1);
95 void copy_index(Asset
*asset
);
96 int64_t get_index_offset(int channel
);
99 // Load and save just compression parameters for a render dialog
100 void load_defaults(Defaults
*defaults
, char *prefix
= 0, int do_codecs
= 0);
101 void save_defaults(Defaults
*defaults
, char *prefix
= 0);
102 char* construct_param(char *param
, char *prefix
, char *return_value
);
107 // Executed during index building only
108 void update_index(Asset
*asset
);
109 int equivalent(Asset
&asset
,
112 Asset
& operator=(Asset
&asset
);
113 int operator==(Asset
&asset
);
114 int operator!=(Asset
&asset
);
115 int test_path(const char *path
);
116 int test_plugin_title(const char *path
);
117 int read(ArrayList
<PluginServer
*> *plugindb
, FileXML
*xml
);
118 int read_audio(FileXML
*xml
);
119 int read_video(FileXML
*xml
);
120 int read_index(FileXML
*xml
);
121 int reset_index(); // When the index file is wrong, reset the asset values
122 int write(ArrayList
<PluginServer
*> *plugindb
,
128 // Necessary for renderfarm to get encoding parameters
129 int write_audio(FileXML
*xml
);
130 int write_video(FileXML
*xml
);
131 int write_index(FileXML
*xml
);
132 int update_path(char *new_path
);
135 char path
[BCTEXTLEN
];
137 // Folder in resource manager
138 char folder
[BCTEXTLEN
];
140 // Determines the file engine to use
141 int format
; // format of file
143 // contains audio data
152 // String or FourCC describing compression
153 char acodec
[BCTEXTLEN
];
156 int64_t audio_length
;
169 // contains video data
174 // String or FourCC describing compression
175 char vcodec
[BCTEXTLEN
];
177 // Length in units of asset
178 int64_t video_length
;
184 // mpeg audio information
187 int ampeg_derivative
;
189 // Vorbis compression
190 int vorbis_min_bitrate
;
192 int vorbis_max_bitrate
;
204 // for jpeg compression
207 // for mpeg video compression
208 int vmpeg_iframe_distance
;
209 int vmpeg_bframe_distance
;
210 int vmpeg_progressive
;
215 int vmpeg_derivative
;
216 int vmpeg_quantization
;
218 int vmpeg_fix_bitrate
;
220 // Divx video compression
223 int divx_rc_reaction_ratio
;
224 int divx_rc_reaction_period
;
225 int divx_max_key_interval
;
226 int divx_max_quantizer
;
227 int divx_min_quantizer
;
230 int divx_fix_bitrate
;
233 // Divx video decompression
234 int divx_use_deblocking
;
236 // PNG video compression
241 int ms_bitrate_tolerance
;
247 // Image file sequences. Background rendering doesn't want to write a
248 // sequence header but instead wants to start the sequence numbering at a certain
249 // number. This ensures deletion of all the frames which aren't being used.
250 // We still want sequence headers sometimes because loading a directory full of images
251 // for editing would create new assets for every image.
256 // Edits store data for the transition
259 int index_status
; // 0 ready 1 not tested 2 being built 3 small source
260 int64_t index_zoom
; // zoom factor of index data
261 int64_t index_start
; // byte start of index data in the index file
262 int64_t index_bytes
; // Total bytes in source file for comparison before rebuilding the index
263 int64_t index_end
, old_index_end
; // values for index build
264 int64_t* index_offsets
; // offsets of channels in index file in floats