replay_gain.h File Reference

MPD client library. More...

`#include "compiler.h"`
`#include <stdbool.h>`

Go to the source code of this file.

## Enumerations

enum | mpd_replay_gain_mode { MPD_REPLAY_OFF = 0 , MPD_REPLAY_TRACK , MPD_REPLAY_ALBUM , MPD_REPLAY_AUTO , MPD_REPLAY_UNKNOWN }

## Functions

enum mpd_replay_gain_mode | mpd_parse_replay_gain_name (const char *name)
const char * | mpd_lookup_replay_gain_mode (enum mpd_replay_gain_mode mode)
bool | mpd_send_replay_gain_status (struct mpd_connection *connection)
enum mpd_replay_gain_mode | mpd_run_replay_gain_status (struct mpd_connection *connection)
bool | mpd_send_replay_gain_mode (struct mpd_connection *connection, enum mpd_replay_gain_mode mode)
bool | mpd_run_replay_gain_mode (struct mpd_connection *connection, enum mpd_replay_gain_mode mode)

## Detailed Description

MPD client library.

Do not include this header directly. Use mpd/client.h instead.

Definition in file replay_gain.h.

## Enumeration Type Documentation

## mpd_replay_gain_mode

enum mpd_replay_gain_mode

MPD's replay gain mode.

Since
  libmpdclient 2.19, MPD 0.16.

Enumerator
MPD_REPLAY_OFF | ignore ReplayGain tag values
MPD_REPLAY_TRACK | use per-track ReplayGain values
MPD_REPLAY_ALBUM | use per-album ReplayGain values
MPD_REPLAY_AUTO | use available ReplayGain value; if both track and album tags are available, prefer track values.
MPD_REPLAY_UNKNOWN | Unknown mode

Definition at line 53 of file replay_gain.h.

## Function Documentation

## mpd_parse_replay_gain_name()

enum mpd_replay_gain_mode mpd_parse_replay_gain_name | ( | const char * | name | ) |

Parse a mpd_pair value to check which replay gain mode it contains.

## mpd_lookup_replay_gain_mode()

const char* mpd_lookup_replay_gain_mode | ( | enum mpd_replay_gain_mode | mode | ) |

Looks up the name of the specified replay gain mode.

Returns
  the name, or NULL if the replay gain mode is not valid

Since
  libmpdclient 2.19.

## mpd_send_replay_gain_status()

bool mpd_send_replay_gain_status | ( | struct mpd_connection * | connection | ) |

Queries the current state of replay gain mode on MPD.

Sends the "replay_gain_status" command to MPD. Call mpd_recv_pair() to read response lines. The pair's name should be "replay_gain_mode". Use mpd_parse_replay_gain_name() to check each pair's value.

Parameters

  connection | the connection to MPD

Returns
  true on success, false on error

Since
  MPD 0.16, libmpdclient 2.19.

## mpd_run_replay_gain_status()

enum mpd_replay_gain_mode mpd_run_replay_gain_status | ( | struct mpd_connection * | connection | ) |

Shortcut for mpd_send_replay_gain_status(), mpd_recv_pair_named() and mpd_response_finish().

Parameters

  connection | the connection to MPD

Returns
  mpd_replay_gain_mode object: MPD_REPLAY_UNKNOWN on error (or unknown ReplayGain mode); other modes on success.

Since
  MPD 0.16, libmpdclient 2.19.

## mpd_send_replay_gain_mode()

bool mpd_send_replay_gain_mode | ( | struct mpd_connection * | connection,
|  | enum mpd_replay_gain_mode | mode
| ) |  |

Sets the current state of replay gain mode on MPD.

Parameters

  connection | the connection to MPD
  mode | the desired replay gain mode

Returns
  true on success, false on error

Since
  MPD 0.16, libmpdclient 2.19.

## mpd_run_replay_gain_mode()

bool mpd_run_replay_gain_mode | ( | struct mpd_connection * | connection,
|  | enum mpd_replay_gain_mode | mode
| ) |  |

Shortcut for mpd_send_replay_gain_mode() and mpd_response_finish().

Parameters

  connection | the connection to MPD
  mode | mode the desired replay gain mode

Returns
  true on success, false on error

Since
  MPD 0.16, libmpdclient 2.19.