4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
29 #include "indexable.inc"
30 #include "indexfile.inc"
31 #include "indexstate.inc"
32 #include "indexthread.inc"
33 #include "mainprogress.inc"
34 #include "mwindow.inc"
35 #include "preferences.inc"
36 #include "renderengine.inc"
37 #include "resourcepixmap.inc"
38 #include "samples.inc"
39 #include "trackcanvas.inc"
40 #include "bctimer.inc"
48 IndexFile(MWindow *mwindow);
49 IndexFile(MWindow *mwindow, Indexable *indexable);
54 // Get the index state object from the asset or the nested EDL
55 IndexState* get_state();
56 static const char* get_source_path(Indexable *indexable);
59 int create_index(MainProgressBar *progress);
60 int interrupt_index();
61 static void delete_index(Preferences *preferences,
62 Indexable *indexable, const char *suffix=0);
63 static void delete_index_files(Preferences *preferences,
64 Indexable *indexable);
65 static int get_index_filename(char *source_filename,
66 char *index_directory,
68 const char *input_filename,
69 const char *suffix=0);
70 void update_edl_asset();
71 int redraw_edits(int force);
72 int draw_index(TrackCanvas *canvas,
73 ResourcePixmap *pixmap,
79 int read_info(Indexable *indexable = 0);
83 char index_filename[BCTEXTLEN], source_filename[BCTEXTLEN];
84 // Object to create an index for
88 void update_mainasset();
93 int64_t get_required_scale();
94 // File descriptor for index file.
96 // File object for source if an asset
98 // Render engine for source if the source is a nested EDL
99 RenderEngine *render_engine;
100 // Audio cache for render engine
102 // Number of samples in source. Calculated in open_source.
103 int64_t source_length;
104 // Number of channels in source. Calculated in open_source.
106 int source_samplerate;
107 int64_t file_length; // Length of index file in bytes
108 int interrupt_flag; // Flag set when index building is interrupted