r3824: Auto commit for Debian build
[wdq2wav.git] / wdq2wav.h
1 #include <stdio.h>
2 #include <string>
3 #include <sys/types.h>
4 #include <sys/stat.h>
5 #include <fcntl.h>
6 #include <unistd.h>
7 #include <sstream>
8
9
10 class WindaqFile
11 {
12 public:
13   WindaqFile (const char* fname);
14   ~WindaqFile ();
15   bool ReadHeader();
16
17   std::string m_strFile;
18   bool m_valid;
19   int m_fd;
20   unsigned int m_nChannels;
21   unsigned int m_nSamples;
22   double m_sample_rate;
23   unsigned int m_sr_denom, m_sr_numer;
24   unsigned int m_nHeader_bytes, m_channel_offset, m_nBytes_channel_header;
25   unsigned int m_nData_bytes;
26 };
27
28 class WindaqChannel 
29 {
30 public:
31   bool m_valid;
32   unsigned int m_channel;
33   std::string m_units;
34   double m_slope;
35   double m_intercept;
36   signed short int *m_data;
37   WindaqFile& r_wdq;
38   signed short int m_min_raw_data;
39   signed short int m_max_raw_data;
40   double m_max_scaled_data;
41   double m_min_scaled_data;
42
43   WindaqChannel (WindaqFile& wdq, const int channel);
44   ~WindaqChannel ();
45
46  private:
47   bool read_channel_data();
48 };
49
50
51 class WavFile 
52 {
53  public:
54   std::string m_strFile;
55   int m_fd;
56   bool m_valid;
57   unsigned long int m_nSamples;
58   double m_rate;
59   unsigned int m_nChannels;
60   unsigned int m_nBitsPerSample;
61   unsigned int m_nBytesPerSample;
62   signed short int* m_data;
63
64   WavFile (WindaqChannel& wdq_channel, const char* fname);
65   ~WavFile ();
66
67   bool WriteFile ();
68 };