rework keyframe hide popup, keyframe auto render, textbox set_selection wide text
[goodguy/history.git] / cinelerra-5.1 / cinelerra / filesndfile.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 FILESNDFILE_H
23 #define FILESNDFILE_H
24
25 #include <stdio.h>
26 #include <stdint.h>
27
28 #include "bitspopup.inc"
29 #include "filebase.h"
30 #include "filesndfile.h"
31 #include "sndfile.h"
32
33 // The following libsndfile files have to be modified to support VFS.
34 // They need to use FILE * instead of file descriptors.
35 // open doesn't seem to be overridable.
36 // file_io.c
37 // sndfile.c
38 // sndfile.h
39
40 class FileSndFile : public FileBase
41 {
42 public:
43         FileSndFile(Asset *asset, File *file);
44         ~FileSndFile();
45
46         static int check_sig(Asset *asset);
47         int open_file(int rd, int wr);
48         int close_file();
49         int set_audio_position(int64_t sample);
50         int read_samples(double *buffer, int64_t len);
51         int write_samples(double **buffer, int64_t len);
52         void format_to_asset();
53         void asset_to_format();
54
55         static void get_parameters(BC_WindowBase *parent_window, 
56                 Asset *asset, 
57                 BC_WindowBase* &format_window,
58                 int audio_options,
59                 int video_options);
60
61         SNDFILE *fd;
62         SF_INFO fd_config;
63 // Temp for interleaved channels
64         double *temp_double;
65         int64_t temp_allocated;
66 };
67
68 class SndFileConfig;
69
70 class SndFileHILO : public BC_Radial
71 {
72 public:
73         SndFileHILO(SndFileConfig *gui, int x, int y);
74         int handle_event();
75         SndFileConfig *gui;
76 };
77
78 class SndFileLOHI : public BC_Radial
79 {
80 public:
81         SndFileLOHI(SndFileConfig *gui, int x, int y);
82         int handle_event();
83         SndFileConfig *gui;
84 };
85
86
87 class SndFileConfig : public BC_Window
88 {
89 public:
90         SndFileConfig(BC_WindowBase *parent_window, Asset *asset);
91         ~SndFileConfig();
92
93         void create_objects();
94         int close_event();
95
96         BC_WindowBase *parent_window;
97         BitsPopup *bits_popup;
98         SndFileHILO *hilo;
99         SndFileLOHI *lohi;
100         Asset *asset;
101 };
102
103 #endif