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

MPD partitions specific functions. More...

#include "compile_time.h"
#include "src/mympd_client/partitions.h"
#include "src/lib/config/mympd_state.h"
#include "src/lib/config/partition_state.h"
#include "src/lib/last_played.h"
#include "src/lib/log.h"
#include "src/lib/mem.h"
#include "src/lib/sds/sds_extras.h"
#include "src/lib/signal.h"
#include "src/lib/timer.h"
#include "src/mympd_api/settings.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/database.h"
#include "src/mympd_client/errorhandler.h"
#include "src/mympd_client/features.h"
#include "src/mympd_client/jukebox.h"
#include <string.h>
Include dependency graph for partitions.c:

Functions

static bool partitions_check (struct t_mympd_state *mympd_state, const char *name)
static void partitions_add (struct t_mympd_state *mympd_state, const char *name)
bool partitions_connect (struct t_mympd_state *mympd_state, struct t_partition_state *partition_state)
struct t_partition_statepartitions_get_by_name (struct t_mympd_state *mympd_state, const char *name)
void partitions_list_clear (struct t_mympd_state *mympd_state)
bool partitions_populate (struct t_mympd_state *mympd_state)

Detailed Description

MPD partitions specific functions.

Function Documentation

◆ partitions_add()

void partitions_add ( struct t_mympd_state * mympd_state,
const char * name )
static

Adds a partition to the partition list

Parameters
mympd_statepointer to t_mympd_state struct
namepartition name

◆ partitions_check()

bool partitions_check ( struct t_mympd_state * mympd_state,
const char * name )
static

Checks if the partition is already in the list

Parameters
mympd_statepointer to t_mympd_state struct
namepartition name
Returns
true if partition is in the list, else false

◆ partitions_connect()

bool partitions_connect ( struct t_mympd_state * mympd_state,
struct t_partition_state * partition_state )

Connects to MPD and switches to the defined partition

Parameters
mympd_statePointer to mympd_state
partition_statePointer to partition state
Returns
true on success, else false

◆ partitions_get_by_name()

struct t_partition_state * partitions_get_by_name ( struct t_mympd_state * mympd_state,
const char * name )

Get the partition state struct by partition name

Parameters
mympd_statepointer to central myMPD state
namempd partition name
Returns
pointer to partition_state, NULL if partition is not found

◆ partitions_list_clear()

void partitions_list_clear ( struct t_mympd_state * mympd_state)

Removes all but default partition from the list

Parameters
mympd_statepointer to central myMPD state

◆ partitions_populate()

bool partitions_populate ( struct t_mympd_state * mympd_state)

Populates the partition list: removes and adds partitions according to mpd

Parameters
mympd_statepointer to t_mympd_state struct
Returns
true on success, else false