Merge CV, ver=5.1; ops/methods from HV, and interface from CV where possible
[goodguy/history.git] / cinelerra-5.1 / cinelerra / indexable.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 // Inherited by objects which can be indexed by IndexFile
24
25 #ifndef INDEXABLE_H
26 #define INDEXABLE_H
27
28 #include "bcwindowbase.inc"
29 #include "garbage.h"
30 #include "indexstate.h"
31 #include <stdint.h>
32
33 class Indexable : public Garbage
34 {
35 public:
36         Indexable(int is_asset);
37         virtual ~Indexable();
38
39         virtual int get_audio_channels();
40         virtual int get_sample_rate();
41         virtual int64_t get_audio_samples();
42         virtual int have_audio();
43
44         virtual int get_w();
45         virtual int get_h();
46         virtual double get_frame_rate();
47         virtual int have_video();
48         virtual int get_video_layers();
49         virtual int64_t get_video_frames();
50
51         void copy_indexable(Indexable *src);
52         void update_path(char *new_path);
53         void update_index(Indexable *src);
54
55         IndexState *index_state;
56
57 // In an Asset, the path to the file.
58
59 // In the top EDL, this is the path it was loaded from.  Restores 
60 // project titles from backups.  This is only used for loading backups & nested EDLs.
61 // All other loads keep the path in mainsession->filename.
62 // This can't use the output_path argument to save_xml because that points
63 // to the backup file, not the project file.
64         char path[BCTEXTLEN];
65 // Folder in resource manager
66         char folder[BCTEXTLEN];
67
68         int is_asset;
69 // unique ID of this object for comparison
70         int id;
71 };
72
73
74
75 #endif
76
77