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

myMPD home screen API More...

#include "dist/sds/sds.h"
#include "src/lib/list.h"
#include <stdbool.h>
Include dependency graph for home.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  home_type { HOME_ICON , HOME_WIDGET_SCRIPT , HOME_WIDGET_IFRAME }
 

Functions

bool mympd_api_home_icon_move (struct t_list *home_list, unsigned from, unsigned to)
 
bool mympd_api_home_icon_delete (struct t_list *home_list, unsigned pos)
 
bool mympd_api_home_icon_save (struct t_list *home_list, bool replace, unsigned oldpos, sds name, sds ligature, sds bgcolor, sds color, sds image, sds cmd, struct t_list *option_list)
 
bool mympd_api_home_widget_save (struct t_list *home_list, bool replace, unsigned oldpos, enum home_type type, sds name, unsigned refresh, sds size, sds ref, struct t_list *arguments)
 
sds mympd_api_home_icon_list (struct t_list *home_list, sds buffer, unsigned request_id)
 
sds mympd_api_home_icon_get (struct t_list *home_list, sds buffer, unsigned request_id, unsigned pos)
 
bool mympd_api_home_file_read (struct t_list *home_list, sds workdir)
 
bool mympd_api_home_file_save (struct t_list *home_list, sds workdir)
 

Detailed Description

myMPD home screen API

Enumeration Type Documentation

◆ home_type

enum home_type

Home widget types

Function Documentation

◆ mympd_api_home_file_read()

bool mympd_api_home_file_read ( struct t_list home_list,
sds  workdir 
)

Reads the home icons from the filesystem

Parameters
home_listpointer to home list
workdirworking directory
Returns
true on success, else false

◆ mympd_api_home_file_save()

bool mympd_api_home_file_save ( struct t_list home_list,
sds  workdir 
)

Writes the home icons to the filesystem

Parameters
home_listpointer to home list
workdirworking directory
Returns
true on success, else false

◆ mympd_api_home_icon_delete()

bool mympd_api_home_icon_delete ( struct t_list home_list,
unsigned  pos 
)

Deletes a home icon in the list

Parameters
home_listpointer to home list
posposition to remove
Returns
true on success, else false

◆ mympd_api_home_icon_get()

sds mympd_api_home_icon_get ( struct t_list home_list,
sds  buffer,
unsigned  request_id,
unsigned  pos 
)

Returns a jsonrpc response with the home icon details

Parameters
home_listpointer to home list
bufferbuffer to append the response
request_idjsonrpc request id
posposition of the home icon to get
Returns
pointer to buffer

◆ mympd_api_home_icon_list()

sds mympd_api_home_icon_list ( struct t_list home_list,
sds  buffer,
unsigned  request_id 
)

Returns a jsonrpc response with all home icons

Parameters
home_listpointer to home list
bufferbuffer to append the response
request_idjsonrpc request id
Returns
pointer to buffer

◆ mympd_api_home_icon_move()

bool mympd_api_home_icon_move ( struct t_list home_list,
unsigned  from,
unsigned  to 
)

Moves a home icon in the list

Parameters
home_listpointer to home list
fromfrom pos
toto pos
Returns
true on success, else false

◆ mympd_api_home_icon_save()

bool mympd_api_home_icon_save ( struct t_list home_list,
bool  replace,
unsigned  oldpos,
sds  name,
sds  ligature,
sds  bgcolor,
sds  color,
sds  image,
sds  cmd,
struct t_list option_list 
)

Adds/replaces a home icon in the list

Parameters
home_listpointer to home list
replacetrue to replace the icon at oldpos
oldposoriginal pos of the icon
namename
ligatureligature
bgcolorbackground color
colorcolor
imageimage
cmdcommand
option_listoptions for the command
Returns
true on success, else false

◆ mympd_api_home_widget_save()

bool mympd_api_home_widget_save ( struct t_list home_list,
bool  replace,
unsigned  oldpos,
enum home_type  type,
sds  name,
unsigned  refresh,
sds  size,
sds  ref,
struct t_list arguments 
)

Adds/replaces a home widget in the list

Parameters
home_listPointer to home list
replaceReplace the icon at oldpos?
oldposOriginal pos of the widget
typeType of the home widget
nameWidget name
refreshRefresh interval
sizeWidget size
refName of script or link for iframe
argumentsScript arguments
Returns
true on success, else false