myMPD
Internal API documentation
Loading...
Searching...
No Matches
status.h File Reference

myMPD status API More...

Include dependency graph for status.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

unsigned mympd_api_get_elapsed_seconds (struct mpd_status *status)
 
sds mympd_api_status_print (struct t_partition_state *partition_state, struct t_cache *album_cache, sds buffer, struct mpd_status *status)
 
sds mympd_api_status_updatedb_state (struct t_partition_state *partition_state, sds buffer)
 
unsigned mympd_api_status_updatedb_id (struct t_partition_state *partition_state)
 
sds mympd_api_status_volume_get (struct t_partition_state *partition_state, sds buffer, unsigned request_id, enum jsonrpc_response_types response_type)
 
sds mympd_api_status_get (struct t_partition_state *partition_state, struct t_cache *album_cache, sds buffer, unsigned request_id, enum jsonrpc_response_types response_type)
 
bool mympd_api_status_clear_error (struct t_partition_state *partition_state, sds *buffer, enum mympd_cmd_ids cmd_id, unsigned request_id)
 
sds mympd_api_status_current_song (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, sds buffer, unsigned request_id)
 

Detailed Description

myMPD status API

Function Documentation

◆ mympd_api_get_elapsed_seconds()

unsigned mympd_api_get_elapsed_seconds ( struct mpd_status *  status)

Public functions Replacement for deprecated mpd_status_get_elapsed_time

Parameters
statuspointer to mpd_status struct
Returns
elapsed seconds

◆ mympd_api_status_clear_error()

bool mympd_api_status_clear_error ( struct t_partition_state partition_state,
sds *  buffer,
enum mympd_cmd_ids  cmd_id,
unsigned  request_id 
)

Clears the mpd player error returned by the status command.

Parameters
partition_statepointer to partition state
bufferalready allocated sds string to append the error response
cmd_idjsonrpc method
request_idjsonrpc request id
Returns
true on success, else false

◆ mympd_api_status_current_song()

sds mympd_api_status_current_song ( struct t_mympd_state mympd_state,
struct t_partition_state partition_state,
sds  buffer,
unsigned  request_id 
)

Gets the current playing song as jsonrpc response

Parameters
mympd_statepointer to mympd state
partition_statepointer to partition state
bufferalready allocated sds string to append the response
request_idjsonrpc request id
Returns
pointer to buffer

◆ mympd_api_status_get()

sds mympd_api_status_get ( struct t_partition_state partition_state,
struct t_cache album_cache,
sds  buffer,
unsigned  request_id,
enum jsonrpc_response_types  response_type 
)

Gets the mpd status, updates internal myMPD states and returns a jsonrpc notify or response

Parameters
partition_statepointer to partition state
album_cachepointer to album cache
bufferalready allocated sds string to append the response
request_idjsonrpc request id
response_typejsonrpc response type: RESPONSE_TYPE_RESPONSE or RESPONSE_TYPE_NOTIFY
Returns
pointer to buffer

◆ mympd_api_status_print()

sds mympd_api_status_print ( struct t_partition_state partition_state,
struct t_cache album_cache,
sds  buffer,
struct mpd_status *  status 
)

Prints the mpd_status as jsonrpc object string

Parameters
partition_statepointer to partition state
album_cachepointer to album cache
bufferalready allocated sds string to append the response
statuspointer to mpd_status struct
Returns
pointer to buffer

◆ mympd_api_status_updatedb_id()

unsigned mympd_api_status_updatedb_id ( struct t_partition_state partition_state)

Gets the update database id

Parameters
partition_statepointer to partition state
Returns
database update id

◆ mympd_api_status_updatedb_state()

sds mympd_api_status_updatedb_state ( struct t_partition_state partition_state,
sds  buffer 
)

Gets the update database status from mpd as jsonrpc notification

Parameters
partition_statepointer to partition state
bufferalready allocated sds string to append the response
Returns
pointer to buffer

◆ mympd_api_status_volume_get()

sds mympd_api_status_volume_get ( struct t_partition_state partition_state,
sds  buffer,
unsigned  request_id,
enum jsonrpc_response_types  response_type 
)

Gets the mpd volume as jsonrpc notify

Parameters
partition_statepointer to partition state
bufferalready allocated sds string to append the response
request_idjsonrpc request id
response_typejsonrpc response type: RESPONSE_TYPE_RESPONSE or RESPONSE_TYPE_NOTIFY
Returns
pointer to buffer