|
Freya
0.0.1
A Gtk3 MPD Client
|
A convinience Wrapper around mpd_connection*. More...
#include <Connection.hh>
Public Member Functions | |
| Connection () | |
| Initializes a new connection object. | |
| ~Connection () | |
| Automatically disconnects. | |
| bool | is_connected () |
| is connected? | |
| bool | connect () |
| Tries to connect accordingly to the values in the config. | |
| bool | disconnect () |
| Disconnects connection. | |
| bool | clear_error () |
| Clears any occured errors. | |
| bool | check_error () |
| check if an error occured | |
| ErrorNotify & | signal_error () |
| get a sigc::connection that is emit()'d once an error occures | |
| ConnectionNotifier & | signal_connection_change () |
| Use this to register for connection changes. | |
| void | emit_connection_change () |
| Call emit() on the ConnectionNotifier signal. | |
| mpd_connection * | get_connection () |
| Returns the underlying C structure. | |
A convinience Wrapper around mpd_connection*.
It features error notifying, error clearing, and doing the actual connection work.
Definition at line 59 of file Connection.hh.
Initializes a new connection object.
Automatically disconnects.
| bool MPD::Connection::check_error | ( | ) |
check if an error occured
Clears error, calls emit() on ErrorNotify
| bool MPD::Connection::clear_error | ( | ) |
Clears any occured errors.
If an error occured you might have to call this before you continue to use the connection, mostly this called automatically by check_error(), which is executed in every idle/busy cycle.
| bool MPD::Connection::connect | ( | ) |
Tries to connect accordingly to the values in the config.
is_connected() hast to be false.
| bool MPD::Connection::disconnect | ( | ) |
Disconnects connection.
Call emit() on the ConnectionNotifier signal.
This is a separate function because one want to emit the signal after making other things ready first. You have to call connect() or disconnect() BEFORE emitting though!
| mpd_connection* MPD::Connection::get_connection | ( | ) |
Returns the underlying C structure.
| bool MPD::Connection::is_connected | ( | ) |
is connected?
Use this to register for connection changes.
get a sigc::connection that is emit()'d once an error occures
1.8.0