no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / filevorbis.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 FILEVORBIS_H
23 #define FILEVORBIS_H
24 #ifdef HAVE_OGG
25
26 #include "edl.inc"
27 #include "file.inc"
28 #include "filebase.h"
29 #include "vorbis/vorbisenc.h"
30 #include "vorbis/vorbisfile.h"
31
32
33
34
35
36
37 class FileVorbis : public FileBase
38 {
39 public:
40         FileVorbis(Asset *asset, File *file);
41         ~FileVorbis();
42
43         static void get_parameters(BC_WindowBase *parent_window,
44                 Asset *asset, BC_WindowBase* &format_window,
45                 int audio_options, int video_options, EDL *edl);
46         int reset_parameters_derived();
47
48         static int check_sig(Asset *asset);
49         int open_file(int rd, int wr);
50         int close_file_derived();
51         int write_samples(double **buffer,
52                         int64_t len);
53
54         int read_samples(double *buffer, int64_t len);
55
56 // Decoding
57         OggVorbis_File vf;
58         FILE *fd;
59
60 // Encoding
61         vorbis_info vi;
62         vorbis_comment vc;
63         vorbis_dsp_state vd;
64         vorbis_block vb;
65         ogg_stream_state os;
66         ogg_page og;
67         ogg_packet op;
68 };
69
70
71 class VorbisConfigAudio;
72
73
74 class VorbisFixedBitrate : public BC_Radial
75 {
76 public:
77         VorbisFixedBitrate(int x, int y, VorbisConfigAudio *gui);
78         int handle_event();
79         VorbisConfigAudio *gui;
80 };
81
82 class VorbisVariableBitrate : public BC_Radial
83 {
84 public:
85         VorbisVariableBitrate(int x, int y, VorbisConfigAudio *gui);
86         int handle_event();
87         VorbisConfigAudio *gui;
88 };
89
90 class VorbisMinBitrate : public BC_TextBox
91 {
92 public:
93         VorbisMinBitrate(int x,
94                 int y,
95                 VorbisConfigAudio *gui,
96                 char *text);
97         int handle_event();
98         VorbisConfigAudio *gui;
99 };
100
101 class VorbisMaxBitrate : public BC_TextBox
102 {
103 public:
104         VorbisMaxBitrate(int x,
105                 int y,
106                 VorbisConfigAudio *gui,
107                 char *text);
108         int handle_event();
109         VorbisConfigAudio *gui;
110 };
111
112 class VorbisAvgBitrate : public BC_TextBox
113 {
114 public:
115         VorbisAvgBitrate(int x,
116                 int y,
117                 VorbisConfigAudio *gui,
118                 char *text);
119         int handle_event();
120         VorbisConfigAudio *gui;
121 };
122
123 class VorbisConfigAudio : public BC_Window
124 {
125 public:
126         VorbisConfigAudio(BC_WindowBase *parent_window, Asset *asset);
127         ~VorbisConfigAudio();
128
129         void create_objects();
130         int close_event();
131
132         VorbisFixedBitrate *fixed_bitrate;
133         VorbisVariableBitrate *variable_bitrate;
134         BC_WindowBase *parent_window;
135         char string[BCTEXTLEN];
136         Asset *asset;
137 };
138
139 #endif
140 #endif