SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
sndpp::WAV Class Reference

#include <WAV.h>

Collaboration diagram for sndpp::WAV:

Classes

struct  ChunkADTL
 
struct  ChunkBase
 
struct  ChunkCSET
 
struct  ChunkCUE
 
struct  ChunkDATA
 
struct  ChunkFACT
 
struct  ChunkFLLR
 
struct  ChunkFMT
 
struct  ChunkINFO
 
struct  ChunkINST
 
struct  ChunkJUNK
 
struct  ChunkLIST
 
struct  ChunkMD5
 
struct  ChunkPAD
 
struct  ChunkPLST
 
struct  ChunkSMPL
 
struct  ChunkUnknown
 

Public Types

enum class  ChunkType : uint32_t {
  FMT = sourcepp::parser::binary::makeFourCC("fmt ") , DATA = sourcepp::parser::binary::makeFourCC("data") , CUE = sourcepp::parser::binary::makeFourCC("cue ") , PLST = sourcepp::parser::binary::makeFourCC("plst") ,
  FACT = sourcepp::parser::binary::makeFourCC("fact") , SMPL = sourcepp::parser::binary::makeFourCC("smpl") , INST = sourcepp::parser::binary::makeFourCC("inst") , CSET = sourcepp::parser::binary::makeFourCC("CSET") ,
  MD5 = sourcepp::parser::binary::makeFourCC("MD5 ") , JUNK = sourcepp::parser::binary::makeFourCC("JUNK") , PAD = sourcepp::parser::binary::makeFourCC("PAD ") , FLLR = sourcepp::parser::binary::makeFourCC("FLLR") ,
  LIST = sourcepp::parser::binary::makeFourCC("LIST")
}
 
enum class  ChunkListType : uint32_t { WAVL = sourcepp::parser::binary::makeFourCC("WAVL") , INFO = sourcepp::parser::binary::makeFourCC("INFO") , ADTL = sourcepp::parser::binary::makeFourCC("adtl") }
 
enum class  ChunkListInfoType : uint32_t {
  IARL = sourcepp::parser::binary::makeFourCC("IARL") , IGNR = sourcepp::parser::binary::makeFourCC("IGNR") , IKEY = sourcepp::parser::binary::makeFourCC("IKEY") , ILGT = sourcepp::parser::binary::makeFourCC("ILGT") ,
  IMED = sourcepp::parser::binary::makeFourCC("IMED") , INAM = sourcepp::parser::binary::makeFourCC("INAM") , IPLT = sourcepp::parser::binary::makeFourCC("IPLT") , IPRD = sourcepp::parser::binary::makeFourCC("IPRD") ,
  ISBJ = sourcepp::parser::binary::makeFourCC("ISBJ") , ISFT = sourcepp::parser::binary::makeFourCC("ISFT") , ISHP = sourcepp::parser::binary::makeFourCC("ISHP") , IART = sourcepp::parser::binary::makeFourCC("IART") ,
  ISRC = sourcepp::parser::binary::makeFourCC("ISRC") , ISRF = sourcepp::parser::binary::makeFourCC("ISRF") , ITCH = sourcepp::parser::binary::makeFourCC("ITCH") , ICMS = sourcepp::parser::binary::makeFourCC("ICMS") ,
  ICMT = sourcepp::parser::binary::makeFourCC("ICMT") , ICOP = sourcepp::parser::binary::makeFourCC("ICOP") , ICRP = sourcepp::parser::binary::makeFourCC("ICRP") , IDPI = sourcepp::parser::binary::makeFourCC("IDPI") ,
  IENG = sourcepp::parser::binary::makeFourCC("IENG") , ISMP = sourcepp::parser::binary::makeFourCC("ISMP") , IDIT = sourcepp::parser::binary::makeFourCC("IDIT") , ICRD = sourcepp::parser::binary::makeFourCC("ICRD") ,
  ITRK = sourcepp::parser::binary::makeFourCC("ITRK")
}
 
enum class  ChunkListADTLType { LABL = sourcepp::parser::binary::makeFourCC("labl") , NOTE = sourcepp::parser::binary::makeFourCC("note") , LTXT = sourcepp::parser::binary::makeFourCC("ltxt") }
 

Public Member Functions

 WAV ()
 
 WAV (std::span< const std::byte > wavData)
 
 WAV (const std::string &wavPath)
 
 operator bool () const
 
const std::vector< std::unique_ptr< ChunkBase > > & getChunks () const
 
std::vector< std::unique_ptr< ChunkBase > > & getChunks ()
 
const ChunkBasegetFirstChunk (WAV::ChunkType type) const
 
const ChunkFMTgetChunkFMT () const
 
const ChunkDATAgetChunkDATA () const
 
const ChunkCUEgetChunkCUE () const
 
const ChunkPLSTgetChunkPLST () const
 
const ChunkFACTgetChunkFACT () const
 
const ChunkSMPLgetChunkSMPL () const
 
const ChunkINSTgetChunkINST () const
 
const ChunkCSETgetChunkCSET () const
 
const ChunkMD5getChunkMD5 () const
 
const ChunkJUNKgetChunkJUNK () const
 
const ChunkPADgetChunkPAD () const
 
const ChunkFLLRgetChunkFLLR () const
 
const ChunkLISTgetChunkLIST () const
 
uint32_t getSignature () const
 
void setSignature (uint32_t newSignature)
 

Static Public Attributes

static constexpr auto RIFF_TYPE = sourcepp::parser::binary::makeFourCC("WAVE")
 

Protected Attributes

std::vector< std::unique_ptr< ChunkBase > > chunks
 
uint32_t signature
 

Detailed Description

Definition at line 18 of file WAV.h.

Member Enumeration Documentation

◆ ChunkListADTLType

enum class sndpp::WAV::ChunkListADTLType
strong
Enumerator
LABL 
NOTE 
LTXT 

Definition at line 72 of file WAV.h.

◆ ChunkListInfoType

enum class sndpp::WAV::ChunkListInfoType : uint32_t
strong
Enumerator
IARL 
IGNR 
IKEY 
ILGT 
IMED 
INAM 
IPLT 
IPRD 
ISBJ 
ISFT 
ISHP 
IART 
ISRC 
ISRF 
ITCH 
ICMS 
ICMT 
ICOP 
ICRP 
IDPI 
IENG 
ISMP 
IDIT 
ICRD 
ITRK 

Definition at line 44 of file WAV.h.

◆ ChunkListType

enum class sndpp::WAV::ChunkListType : uint32_t
strong
Enumerator
WAVL 
INFO 
ADTL 

Definition at line 38 of file WAV.h.

◆ ChunkType

enum class sndpp::WAV::ChunkType : uint32_t
strong
Enumerator
FMT 
DATA 
CUE 
PLST 
FACT 
SMPL 
INST 
CSET 
MD5 
JUNK 
PAD 
FLLR 
LIST 

Definition at line 22 of file WAV.h.

Constructor & Destructor Documentation

◆ WAV() [1/3]

WAV::WAV ( )

Definition at line 221 of file WAV.cpp.

◆ WAV() [2/3]

WAV::WAV ( std::span< const std::byte >  wavData)
explicit

Definition at line 11 of file WAV.cpp.

◆ WAV() [3/3]

WAV::WAV ( const std::string &  wavPath)
explicit

Definition at line 224 of file WAV.cpp.

Member Function Documentation

◆ getChunkCSET()

const ChunkCSET * sndpp::WAV::getChunkCSET ( ) const

◆ getChunkCUE()

const ChunkCUE * sndpp::WAV::getChunkCUE ( ) const

◆ getChunkDATA()

const ChunkDATA * sndpp::WAV::getChunkDATA ( ) const

◆ getChunkFACT()

const ChunkFACT * sndpp::WAV::getChunkFACT ( ) const

◆ getChunkFLLR()

const ChunkFLLR * sndpp::WAV::getChunkFLLR ( ) const

◆ getChunkFMT()

const ChunkFMT * sndpp::WAV::getChunkFMT ( ) const

◆ getChunkINST()

const ChunkINST * sndpp::WAV::getChunkINST ( ) const

◆ getChunkJUNK()

const ChunkJUNK * sndpp::WAV::getChunkJUNK ( ) const

◆ getChunkLIST()

const ChunkLIST * sndpp::WAV::getChunkLIST ( ) const

◆ getChunkMD5()

const ChunkMD5 * sndpp::WAV::getChunkMD5 ( ) const

◆ getChunkPAD()

const ChunkPAD * sndpp::WAV::getChunkPAD ( ) const

◆ getChunkPLST()

const ChunkPLST * sndpp::WAV::getChunkPLST ( ) const

◆ getChunks() [1/2]

std::vector< std::unique_ptr< WAV::ChunkBase > > & WAV::getChunks ( )

Definition at line 235 of file WAV.cpp.

◆ getChunks() [2/2]

const std::vector< std::unique_ptr< WAV::ChunkBase > > & WAV::getChunks ( ) const

Definition at line 231 of file WAV.cpp.

◆ getChunkSMPL()

const ChunkSMPL * sndpp::WAV::getChunkSMPL ( ) const

◆ getFirstChunk()

const WAV::ChunkBase * WAV::getFirstChunk ( WAV::ChunkType  type) const

Definition at line 239 of file WAV.cpp.

◆ getSignature()

uint32_t WAV::getSignature ( ) const

Definition at line 248 of file WAV.cpp.

◆ operator bool()

WAV::operator bool ( ) const
explicit

Definition at line 227 of file WAV.cpp.

◆ setSignature()

void WAV::setSignature ( uint32_t  newSignature)

Definition at line 252 of file WAV.cpp.

Member Data Documentation

◆ chunks

std::vector<std::unique_ptr<ChunkBase> > sndpp::WAV::chunks
protected

Definition at line 256 of file WAV.h.

◆ RIFF_TYPE

constexpr auto sndpp::WAV::RIFF_TYPE = sourcepp::parser::binary::makeFourCC("WAVE")
staticconstexpr

Definition at line 20 of file WAV.h.

◆ signature

uint32_t sndpp::WAV::signature
protected

Definition at line 257 of file WAV.h.


The documentation for this class was generated from the following files: