r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / recordaudio.h
blobcfedc3bb1d3d6ec3ec0c30c79802ed1a3679c50b
1 #ifndef RECORDAUDIO_H
2 #define RECORDAUDIO_H
4 #include "audiodevice.inc"
5 #include "guicast.h"
6 #include "file.inc"
7 #include "mutex.h"
8 #include "mwindow.inc"
9 #include "record.inc"
10 #include "recordgui.inc"
11 #include "recordthread.inc"
12 #include "thread.h"
15 class RecordAudio : public Thread
17 public:
18 RecordAudio(MWindow *mwindow,
19 Record *record,
20 RecordThread *record_thread);
21 ~RecordAudio();
23 void run();
24 // start saving audio data to file
25 int arm_recording();
26 void start_recording();
27 // Called by record thread if audio is the only thing.
28 // Called by video recording if video and audio are being recorded.
29 int stop_recording();
30 void rewind_file();
31 void finish_loop();
32 void finish_timed();
33 void reset_parameters();
35 // seek to a new location in the file
36 int set_position(int64_t position);
37 int64_t sync_position();
39 void write_buffer(int skip_new = 0); // write the buffer
40 // Want one thread to dictate the other during shared device recording.
41 // Done with batch
42 int batch_done;
45 private:
46 MWindow *mwindow;
47 Record *record;
48 RecordThread *record_thread;
49 double *max;
50 int *over;
51 double **input;
52 RecordGUI *gui;
53 int64_t buffer_size, fragment_size, fragment_position;
54 int record_channels;
55 Mutex timer_lock;
56 Mutex trigger_lock;
57 Timer timer;
58 int write_result, grab_result;
63 #endif