MPD: DecoderPlugin Struct Reference

MPD 0.20.15

Public Member Functions | Data Fields
DecoderPlugin Struct Reference

`#include <DecoderPlugin.hxx>`

## Public Member Functions
bool | Init (const ConfigBlock &block) const
| Initialize a decoder plugin. More...
void | Finish () const
| Deinitialize a decoder plugin which was initialized successfully. More...
void | StreamDecode (DecoderClient &client, InputStream &is) const
| Decode a stream. More...
template<typename P >
void | FileDecode (DecoderClient &client, P path_fs) const
| Decode a file. More...
template<typename P >
bool | ScanFile (P path_fs, const TagHandler &handler, void *handler_ctx) const
| Read the tag of a file. More...
bool | ScanStream (InputStream &is, const TagHandler &handler, void *handler_ctx) const
| Read the tag of a stream. More...
template<typename P >
char * | ContainerScan (P path, const unsigned int tnum) const
| return "virtual" tracks in a container More...
gcc_pure gcc_nonnull_all bool | SupportsSuffix (const char *suffix) const noexcept
| Does the plugin announce the specified file name suffix? More...
gcc_pure gcc_nonnull_all bool | SupportsMimeType (const char *mime_type) const noexcept
| Does the plugin announce the specified MIME type? More...

## Data Fields
const char * | name
bool(* | init )(const ConfigBlock &block)
| Initialize the decoder plugin. More...
void(* | finish )()
| Deinitialize a decoder plugin which was initialized successfully. More...
void(* | stream_decode )(DecoderClient &client, InputStream &is)
| Decode a stream (data read from an InputStream object). More...
void(* | file_decode )(DecoderClient &client, Path path_fs)
| Decode a local file. More...
bool(* | scan_file )(Path path_fs, const TagHandler &handler, void *handler_ctx)
| Scan metadata of a file. More...
bool(* | scan_stream )(InputStream &is, const TagHandler &handler, void *handler_ctx)
| Scan metadata of a file. More...
std::forward_list< DetachedSong >(* | container_scan )(Path path_fs)
| Return a "virtual" filename for subtracks in container formats like flac. More...
const char *const * | suffixes
const char *const * | mime_types

## Detailed Description

Definition at line 34 of file DecoderPlugin.hxx.

## Member Function Documentation

## ◆ ContainerScan()

template<typename P >

char* DecoderPlugin::ContainerScan | ( | P | path,
|  | const unsigned int | tnum
| ) |  | const
| inline

return "virtual" tracks in a container

Definition at line 163 of file DecoderPlugin.hxx.

## ◆ FileDecode()

template<typename P >

void DecoderPlugin::FileDecode | ( | DecoderClient & | client,
|  | P | path_fs
| ) |  | const
| inline

Decode a file.

Definition at line 134 of file DecoderPlugin.hxx.

## ◆ Finish()

void DecoderPlugin::Finish | ( |  | ) | const
| inline

Deinitialize a decoder plugin which was initialized successfully.

Definition at line 118 of file DecoderPlugin.hxx.

## ◆ Init()

bool DecoderPlugin::Init | ( | const ConfigBlock & | block | ) | const
| inline

Initialize a decoder plugin.

Parameters

  block | a configuration block for this plugin

Returns
  true if the plugin was initialized successfully, false if the plugin is not available

Definition at line 109 of file DecoderPlugin.hxx.

## ◆ ScanFile()

template<typename P >

bool DecoderPlugin::ScanFile | ( | P | path_fs,
|  | const TagHandler & | handler,
|  | void * | handler_ctx
| ) |  | const
| inline

Read the tag of a file.

Definition at line 142 of file DecoderPlugin.hxx.

## ◆ ScanStream()

bool DecoderPlugin::ScanStream | ( | InputStream & | is,
|  | const TagHandler & | handler,
|  | void * | handler_ctx
| ) |  | const
| inline

Read the tag of a stream.

Definition at line 152 of file DecoderPlugin.hxx.

## ◆ StreamDecode()

void DecoderPlugin::StreamDecode | ( | DecoderClient & | client,
|  | InputStream & | is
| ) |  | const
| inline

Decode a stream.

Definition at line 126 of file DecoderPlugin.hxx.

## ◆ SupportsMimeType()

gcc_pure gcc_nonnull_all bool DecoderPlugin::SupportsMimeType | ( | const char * | mime_type | ) | const
| noexcept

Does the plugin announce the specified MIME type?

## ◆ SupportsSuffix()

gcc_pure gcc_nonnull_all bool DecoderPlugin::SupportsSuffix | ( | const char * | suffix | ) | const
| noexcept

Does the plugin announce the specified file name suffix?

## Field Documentation

## ◆ container_scan

std::forward_list<DetachedSong>(* DecoderPlugin::container_scan) (Path path_fs)

Return a "virtual" filename for subtracks in container formats like flac.

Parameters

  path_fs | full pathname for the file on fs

Returns
  an empty list if there are no multiple files a filename for every single track; do not include full pathname here, just the "virtual" file

Definition at line 96 of file DecoderPlugin.hxx.

## ◆ file_decode

void(* DecoderPlugin::file_decode) (DecoderClient &client, Path path_fs)

Decode a local file.

Either implement this method or stream_decode().

Definition at line 67 of file DecoderPlugin.hxx.

## ◆ finish

void(* DecoderPlugin::finish) ()

Deinitialize a decoder plugin which was initialized successfully.

Optional method.

Definition at line 51 of file DecoderPlugin.hxx.

## ◆ init

bool(* DecoderPlugin::init) (const ConfigBlock &block)

Initialize the decoder plugin.

Optional method.

Parameters

  param | a configuration block for this plugin, or nullptr if none is configured

Returns
  true if the plugin was initialized successfully, false if the plugin is not available

Definition at line 45 of file DecoderPlugin.hxx.

## ◆ mime_types

const char* const* DecoderPlugin::mime_types

Definition at line 100 of file DecoderPlugin.hxx.

## ◆ name

const char* DecoderPlugin::name

Definition at line 35 of file DecoderPlugin.hxx.

## ◆ scan_file

bool(* DecoderPlugin::scan_file) (Path path_fs, const TagHandler &handler, void *handler_ctx)

Scan metadata of a file.

Returns
  false if the operation has failed

Definition at line 74 of file DecoderPlugin.hxx.

## ◆ scan_stream

bool(* DecoderPlugin::scan_stream) (InputStream &is, const TagHandler &handler, void *handler_ctx)

Scan metadata of a file.

Returns
  false if the operation has failed

Definition at line 83 of file DecoderPlugin.hxx.

## ◆ stream_decode

void(* DecoderPlugin::stream_decode) (DecoderClient &client, InputStream &is)

Decode a stream (data read from an InputStream object).

Either implement this method or file_decode(). If possible, it is recommended to implement this method, because it is more versatile.

Definition at line 60 of file DecoderPlugin.hxx.

## ◆ suffixes

const char* const* DecoderPlugin::suffixes

Definition at line 99 of file DecoderPlugin.hxx.

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

- decoder/DecoderPlugin.hxx