Bump patch version post tag.
[asdcplib.git] / src / Wav.h
index bd890ce5022eb692c6724e264e008c38a2cad6d6..7e274d8787561f16d588b65f9801e6c0e744d4f7 100755 (executable)
--- a/src/Wav.h
+++ b/src/Wav.h
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2005, John Hurst
+Copyright (c) 2005-2009, John Hurst
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -89,6 +89,9 @@ namespace ASDCP
       const fourcc FCC_fmt_("fmt ");
       const fourcc FCC_data("data");
 
+      const ui16_t ASDCP_WAVE_FORMAT_PCM = 1;
+      const ui16_t ASDCP_WAVE_FORMAT_EXTENSIBLE = 65534;
+
       //
       class SimpleWaveHeader
        {
@@ -115,6 +118,46 @@ namespace ASDCP
        };
 
     } // namespace Wav
+
+  namespace RF64
+    {
+      const fourcc FCC_RF64("RF64");
+      const fourcc FCC_ds64("ds64");
+
+
+      static const ui32_t MAX_RIFF_LEN = 0xFFFFFFFF;
+      static const ui32_t DS64_HEADER_LEN = 28;
+      static const ui32_t SIMPLE_RF64_HEADER_LEN = 82;
+      //
+      class SimpleRF64Header
+       {
+       public:
+         ui16_t        format;
+         ui16_t        nchannels;
+         ui32_t        samplespersec;
+         ui32_t        avgbps;
+         ui16_t        blockalign;
+         ui16_t        bitspersample;
+         ui16_t        cbsize;
+         ui64_t        data_len;
+
+         SimpleRF64Header() :
+           format(0), nchannels(0), samplespersec(0), avgbps(0),
+           blockalign(0), bitspersample(0), cbsize(0), data_len(0) {}
+
+         SimpleRF64Header(ASDCP::PCM::AudioDescriptor& ADesc);
+
+         Result_t  ReadFromBuffer(const byte_t* buf, ui32_t buf_len, ui32_t* data_start);
+         Result_t  ReadFromFile(const Kumu::FileReader& InFile, ui32_t* data_start);
+         Result_t  WriteToFile(Kumu::FileWriter& OutFile) const;
+         void      FillADesc(ASDCP::PCM::AudioDescriptor& ADesc, Rational PictureRate) const;
+
+    private:
+      static const ui64_t SAMPLE_COUNT = 0;
+      static const ui32_t TABLE_LEN = 0;
+       };
+
+    } // namespace RF64
 } // namespace ASDCP
 
 #endif // _WAV_H_