r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / indexthread.h
blob8c745d18364e298a96945a96eb0465261c8153ee
1 #ifndef INDEXTHREAD_H
2 #define INDEXTHREAD_H
4 #include "assets.inc"
5 #include "indexfile.inc"
6 #include "mwindow.inc"
7 #include "mutex.h"
8 #include "thread.h"
10 #define TOTAL_BUFFERS 2
12 // Recieves buffers from Indexfile and calculates the index.
14 class IndexThread : public Thread
16 public:
17 IndexThread(MWindow *mwindow,
18 IndexFile *index_file,
19 Asset *asset,
20 char *index_filename,
21 int64_t buffer_size,
22 int64_t length_source);
23 ~IndexThread();
25 friend class IndexFile;
27 int start_build();
28 int stop_build();
29 void run();
31 IndexFile *index_file;
32 MWindow *mwindow;
33 Asset *asset;
34 char *index_filename;
35 int64_t buffer_size, length_source;
36 int current_buffer;
38 private:
39 int interrupt_flag;
40 double **buffer_in[TOTAL_BUFFERS];
41 Mutex input_lock[TOTAL_BUFFERS], output_lock[TOTAL_BUFFERS];
42 int last_buffer[TOTAL_BUFFERS];
43 int64_t input_len[TOTAL_BUFFERS];
48 #endif