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

myMPD timer handlers More...

#include "compile_time.h"
#include "src/mympd_api/timer_handlers.h"
#include "src/lib/api.h"
#include "src/lib/config/mympd_state.h"
#include "src/lib/json/json_print.h"
#include "src/lib/json/json_query.h"
#include "src/lib/json/json_rpc.h"
#include "src/lib/list/list.h"
#include "src/lib/log.h"
#include "src/lib/msg_queue.h"
#include "src/lib/sds/sds_extras.h"
#include "src/mympd_api/requests.h"
#include "src/mympd_client/errorhandler.h"
#include "src/mympd_client/shortcuts.h"
#include "src/mympd_client/volume.h"
#include <string.h>
Include dependency graph for timer_handlers.c:

Functions

static void timer_handler_cache_disk_crop (void)
static void timer_handler_smartpls_update (void)
static void timer_handler_caches_create (void)
static void timer_handler_webradiodb_update (void)
static void timer_handler_state_save (struct t_mympd_state *mympd_state)
const char * get_timer_name (unsigned timer_id)
void timer_handler_by_id (enum timer_ids timer_id, struct t_timer_definition *definition, struct t_mympd_state *mympd_state)
void timer_handler_select (unsigned timer_id, struct t_timer_definition *definition, struct t_mympd_state *mympd_state)
bool mympd_api_timer_startplay (struct t_partition_state *partition_state, unsigned volume, sds playlist, sds preset)

Detailed Description

myMPD timer handlers

Function Documentation

◆ get_timer_name()

const char * get_timer_name ( unsigned timer_id)

Public functions Return the timer name for a timer_id

Parameters
timer_idTimer ID
Returns
const char* Timer name

◆ mympd_api_timer_startplay()

bool mympd_api_timer_startplay ( struct t_partition_state * partition_state,
unsigned volume,
sds playlist,
sds preset )

This function is used by INTERNAL_API_TIMER_STARTPLAY and is called from the mympd_api_handler

Parameters
partition_statepointer to the partition_state
volumempd volume to set
playlistthe mpd playlist to load
presetthe preset to load
Returns
true on success else false

◆ timer_handler_by_id()

void timer_handler_by_id ( enum timer_ids timer_id,
struct t_timer_definition * definition,
struct t_mympd_state * mympd_state )

Handles timer by timer_id, this is only used for internal timers

Parameters
timer_idthe internal timer_id from enum timer_ids
definitionthe timer definition - not used
mympd_statePointer to mympd_state

◆ timer_handler_cache_disk_crop()

void timer_handler_cache_disk_crop ( void )
static

Private definitions

Private functions Timer handler for timer_id TIMER_ID_DISK_CACHE_CROP

◆ timer_handler_caches_create()

void timer_handler_caches_create ( void )
static

Timer handler for timer_id TIMER_ID_CACHES_CREATE

◆ timer_handler_select()

void timer_handler_select ( unsigned timer_id,
struct t_timer_definition * definition,
struct t_mympd_state * mympd_state )

Handles user defined timers

Parameters
timer_idthe timer id
definitionthe timer definition
mympd_statePointer to mympd_state

◆ timer_handler_smartpls_update()

void timer_handler_smartpls_update ( void )
static

Timer handler for timer_id TIMER_ID_SMARTPLS_UPDATE

◆ timer_handler_state_save()

void timer_handler_state_save ( struct t_mympd_state * mympd_state)
static

Timer handler for timer_id TIMER_ID_STATE_SAVE

Parameters
mympd_statePointer to mympd_state

◆ timer_handler_webradiodb_update()

void timer_handler_webradiodb_update ( void )
static

Timer handler for timer_id TIMER_ID_WEBRADIODB_UPDATE