output.h File Reference

MPD client library. More...

Go to the source code of this file.

## Functions

mpd_malloc struct mpd_output * | mpd_output_begin (const struct mpd_pair *pair)
bool | mpd_output_feed (struct mpd_output *output, const struct mpd_pair *pair)
void | mpd_output_free (struct mpd_output *output)
mpd_pure unsigned | mpd_output_get_id (const struct mpd_output *output)
mpd_pure const char * | mpd_output_get_name (const struct mpd_output *output)
mpd_pure bool | mpd_output_get_enabled (const struct mpd_output *output)
bool | mpd_send_outputs (struct mpd_connection *connection)
mpd_malloc struct mpd_output * | mpd_recv_output (struct mpd_connection *connection)
bool | mpd_send_enable_output (struct mpd_connection *connection, unsigned output_id)
bool | mpd_run_enable_output (struct mpd_connection *connection, unsigned output_id)
bool | mpd_send_disable_output (struct mpd_connection *connection, unsigned output_id)
bool | mpd_run_disable_output (struct mpd_connection *connection, unsigned output_id)
bool | mpd_send_toggle_output (struct mpd_connection *connection, unsigned output_id)
bool | mpd_run_toggle_output (struct mpd_connection *connection, unsigned output_id)

## Detailed Description

MPD client library.

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

Definition in file output.h.

## Function Documentation

mpd_malloc struct mpd_output* mpd_output_begin | ( | const struct mpd_pair * | pair | ) |

Begins parsing a new mpd_output.

Parameters

  pair | the first pair in this output (name is "outputid")

Returns
  the new mpd_output object, or NULL on error (out of memory, or wrong pair name)

bool mpd_output_feed | ( | struct mpd_output * | output,
|  | const struct mpd_pair * | pair
| ) |  |

Parses the pair, adding its information to the specified mpd_output object.

Returns
  true if the pair was parsed and added to the output (or if the pair was not understood and ignored), false if this pair is the beginning of the next output

void mpd_output_free | ( | struct mpd_output * | output | ) |

Frees a mpd_output object returned from mpd_recv_output().

mpd_pure unsigned mpd_output_get_id | ( | const struct mpd_output * | output | ) |

Returns
  the id of the specified mpd_output object

mpd_pure const char* mpd_output_get_name | ( | const struct mpd_output * | output | ) |

Returns
  the configured name of the specified mpd_output object

mpd_pure bool mpd_output_get_enabled | ( | const struct mpd_output * | output | ) |

Returns
  true if this output is enabled

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

Sends the "outputs" command to MPD. Call mpd_recv_output() to read the response.

Parameters

  connection | A valid and connected mpd_connection.

Returns
  true on success

mpd_malloc struct mpd_output* mpd_recv_output | ( | struct mpd_connection * | connection | ) |

Reads the next mpd_output from the MPD response. Free the return value with mpd_output_free().

Returns
  a mpd_output object on success, NULL on error or end-of-response

bool mpd_send_enable_output | ( | struct mpd_connection * | connection,
|  | unsigned | output_id
| ) |  |

Sends the "enableoutput" command to MPD.

Parameters

  connection | A valid and connected mpd_connection.
  output_id | an identifier for the output device (see mpd_recv_output())

Returns
  true on success

bool mpd_run_enable_output | ( | struct mpd_connection * | connection,
|  | unsigned | output_id
| ) |  |

Shortcut for mpd_send_enable_output() and mpd_response_finish().

Parameters

  connection | A valid and connected mpd_connection.
  output_id | an identifier for the output device (see mpd_recv_output())

Returns
  true on success

bool mpd_send_disable_output | ( | struct mpd_connection * | connection,
|  | unsigned | output_id
| ) |  |

Sends the "disableoutput" command to MPD.

Parameters

  connection | A valid and connected mpd_connection.
  output_id | an identifier for the output device (see mpd_recv_output())

Returns
  true on success

bool mpd_run_disable_output | ( | struct mpd_connection * | connection,
|  | unsigned | output_id
| ) |  |

Shortcut for mpd_send_disable_output() and mpd_response_finish().

Parameters

  connection | A valid and connected mpd_connection.
  output_id | an identifier for the output device (see mpd_recv_output())

Returns
  true on success

bool mpd_send_toggle_output | ( | struct mpd_connection * | connection,
|  | unsigned | output_id
| ) |  |

Sends the "toggleoutput" command to MPD.

Parameters

  connection | a valid and connected mpd_connection.
  output_id | an identifier for the output device (see mpd_recv_output())

Returns
  true on success

bool mpd_run_toggle_output | ( | struct mpd_connection * | connection,
|  | unsigned | output_id
| ) |  |

Shortcut for mpd_send_toggle_output() and mpd_response_finish().

Parameters

  connection | a valid and connected mpd_connection.
  output_id | an identifier for the output device (see mpd_recv_output())

Returns
  true on success