initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / indexstate.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2009 Adam Williams <broadcast at earthling dot net>
5  * 
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  * 
20  */
21
22
23 #ifndef INDEXSTATE_H
24 #define INDEXSTATE_H
25
26 #include "asset.inc"
27 #include "filexml.inc"
28
29 #include <stdint.h>
30
31 // Assets & nested EDLs store this information to have their indexes built
32 class IndexState
33 {
34 public:
35         IndexState();
36         ~IndexState();
37
38         void reset();
39         void copy_from(IndexState *src);
40 // Supply asset to include encoding information in index file.
41         void write_xml(FileXML *file);
42         void read_xml(FileXML *file, int channels);
43         int write_index(const char *path, 
44                 int data_bytes, 
45                 Asset *asset,
46                 int64_t length_source);
47         int64_t get_index_offset(int channel);
48         int64_t get_index_size(int channel);
49         void dump();
50
51 // index info
52         int index_status;     // Macro from assets.inc
53         int64_t index_zoom;      // zoom factor of index data
54         int64_t index_start;     // byte start of index data in the index file
55 // Total bytes in the source file when the index was buillt
56         int64_t index_bytes;
57         int64_t index_end, old_index_end;    // values for index build
58 // offsets of channels in index buffer in floats
59         int64_t *index_offsets;
60 // Sizes of channels in index buffer in floats.  This allows
61 // variable channel size.
62         int64_t *index_sizes;
63 // [ index channel      ][ index channel      ]
64 // [high][low][high][low][high][low][high][low]
65         float *index_buffer;  
66 // Number of channels our buffers were allocated for
67         int channels;
68 };
69
70
71
72
73 #endif
74