MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / StreamDescriptionToString

Function StreamDescriptionToString

src/output/plugins/OSXOutputPlugin.cxx:45–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43static constexpr unsigned MPD_OSX_BUFFER_TIME_MS = 100;
44
45static auto
46StreamDescriptionToString(const AudioStreamBasicDescription desc) noexcept
47{
48 // Only convert the lpcm formats (nothing else supported / used by MPD)
49 assert(desc.mFormatID == kAudioFormatLinearPCM);
50
51 return FmtBuffer<256>("{} channel {} {}interleaved {}-bit {} {} ({}Hz)",
52 desc.mChannelsPerFrame,
53 (desc.mFormatFlags & kAudioFormatFlagIsNonMixable) ? "" : "mixable",
54 (desc.mFormatFlags & kAudioFormatFlagIsNonInterleaved) ? "non-" : "",
55 desc.mBitsPerChannel,
56 (desc.mFormatFlags & kAudioFormatFlagIsFloat) ? "Float" : "SInt",
57 (desc.mFormatFlags & kAudioFormatFlagIsBigEndian) ? "BE" : "LE",
58 desc.mSampleRate);
59}
60
61
62struct OSXOutput final : AudioOutput {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected