libmpd
11.8.17
|
Data Structures | |
struct | _MpdData |
Macros | |
#define | __MPD_LIB__ |
#define | TRUE 1 |
#define | FALSE 0 |
Typedefs | |
typedef struct _MpdObj | MpdObj |
typedef void(* | StatusChangedCallback) (MpdObj *mi, ChangedStatusType what, void *userdata) |
typedef int(* | ErrorCallback) (MpdObj *mi, int id, char *msg, void *userdata) |
typedef void(* | ConnectionChangedCallback) (MpdObj *mi, int connect, void *userdata) |
Functions | |
MpdObj * | mpd_new_default () |
MpdObj * | mpd_new (char *hostname, int port, char *password) |
int | mpd_set_hostname (MpdObj *mi, char *hostname) |
const char * | mpd_get_hostname (MpdObj *mi) |
int | mpd_set_password (MpdObj *mi, const char *password) |
int | mpd_set_port (MpdObj *mi, int port) |
int | mpd_set_connection_timeout (MpdObj *mi, float timeout) |
int | mpd_connect_real (MpdObj *mi, mpd_Connection *connection) |
int | mpd_connect (MpdObj *mi) |
int | mpd_disconnect (MpdObj *mi) |
int | mpd_check_connected (MpdObj *mi) |
int | mpd_check_error (MpdObj *mi) |
void | mpd_free (MpdObj *mi) |
int | mpd_send_password (MpdObj *mi) |
void | mpd_signal_connect_status_changed (MpdObj *mi, StatusChangedCallback status_changed, void *userdata) |
void | mpd_signal_connect_error (MpdObj *mi, ErrorCallback error, void *userdata) |
void | mpd_signal_connect_connection_changed (MpdObj *mi, ConnectionChangedCallback connection_changed, void *userdata) |
Variables | |
char * | libmpd_version |
typedef void(* ConnectionChangedCallback) (MpdObj *mi, int connect, void *userdata) |
typedef int(* ErrorCallback) (MpdObj *mi, int id, char *msg, void *userdata) |
mi | a MpdObj |
id | The error Code. |
msg | human-readable informative error message. |
userdata | user data set when the signal handler was connected. This signal is called when an error has occurred in the communication with mpd. |
return: TRUE if libmpd should disconnect.
typedef struct _MpdObj MpdObj |
typedef void(* StatusChangedCallback) (MpdObj *mi, ChangedStatusType what, void *userdata) |
mi | a MpdObj |
what | a ChangedStatusType that determines what changed triggered the signal. This is a bitmask. |
userdata | user data set when the signal handler was connected. |
Signal that gets called when the state of mpd has changed. Look ChangedStatusType to see the possible events.
enum ChangedStatusType |
Bitwise enumeration to determine what triggered the status_changed signals This is used in combination with the StatusChangedCallback
enum MpdError |
Enum that represent the errors libmpd functions can return
enum MpdServerCommand |
int mpd_check_connected | ( | MpdObj * | mi | ) |
int mpd_check_error | ( | MpdObj * | mi | ) |
int mpd_connect | ( | MpdObj * | mi | ) |
mi | a MpdObj |
Connect to the mpd daemon. Warning: mpd_connect connects anonymous, to authenticate use mpd_send_password
int mpd_connect_real | ( | MpdObj * | mi, |
mpd_Connection * | connection | ||
) |
int mpd_disconnect | ( | MpdObj * | mi | ) |
void mpd_free | ( | MpdObj * | mi | ) |
mi | a MpdObj |
Free the MpdObj, when still connected the connection will be disconnected first
const char* mpd_get_hostname | ( | MpdObj * | mi | ) |
MpdObj* mpd_new | ( | char * | hostname, |
int | port, | ||
char * | password | ||
) |
hostname | The hostname to connect to |
port | The port to connect to |
password | The password to use for the connection, or NULL for no password |
Create a new MpdObj with provided settings:
MpdObj* mpd_new_default | ( | ) |
int mpd_send_password | ( | MpdObj * | mi | ) |
mi | a MpdObj |
Forces libmpd to re-authenticate itself.
When successful it will trigger the "permission" changed signal.
int mpd_set_connection_timeout | ( | MpdObj * | mi, |
float | timeout | ||
) |
mi | a MpdObj |
timeout | A timeout (in seconds) |
Set the timeout of the connection. If already connected the timeout of the running connection
int mpd_set_hostname | ( | MpdObj * | mi, |
char * | hostname | ||
) |
int mpd_set_password | ( | MpdObj * | mi, |
const char * | password | ||
) |
int mpd_set_port | ( | MpdObj * | mi, |
int | port | ||
) |
void mpd_signal_connect_connection_changed | ( | MpdObj * | mi, |
ConnectionChangedCallback | connection_changed, | ||
void * | userdata | ||
) |
mi | a MpdObj |
connection_changed | a ConnectionChangedCallback |
userdata | user data passed to the callback |
void mpd_signal_connect_error | ( | MpdObj * | mi, |
ErrorCallback | error, | ||
void * | userdata | ||
) |
mi | a MpdObj |
error | a ErrorCallback |
userdata | user data passed to the callback |
void mpd_signal_connect_status_changed | ( | MpdObj * | mi, |
StatusChangedCallback | status_changed, | ||
void * | userdata | ||
) |
mi | a MpdObj |
status_changed | a StatusChangedCallback |
userdata | user data passed to the callback |
char* libmpd_version |