MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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
| Does the plugin announce the specified file name suffix? More...
gcc_pure gcc_nonnull_all bool | SupportsMimeType (const char *mime_type) const
| 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

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.

template<typename P >

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

Decode a file.

Definition at line 134 of file DecoderPlugin.hxx.

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

Deinitialize a decoder plugin which was initialized successfully.

Definition at line 118 of file DecoderPlugin.hxx.

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.

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.

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.

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

Decode a stream.

Definition at line 126 of file DecoderPlugin.hxx.

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

Does the plugin announce the specified MIME type?

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

Does the plugin announce the specified file name suffix?

## Field Documentation

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.

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.

void(* DecoderPlugin::finish) ()

Deinitialize a decoder plugin which was initialized successfully.

Optional method.

Definition at line 51 of file DecoderPlugin.hxx.

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.

const char* const* DecoderPlugin::mime_types

Definition at line 100 of file DecoderPlugin.hxx.

const char* DecoderPlugin::name

Definition at line 35 of file DecoderPlugin.hxx.

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.

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.

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.

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