Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes
MPD::BaseClient Class Reference

The Base to MPD::Client. More...

#include <BaseClient.hh>

Inheritance diagram for MPD::BaseClient:
[legend]
Collaboration diagram for MPD::BaseClient:
[legend]

Public Member Functions

void go_idle ()
 Go into idle mode, you are not allowed to send commands while idling!
void go_busy ()
 Leave idle mode, so you can send commands to the server.
Connection & get_connection ()
 Returns the underlying connection.
bool is_connected ()
 true if connected
void begin ()
 Start a commandlist.
void commit ()
 Commit the commandlist.
Status * get_status ()
 Get the current MPD::Status.
EventNotifier & signal_client_update ()
 Get the notify sigc::signal.
ConnectionNotifier & signal_connection_change ()
 Register for connection changes.
void force_update ()
 Forces client update.
Query * create_db_songs_query (bool exact=false)
 Creates a Query to search songs in the the Database.
Query * create_db_tag_query (mpd_tag_type tag)
 Creates a Query to search tags in the Database.

Protected Member Functions

 BaseClient ()
 Do not allow to instantiate BaseClient.
bool __connect ()
 This is called internally by MPD::Client and does the actual connect work.
bool __disconnect ()
 Same as __connect()

Protected Attributes

MPD::Connection m_Conn
 The connection to the MPD server.
MPD::Listener * mp_Listener
 Event Listener.
bool m_ListBegun
 BaseClient::begin() was called but not yet BaseClient::commit()

Detailed Description

The Base to MPD::Client.

BaseClient does not offer any special command it can send to the server, but is able to set up everything related to connections, i.e setting up the Listener and the connection or reconnection once connection is lost connect() is not a public method, since you are not supposed to instanciate this class, MPD::Client offers the connect() you want to use.

The splitting between BaseClient and Client was done to allow Client Extensions, i.e. AudioOutput, that implements certain mpd commands to enable audio outputs.

Definition at line 52 of file BaseClient.hh.


Constructor & Destructor Documentation

MPD::BaseClient::BaseClient ( ) [protected]

Do not allow to instantiate BaseClient.


Member Function Documentation

bool MPD::BaseClient::__connect ( ) [protected]

This is called internally by MPD::Client and does the actual connect work.

Returns:
is_connected()
bool MPD::BaseClient::__disconnect ( ) [protected]

Same as __connect()

Returns:
is_connected()

Start a commandlist.

Commit the commandlist.

Creates a Query to search songs in the the Database.

Parameters:
exactExact or fuzzy matching?
Returns:
A newly allocated Query, delete after use

Creates a Query to search tags in the Database.

Parameters:
tag
Returns:

Forces client update.

Updates status, stats, current song and sends all possible events to all connected listeners

Here is the caller graph for this function:

Returns the underlying connection.

You are not supposed to call this as user of the client, it's use is intended as client extension that need to send it's own commands to MPD.

Returns:
A ref to a MPD::Connection

Get the current MPD::Status.

WARNING: This function does not guarantee to be up-to-date!!! If you need always the last status you may have to register for client updates, since the mainloop iteration might take a few cycles. It is therefore not encouraged to be used.

Returns:
A reference to it. Do not modify.

Here is the caller graph for this function:

Leave idle mode, so you can send commands to the server.

Go into idle mode, you are not allowed to send commands while idling!

true if connected

Returns:

Here is the caller graph for this function:

Get the notify sigc::signal.

Use connect() on it. This is called always once a new event happens. See the typedef in Listener.hh for the exact signature

Returns:
the sigc::signal

Here is the caller graph for this function:

Register for connection changes.

Returns:
a sigc::signal, you can call connect() on

Here is the caller graph for this function:


Field Documentation

The connection to the MPD server.

Definition at line 170 of file BaseClient.hh.

bool MPD::BaseClient::m_ListBegun [protected]

BaseClient::begin() was called but not yet BaseClient::commit()

Definition at line 179 of file BaseClient.hh.

Event Listener.

Definition at line 174 of file BaseClient.hh.


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