r136: This commit was manufactured by cvs2svn to create tag 'hv_1_1_8'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / filesndfile.h
blob9751187a763e9104b813ae61a26ee24c07ee6933
1 #ifndef FILESNDFILE_H
2 #define FILESNDFILE_H
4 #include "bitspopup.inc"
5 #include "filebase.h"
6 #include "filesndfile.h"
7 #include "sndfile.h"
9 #include <stdio.h>
11 // The following libsndfile files have to be modified to support VFS.
12 // They need to use FILE * instead of file descriptors.
13 // open doesn't seem to be overridable.
14 // file_io.c
15 // sndfile.c
16 // sndfile.h
18 class FileSndFile : public FileBase
20 public:
21 FileSndFile(Asset *asset, File *file);
22 ~FileSndFile();
24 static int check_sig(Asset *asset);
25 int open_file(int rd, int wr);
26 int close_file();
27 int set_audio_position(int64_t sample);
28 int read_samples(double *buffer, int64_t len);
29 int write_samples(double **buffer, int64_t len);
30 void format_to_asset();
31 void asset_to_format();
33 static void get_parameters(BC_WindowBase *parent_window,
34 Asset *asset,
35 BC_WindowBase* &format_window,
36 int audio_options,
37 int video_options);
39 // File must be opened here to get the VFS override. libsndfile-1.0.5 uses
40 // open instead of fopen.
41 FILE *fileptr;
42 SNDFILE *fd;
43 SF_INFO fd_config;
44 // Temp for interleaved channels
45 double *temp_double;
46 int64_t temp_allocated;
49 class SndFileConfig;
51 class SndFileHILO : public BC_Radial
53 public:
54 SndFileHILO(SndFileConfig *gui, int x, int y);
55 int handle_event();
56 SndFileConfig *gui;
59 class SndFileLOHI : public BC_Radial
61 public:
62 SndFileLOHI(SndFileConfig *gui, int x, int y);
63 int handle_event();
64 SndFileConfig *gui;
68 class SndFileConfig : public BC_Window
70 public:
71 SndFileConfig(BC_WindowBase *parent_window, Asset *asset);
72 ~SndFileConfig();
74 int create_objects();
75 int close_event();
77 BC_WindowBase *parent_window;
78 BitsPopup *bits_popup;
79 SndFileHILO *hilo;
80 SndFileLOHI *lohi;
81 Asset *asset;
84 #endif