myMPD
Internal API documentation
Loading...
Searching...
No Matches
idle.c File Reference

MPD client idle event handling. More...

#include "compile_time.h"
#include "src/mympd_client/idle.h"
#include "src/lib/config/mympd_state.h"
#include "src/lib/datetime.h"
#include "src/lib/event.h"
#include "src/lib/json/json_rpc.h"
#include "src/lib/log.h"
#include "src/lib/msg_queue.h"
#include "src/lib/sds/sds_extras.h"
#include "src/mympd_api/last_played.h"
#include "src/mympd_api/mympd_api_handler.h"
#include "src/mympd_api/status.h"
#include "src/mympd_api/timer.h"
#include "src/mympd_api/timer_handlers.h"
#include "src/mympd_api/trigger.h"
#include "src/mympd_client/connection.h"
#include "src/mympd_client/errorhandler.h"
#include "src/mympd_client/jukebox.h"
#include "src/mympd_client/partitions.h"
#include "src/mympd_client/queue.h"
#include "src/mympd_client/stickerdb.h"
#include <mpd/idle.h>
#include <string.h>
Include dependency graph for idle.c:

Functions

static void mympd_client_idle_partition (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, struct t_work_request *request)
static void mympd_client_parse_idle (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state, unsigned idle_bitmask)
bool mympd_client_idle (struct t_mympd_state *mympd_state, struct t_work_request *request)
void mympd_client_scrobble (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state)

Detailed Description

MPD client idle event handling.

Function Documentation

◆ mympd_client_idle()

bool mympd_client_idle ( struct t_mympd_state * mympd_state,
struct t_work_request * request )

Public functions This is the central function to handle api requests and mpd events. It is called from the mympd_api thread.

Parameters
mympd_statepointer to the mympd state struct
requestwork request from the mympd_api queue
Returns
true if an event was handled

◆ mympd_client_idle_partition()

void mympd_client_idle_partition ( struct t_mympd_state * mympd_state,
struct t_partition_state * partition_state,
struct t_work_request * request )
static

Private definitions

Private functions This function checks the mpd connection state, handles api requests and mpd events per partition.

Parameters
mympd_statepointer to mympd state
partition_statepointer to the partition state
requestapi request

◆ mympd_client_parse_idle()

void mympd_client_parse_idle ( struct t_mympd_state * mympd_state,
struct t_partition_state * partition_state,
unsigned idle_bitmask )
static

Handles mpd idle events

Parameters
mympd_statepointer to partition state
partition_statepointer to partition specific state
idle_bitmasktriggered mpd idle events as bitmask

◆ mympd_client_scrobble()

void mympd_client_scrobble ( struct t_mympd_state * mympd_state,
struct t_partition_state * partition_state )

Scrobble event Execute scrobble event scripts, updates the last play list and sets stickers.

Parameters
mympd_statepointer to partition state
partition_statepointer to partition specific state