Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / recordaudio.h
blob565b6c51d3fe53934c48b5a8744c467f75de8fb3
1 #ifndef RECORDAUDIO_H
2 #define RECORDAUDIO_H
4 #include "audiodevice.inc"
5 #include "condition.inc"
6 #include "guicast.h"
7 #include "file.inc"
8 #include "mutex.inc"
9 #include "mwindow.inc"
10 #include "record.inc"
11 #include "recordgui.inc"
12 #include "recordthread.inc"
13 #include "thread.h"
16 class RecordAudio : public Thread
18 public:
19 RecordAudio(MWindow *mwindow,
20 Record *record,
21 RecordThread *record_thread);
22 ~RecordAudio();
24 void run();
25 // start saving audio data to file
26 int arm_recording();
27 void start_recording();
28 // Called by record thread if audio is the only thing.
29 // Called by video recording if video and audio are being recorded.
30 int stop_recording();
31 void rewind_file();
32 void finish_loop();
33 void finish_timed();
34 void reset_parameters();
36 // seek to a new location in the file
37 int set_position(int64_t position);
38 int64_t sync_position();
40 void write_buffer(int skip_new = 0); // write the buffer
41 // Want one thread to dictate the other during shared device recording.
42 // Done with batch
43 int batch_done;
46 private:
47 MWindow *mwindow;
48 Record *record;
49 RecordThread *record_thread;
50 double *max;
51 int *over;
52 double **input;
53 RecordGUI *gui;
54 int buffer_size, fragment_size;
55 int64_t fragment_position;
56 int record_channels;
57 Mutex *timer_lock;
58 Condition *trigger_lock;
59 Timer timer;
60 int write_result, grab_result;
65 #endif
67 // Local Variables:
68 // mode: C++
69 // c-file-style: "linux"
70 // End: