update ffmpeg to 4.1, add sketcher plugin, crikey tweaks, titler colorpicker, keyfram...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / recordaudio.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 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 #ifndef RECORDAUDIO_H
23 #define RECORDAUDIO_H
24
25 #include "audiodevice.inc"
26 #include "condition.inc"
27 #include "guicast.h"
28 #include "file.inc"
29 #include "mutex.inc"
30 #include "mwindow.inc"
31 #include "record.inc"
32 #include "recordgui.inc"
33 #include "samples.inc"
34 #include "thread.h"
35
36 class RecordAudio : public Thread
37 {
38 public:
39         RecordAudio(MWindow *mwindow, Record *record);
40         ~RecordAudio();
41
42         void run();
43         void arm_recording();
44         void start_recording();
45         int stop_recording();
46         void pause_recording();
47         void resume_recording();
48         void reset_parameters();
49         void delete_buffer();
50         void config_update();
51         Samples **get_buffer();
52         int flush_buffer();
53         int write_buffer(int samples);
54         void wait_startup();
55         void set_write_buffer_samples(int samples);
56         void set_monitoring(int mode);
57
58 private:
59         MWindow *mwindow;
60         Record *record;
61         int done, recording_paused;
62         int grab_result, write_result;
63         int64_t current_sample;
64         int buffer_channels, buffer_samples, write_buffer_samples;
65         int channels, writing_file, fragment_samples;
66         int64_t fragment_position;
67         Samples **input, **buffer;
68         RecordGUI *gui;
69         Condition *trigger_lock;
70         Condition *pause_record_lock;
71         Condition *record_paused_lock;
72 };
73
74 #endif