ncmpc  0.30
Public Member Functions | Data Fields
mpdclient Struct Reference

#include <mpdclient.hxx>

Public Member Functions

 mpdclient (const char *host, unsigned port, unsigned _timeout_ms, const char *_password)
 
 ~mpdclient ()
 
std::string GetSettingsName () const
 
bool IsConnected () const
 
gcc_pure bool IsDead () const
 
gcc_pure const struct mpd_song * GetCurrentSong () const
 
void Connect ()
 
void Disconnect ()
 
bool HandleError ()
 
struct mpd_connection * GetConnection ()
 
bool FinishCommand ()
 
bool Update ()
 

Data Fields

const char * host
 
unsigned port
 
const unsigned timeout_ms
 
const char *const password
 
MpdQueue playlist
 
struct mpd_connection * connection = nullptr
 
MpdIdleSourcesource = nullptr
 
struct mpd_status * status = nullptr
 
const struct mpd_song * song = nullptr
 
unsigned enter_idle_source_id = 0
 
unsigned connection_id = 0
 
int volume = -1
 
unsigned events = 0
 
enum mpd_state state = MPD_STATE_UNKNOWN
 
bool idle = false
 
bool playing = false
 
bool playing_or_paused = false
 

Constructor & Destructor Documentation

◆ mpdclient()

mpdclient::mpdclient ( const char *  host,
unsigned  port,
unsigned  _timeout_ms,
const char *  _password 
)

◆ ~mpdclient()

mpdclient::~mpdclient ( )
inline

Member Function Documentation

◆ GetSettingsName()

std::string mpdclient::GetSettingsName ( ) const

Determine a human-readable "name" of the settings currently used to connect to MPD.

Returns
an allocated string that needs to be freed (with g_free()) by the caller

◆ IsConnected()

bool mpdclient::IsConnected ( ) const
inline

◆ IsDead()

gcc_pure bool mpdclient::IsDead ( ) const
inline

Is this object "dead"? i.e. not connected and not currently doing anything to connect.

◆ GetCurrentSong()

gcc_pure const struct mpd_song* mpdclient::GetCurrentSong ( ) const
inline

◆ Connect()

void mpdclient::Connect ( )

◆ Disconnect()

void mpdclient::Disconnect ( )

◆ HandleError()

bool mpdclient::HandleError ( )

◆ GetConnection()

struct mpd_connection* mpdclient::GetConnection ( )

◆ FinishCommand()

bool mpdclient::FinishCommand ( )
inline

◆ Update()

bool mpdclient::Update ( )

Field Documentation

◆ host

const char* mpdclient::host

◆ port

unsigned mpdclient::port

◆ timeout_ms

const unsigned mpdclient::timeout_ms

◆ password

const char* const mpdclient::password

◆ playlist

MpdQueue mpdclient::playlist

◆ connection

struct mpd_connection* mpdclient::connection = nullptr

◆ source

MpdIdleSource* mpdclient::source = nullptr

Tracks idle events. It is automatically called by mpdclient_get_connection().

◆ status

struct mpd_status* mpdclient::status = nullptr

◆ song

const struct mpd_song* mpdclient::song = nullptr

◆ enter_idle_source_id

unsigned mpdclient::enter_idle_source_id = 0

The GLib source id which re-enters MPD idle mode before the next main loop interation.

◆ connection_id

unsigned mpdclient::connection_id = 0

This attribute is incremented whenever the connection changes (i.e. on disconnection and (re-)connection).

◆ volume

int mpdclient::volume = -1

◆ events

unsigned mpdclient::events = 0

A bit mask of idle events occurred since the last update.

◆ state

enum mpd_state mpdclient::state = MPD_STATE_UNKNOWN

◆ idle

bool mpdclient::idle = false

This attribute is true when the connection is currently in "idle" mode, and the #mpd_glib_source waits for an event.

◆ playing

bool mpdclient::playing = false

Is MPD currently playing?

◆ playing_or_paused

bool mpdclient::playing_or_paused = false

Is MPD currently playing or paused?


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