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