player.h File Reference

MPD client library. More...

Go to the source code of this file.

## Functions

bool | mpd_send_current_song (struct mpd_connection *connection)
mpd_malloc struct mpd_song * | mpd_run_current_song (struct mpd_connection *connection)
bool | mpd_send_play (struct mpd_connection *connection)
bool | mpd_run_play (struct mpd_connection *connection)
bool | mpd_send_play_pos (struct mpd_connection *connection, unsigned song_pos)
bool | mpd_run_play_pos (struct mpd_connection *connection, unsigned song_pos)
bool | mpd_send_play_id (struct mpd_connection *connection, unsigned id)
bool | mpd_run_play_id (struct mpd_connection *connection, unsigned song_id)
bool | mpd_send_stop (struct mpd_connection *connection)
bool | mpd_run_stop (struct mpd_connection *connection)
bool | mpd_send_toggle_pause (struct mpd_connection *connection)
bool | mpd_run_toggle_pause (struct mpd_connection *connection)
bool | mpd_send_pause (struct mpd_connection *connection, bool mode)
bool | mpd_run_pause (struct mpd_connection *connection, bool mode)
bool | mpd_send_next (struct mpd_connection *connection)
bool | mpd_run_next (struct mpd_connection *connection)
bool | mpd_send_previous (struct mpd_connection *connection)
bool | mpd_run_previous (struct mpd_connection *connection)
bool | mpd_send_seek_pos (struct mpd_connection *connection, unsigned song_pos, unsigned t)
bool | mpd_run_seek_pos (struct mpd_connection *connection, unsigned song_pos, unsigned t)
bool | mpd_send_seek_id (struct mpd_connection *connection, unsigned id, unsigned t)
bool | mpd_run_seek_id (struct mpd_connection *connection, unsigned song_id, unsigned t)
bool | mpd_send_repeat (struct mpd_connection *connection, bool mode)
bool | mpd_run_repeat (struct mpd_connection *connection, bool mode)
bool | mpd_send_random (struct mpd_connection *connection, bool mode)
bool | mpd_run_random (struct mpd_connection *connection, bool mode)
bool | mpd_send_single (struct mpd_connection *connection, bool mode)
bool | mpd_run_single (struct mpd_connection *connection, bool mode)
bool | mpd_send_consume (struct mpd_connection *connection, bool mode)
bool | mpd_run_consume (struct mpd_connection *connection, bool mode)
bool | mpd_send_crossfade (struct mpd_connection *connection, unsigned seconds)
bool | mpd_run_crossfade (struct mpd_connection *connection, unsigned seconds)
bool | mpd_send_mixrampdb (struct mpd_connection *connection, float db)
bool | mpd_run_mixrampdb (struct mpd_connection *connection, float db)
bool | mpd_send_mixrampdelay (struct mpd_connection *connection, float seconds)
bool | mpd_run_mixrampdelay (struct mpd_connection *connection, float seconds)
bool | mpd_send_clearerror (struct mpd_connection *connection)
bool | mpd_run_clearerror (struct mpd_connection *connection)

## Detailed Description

MPD client library.

Controlling playback.

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

Definition in file player.h.

## Function Documentation

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

Fetches the currently selected song (the song referenced by status->song and status->songid).

mpd_malloc struct mpd_song* mpd_run_current_song | ( | struct mpd_connection * | connection | ) |

Shortcut for mpd_send_currentsong() and mpd_recv_song().

Parameters

  connection | the connection to MPD

Returns
  the current song, or NULL on error or if there is no current song

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

Starts playing the current song from the beginning.

Parameters

  connection | the connection to MPD

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

bool mpd_send_play_pos | ( | struct mpd_connection * | connection,
|  | unsigned | song_pos
| ) |  |

Starts playing the specified song from the beginning.

Parameters

  song_pos | the position of the song in the queue
  connection | the connection to MPD

Returns
  true on success, false on error

bool mpd_run_play_pos | ( | struct mpd_connection * | connection,
|  | unsigned | song_pos
| ) |  |

bool mpd_send_play_id | ( | struct mpd_connection * | connection,
|  | unsigned | id
| ) |  |

Starts playing the specified song from the beginning.

Parameters

  connection | the connection to MPD
  id | the id of the song

Returns
  true on success, false on error

bool mpd_run_play_id | ( | struct mpd_connection * | connection,
|  | unsigned | song_id
| ) |  |

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

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

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

Toggles the pause mode by sending "pause" without arguments.

Parameters

  connection | the connection to MPD

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

bool mpd_send_pause | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_run_pause | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

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

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

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

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

bool mpd_send_seek_pos | ( | struct mpd_connection * | connection,
|  | unsigned | song_pos,
|  | unsigned | t
| ) |  |

Seeks the specified song.

Parameters

  connection | the connection to MPD
  song_pos | the position of the song in the queue
  t | the position within the song, in seconds

Returns
  true on success, false on error

bool mpd_run_seek_pos | ( | struct mpd_connection * | connection,
|  | unsigned | song_pos,
|  | unsigned | t
| ) |  |

bool mpd_send_seek_id | ( | struct mpd_connection * | connection,
|  | unsigned | id,
|  | unsigned | t
| ) |  |

Seeks the specified song.

Parameters

  connection | the connection to MPD
  id | the id of the song
  t | the position within the song, in seconds

Returns
  true on success, false on error

bool mpd_run_seek_id | ( | struct mpd_connection * | connection,
|  | unsigned | song_id,
|  | unsigned | t
| ) |  |

bool mpd_send_repeat | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_run_repeat | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_send_random | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_run_random | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_send_single | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_run_single | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_send_consume | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_run_consume | ( | struct mpd_connection * | connection,
|  | bool | mode
| ) |  |

bool mpd_send_crossfade | ( | struct mpd_connection * | connection,
|  | unsigned | seconds
| ) |  |

bool mpd_run_crossfade | ( | struct mpd_connection * | connection,
|  | unsigned | seconds
| ) |  |

bool mpd_send_mixrampdb | ( | struct mpd_connection * | connection,
|  | float | db
| ) |  |

bool mpd_run_mixrampdb | ( | struct mpd_connection * | connection,
|  | float | db
| ) |  |

bool mpd_send_mixrampdelay | ( | struct mpd_connection * | connection,
|  | float | seconds
| ) |  |

bool mpd_run_mixrampdelay | ( | struct mpd_connection * | connection,
|  | float | seconds
| ) |  |

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

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