fix awdw solo vicon crash, fix nested clip for binfolders, open edit edl
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / audiopulse.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2008-2019 Adam Williams <broadcast at earthling dot net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  * 
19  */
20
21 #ifndef AUDIOPULSE_H
22 #define AUDIOPULSE_H
23
24 #include "arraylist.h"
25 #include "audiodevice.h"
26 #include "bctimer.inc"
27
28
29 class AudioPulse : public AudioLowLevel
30 {
31 public:
32         AudioPulse(AudioDevice *device);
33         ~AudioPulse();
34     
35         int open_input();
36         int init_input();
37         int open_output();
38         int init_output();
39         int close_all();
40         int64_t device_position();
41         int write_buffer(char *buffer, int size);
42         int read_buffer(char *buffer, int size);
43         int output_wait();
44         int flush_device();
45         int interrupt_playback();
46
47 // the pulse audio handles
48         void *dsp_out;
49         void *dsp_in;
50         void *wr_spec;
51         void *rd_spec;
52
53         int64_t buffer_position;
54         int64_t timer_position;
55         int64_t frag_usecs, period_usecs;
56         Timer *timer;
57         Mutex *timer_lock;
58
59         int64_t samples_output() { return buffer_position; }
60 };
61
62 #endif