Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
monopoly::voicechat::packet Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  Event
 
struct  WaveFormat
 

Typedefs

using EventSink = bool(*)(const Event &, std::uint32_t sourceId)
 

Enumerations

enum class  EventKind : std::uint8_t {
  Start , Dimensions , Volume , Data ,
  DataAfterSilence , Position , Stop
}
 
enum class  ParseStatus : std::uint8_t { Ok , Malformed , SinkRejected }
 

Functions

constexpr std::uint32_t fourCC (char a, char b, char c, char d) noexcept
 
std::uint16_t readLe16 (std::span< const std::uint8_t > bytes, std::size_t offset) noexcept
 
std::uint32_t readLe32 (std::span< const std::uint8_t > bytes, std::size_t offset) noexcept
 
WaveFormat readWaveFormat (std::span< const std::uint8_t > bytes) noexcept
 
ParseStatus emit (EventSink sink, std::uint32_t sourceId, const Event &event) noexcept
 
ParseStatus parseChatSubchunks (std::span< const std::uint8_t > bytes, std::uint32_t sourceId, EventSink sink) noexcept
 
ParseStatus parse (std::span< const std::uint8_t > bytes, std::uint32_t sourceId, EventSink sink=nullptr) noexcept
 
bool makeStartPacket (WaveFormat format, std::span< const std::uint8_t > extraFormatBytes, std::uint32_t dimensions, std::uint32_t volume, std::vector< std::uint8_t > &packet)
 
bool makeDataPacket (std::span< const std::uint8_t > data, bool afterSilence, std::vector< std::uint8_t > &packet)
 
bool makeStopPacket (std::vector< std::uint8_t > &packet)
 
bool makePositionPacket (std::span< const float > coordinates, std::vector< std::uint8_t > &packet)
 

Variables

constexpr std::size_t MaximumPacketBytes
 

Typedef Documentation

◆ EventSink

Definition at line 52 of file VoiceChatPacket.hpp.

Enumeration Type Documentation

◆ EventKind

enum class monopoly::voicechat::packet::EventKind : std::uint8_t
strong
Enumerator
Start 
Dimensions 
Volume 
Data 
DataAfterSilence 
Position 
Stop 

Definition at line 15 of file VoiceChatPacket.hpp.

◆ ParseStatus

enum class monopoly::voicechat::packet::ParseStatus : std::uint8_t
strong
Enumerator
Ok 
Malformed 
SinkRejected 

Definition at line 45 of file VoiceChatPacket.hpp.

Function Documentation

◆ emit()

ParseStatus monopoly::voicechat::packet::emit ( EventSink  sink,
std::uint32_t  sourceId,
const Event &  event 
)
inlinenoexcept

Definition at line 90 of file VoiceChatPacket.hpp.

◆ fourCC()

constexpr std::uint32_t monopoly::voicechat::packet::fourCC ( char  a,
char  b,
char  c,
char  d 
)
constexprnoexcept

Definition at line 54 of file VoiceChatPacket.hpp.

◆ makeDataPacket()

bool monopoly::voicechat::packet::makeDataPacket ( std::span< const std::uint8_t >  data,
bool  afterSilence,
std::vector< std::uint8_t > &  packet 
)
inline

Definition at line 271 of file VoiceChatPacket.hpp.

◆ makePositionPacket()

bool monopoly::voicechat::packet::makePositionPacket ( std::span< const float >  coordinates,
std::vector< std::uint8_t > &  packet 
)
inline

Definition at line 287 of file VoiceChatPacket.hpp.

◆ makeStartPacket()

bool monopoly::voicechat::packet::makeStartPacket ( WaveFormat  format,
std::span< const std::uint8_t >  extraFormatBytes,
std::uint32_t  dimensions,
std::uint32_t  volume,
std::vector< std::uint8_t > &  packet 
)
inline

Definition at line 235 of file VoiceChatPacket.hpp.

◆ makeStopPacket()

bool monopoly::voicechat::packet::makeStopPacket ( std::vector< std::uint8_t > &  packet)
inline

Definition at line 281 of file VoiceChatPacket.hpp.

◆ parse()

ParseStatus monopoly::voicechat::packet::parse ( std::span< const std::uint8_t >  bytes,
std::uint32_t  sourceId,
EventSink  sink = nullptr 
)
inlinenoexcept

Definition at line 151 of file VoiceChatPacket.hpp.

◆ parseChatSubchunks()

ParseStatus monopoly::voicechat::packet::parseChatSubchunks ( std::span< const std::uint8_t >  bytes,
std::uint32_t  sourceId,
EventSink  sink 
)
inlinenoexcept

Definition at line 98 of file VoiceChatPacket.hpp.

◆ readLe16()

std::uint16_t monopoly::voicechat::packet::readLe16 ( std::span< const std::uint8_t >  bytes,
std::size_t  offset 
)
inlinenoexcept

Definition at line 63 of file VoiceChatPacket.hpp.

◆ readLe32()

std::uint32_t monopoly::voicechat::packet::readLe32 ( std::span< const std::uint8_t >  bytes,
std::size_t  offset 
)
inlinenoexcept

Definition at line 71 of file VoiceChatPacket.hpp.

◆ readWaveFormat()

WaveFormat monopoly::voicechat::packet::readWaveFormat ( std::span< const std::uint8_t >  bytes)
inlinenoexcept

Definition at line 80 of file VoiceChatPacket.hpp.

Variable Documentation

◆ MaximumPacketBytes

constexpr std::size_t monopoly::voicechat::packet::MaximumPacketBytes
inlineconstexpr
Initial value:
=
std::numeric_limits<std::uint16_t>::max()

Definition at line 12 of file VoiceChatPacket.hpp.