MPD: PcmExport Class Reference

MPD 0.20.15

Data Structures | Public Member Functions
PcmExport Class Reference

An object that handles export of PCM samples to some instance outside of MPD. More...

`#include <PcmExport.hxx>`

## Data Structures
struct | Params

## Public Member Functions
void | Open (SampleFormat sample_format, unsigned channels, Params params)
| Open the object. More...
void | Reset ()
| Reset the filter's state, e.g. More...
gcc_pure size_t | GetFrameSize (const AudioFormat &audio_format) const noexcept
| Calculate the size of one output frame. More...
ConstBuffer< void > | Export (ConstBuffer< void > src)
| Export a PCM buffer. More...
gcc_pure size_t | CalcSourceSize (size_t dest_size) const noexcept
| Converts the number of consumed bytes from the pcm_export() destination buffer to the according number of bytes from the pcm_export() source buffer. More...

## Detailed Description

An object that handles export of PCM samples to some instance outside of MPD.

It has a few more options to tweak the binary representation which are not supported by the pcm_convert library.

Definition at line 35 of file PcmExport.hxx.

## Member Function Documentation

## ◆ CalcSourceSize()

gcc_pure size_t PcmExport::CalcSourceSize | ( | size_t | dest_size | ) | const
| noexcept

Converts the number of consumed bytes from the pcm_export() destination buffer to the according number of bytes from the pcm_export() source buffer.

## ◆ Export()

ConstBuffer<void> PcmExport::Export | ( | ConstBuffer< void > | src | ) |

Export a PCM buffer.

Parameters

  src | the source PCM buffer

Returns
  the destination buffer (may be a pointer to the source buffer)

## ◆ GetFrameSize()

gcc_pure size_t PcmExport::GetFrameSize | ( | const AudioFormat & | audio_format | ) | const
| noexcept

Calculate the size of one output frame.

## ◆ Open()

void PcmExport::Open | ( | SampleFormat | sample_format,
|  | unsigned | channels,
|  | Params | params
| ) |  |

Open the object.

There is no "close" method. This function may be called multiple times to reuse the object.

This function cannot fail.

Parameters

  channels | the number of channels; ignored unless dop is set

## ◆ Reset()

void PcmExport::Reset | ( |  | ) |
| inline

Reset the filter's state, e.g.

drop/flush buffers.

Definition at line 163 of file PcmExport.hxx.

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

- pcm/PcmExport.hxx