| libmpd-database.h | | libmpd-database.h | |
| | | | |
| skipping to change at line 68 | | skipping to change at line 68 | |
| *@param mi A #MpdObj | | *@param mi A #MpdObj | |
| *@param path The path mpd should update. | | *@param path The path mpd should update. | |
| * | | * | |
| * Force mpd to update (parts of )the database. | | * Force mpd to update (parts of )the database. | |
| * | | * | |
| * @returns a #MpdError | | * @returns a #MpdError | |
| */ | | */ | |
| int mpd_database_update_dir (MpdObj *mi, char *path); | | int mpd_database_update_dir (MpdObj *mi, char *path); | |
| | | | |
| /** | | /** | |
|
| * @param mi A #MpdObj | | | |
| * @param string The search string | | | |
| * | | | |
| * client side search function with best "match" option.. | | | |
| * It splits the search string into tokens. (on the ' ') every token is th | | | |
| en matched using regex. | | | |
| * It not tokenize between [()]. | | | |
| * | | | |
| * So f.e. Murder Hooker|Davis matches songs where title/filename/artist/a | | | |
| lbum contains murder and hooker or murder and davis in any order. | | | |
| * | | | |
| * Warning: This function can be slow. | | | |
| * | | | |
| * @returns a #MpdData list | | | |
| */ | | | |
| MpdData * mpd_database_token_find (MpdObj *mi , char *string); | | | |
| | | | |
| /** | | | |
| * @param mi A #MpdObj | | | |
| * @param path path of the playlist | | | |
| * | | | |
| * Deletes a playlist. | | | |
| * @returns | | | |
| */ | | | |
| | | | |
| int mpd_database_delete_playlist(MpdObj *mi,char *path); | | | |
| | | | |
| /** | | | |
| * @param mi a #MpdObj | | | |
| * @param name The name of the playlist | | | |
| * | | | |
| * Saves the current playlist to a file. | | | |
| * | | | |
| * @returns a #MpdError. #MPD_OK if succesfull, | | | |
| * #MPD_DATABASE_PLAYLIST_EXIST when the playlist allready exists. | | | |
| */ | | | |
| int mpd_database_save_playlist (MpdObj *mi, | | | |
| char *name); | | | |
| | | | |
| /** | | | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
| * @param table table | | * @param table table | |
| * @param string string to search for | | * @param string string to search for | |
| * @param exact if #TRUE only return exact matches | | * @param exact if #TRUE only return exact matches | |
| * WARNING: This function is deprecated, use mpd_database_search_start | | * WARNING: This function is deprecated, use mpd_database_search_start | |
| * @returns a #MpdData list | | * @returns a #MpdData list | |
| */ | | */ | |
| MpdData * mpd_database_find(MpdObj *mi, int table, char *string, int exact)
; | | MpdData * mpd_database_find(MpdObj *mi, int table, char *string, int exact)
; | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 126 | | skipping to change at line 89 | |
| * @param path a NULL terminated path string | | * @param path a NULL terminated path string | |
| * | | * | |
| * Gets the contents of a directory, it can return songs, directories and p
laylists | | * Gets the contents of a directory, it can return songs, directories and p
laylists | |
| * | | * | |
| * @returns a #MpdData list with songs, directories and playlists | | * @returns a #MpdData list with songs, directories and playlists | |
| */ | | */ | |
| MpdData * mpd_database_get_directory(MpdObj *mi,char *path); | | MpdData * mpd_database_get_directory(MpdObj *mi,char *path); | |
| | | | |
| /** | | /** | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
|
| * @param playlist the playlist you need the content off. | | * @param path a string containing the path | |
| * | | * | |
|
| * Only works with patched mpd. | | * Recursively list all the songs directory path | |
| * Check for %mpd_server_command_allowed(mi, "listPlaylistInfo"); | | | |
| * | | * | |
|
| * @returns a #MpdData list | | * returns a #MpdData | |
| */ | | */ | |
|
| MpdData *mpd_database_get_playlist_content(MpdObj *mi,char *playlist); | | MpdData * mpd_database_get_directory_recursive(MpdObj *mi, const char *path | |
| | | ); | |
| /*@}*/ | | | |
| | | | |
|
| /** \defgroup advsearch Database Advanced Search | | | |
| * \ingroup database | | | |
| * The following functions provide an interface to the improved search capa | | | |
| bilities of mpd 0.12.0. | | | |
| */ | | | |
| /*@{*/ | | | |
| /** | | /** | |
| * @param mi A #MpdObj | | * @param mi A #MpdObj | |
| * @param path an Path to a file | | * @param path an Path to a file | |
| * | | * | |
| * Grabs the song info for a single file. Make sure you pass an url to a so
ng | | * Grabs the song info for a single file. Make sure you pass an url to a so
ng | |
| * and not a directory, that might result in strange behauviour. | | * and not a directory, that might result in strange behauviour. | |
| * | | * | |
| * @returns a #mpd_Song | | * @returns a #mpd_Song | |
| */ | | */ | |
| mpd_Song * mpd_database_get_fileinfo(MpdObj *mi,const char *path); | | mpd_Song * mpd_database_get_fileinfo(MpdObj *mi,const char *path); | |
| | | | |
|
| | | /*@}*/ | |
| | | | |
| | | /** \defgroup advsearch Database Advanced Search | |
| | | * \ingroup database | |
| | | * The following functions provide an interface to the improved search capa | |
| | | bilities of mpd 0.12.0. | |
| | | */ | |
| | | /*@{*/ | |
| | | | |
| /** | | /** | |
| * @param mi A #MpdObj | | * @param mi A #MpdObj | |
| * @param field A #mpd_TagItems | | * @param field A #mpd_TagItems | |
| * @param value a string that %field needs to match | | * @param value a string that %field needs to match | |
| * | | * | |
| * Adds a constraint to the search | | * Adds a constraint to the search | |
| */ | | */ | |
| void mpd_database_search_add_constraint(MpdObj *mi, mpd_TagItems field, con
st char *value); | | void mpd_database_search_add_constraint(MpdObj *mi, mpd_TagItems field, con
st char *value); | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 221 | | skipping to change at line 184 | |
| /** | | /** | |
| * @param mi A #MpdObj | | * @param mi A #MpdObj | |
| * | | * | |
| * Commits the search and gathers the result in a #MpdData list. | | * Commits the search and gathers the result in a #MpdData list. | |
| * | | * | |
| * @returns a #MpdData list with the search result,or NULL when nothing is
found | | * @returns a #MpdData list with the search result,or NULL when nothing is
found | |
| */ | | */ | |
| MpdData * mpd_database_search_commit(MpdObj *mi); | | MpdData * mpd_database_search_commit(MpdObj *mi); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
|
| | | /** \defgroup databaseSearchStats Database Search Statistics | |
| | | * \ingroup database | |
| | | * A extention to the database search, that instead of returning the full r | |
| | | esults. | |
| | | * Only reports back a few statistics about the result. | |
| | | * For now Number of Songs are reported and total playtime. | |
| | | */ | |
| | | /*@{*/ | |
| | | | |
|
| /** \defgroup searchdeprecated Deprecated database search functions | | /*! \var typedef mpd_SearchStat MpdDBStats | |
| | | \brief A Structure containing numberOfSongs and playTime | |
| | | | |
| | | see #mpd_SearchStats | |
| | | */ | |
| | | | |
| | | typedef mpd_SearchStats MpdDBStats; | |
| | | | |
| | | /** | |
| | | * @param mi A #MpdObj | |
| | | * | |
| | | * Starts a search, you can add constraints by calling #mpd_database_search | |
| | | _add_constraint. | |
| | | * To get the result call #mpd_database_search_stats_commit | |
| | | * | |
| | | * This function requires mpd 0.13.0 or higher | |
| | | */ | |
| | | | |
| | | void mpd_database_search_stats_start(MpdObj *mi); | |
| | | | |
| | | /** | |
| | | * @param mi A #MpdObj | |
| | | * | |
| | | * Gets statistics results of a search. | |
| | | * | |
| | | * return a #MpdDBStats | |
| | | */ | |
| | | MpdDBStats * mpd_database_search_stats_commit(MpdObj *mi); | |
| | | | |
| | | /** | |
| | | * @param data a #MpdDBStats | |
| | | * | |
| | | * free's the #MpdDBStats structure. | |
| | | */ | |
| | | void mpd_database_search_free_stats(MpdDBStats *data); | |
| | | | |
| | | /*@}*/ | |
| | | | |
| | | /** \defgroup databasePlaylist Database Playlist | |
| * \ingroup database | | * \ingroup database | |
|
| * The following functions are deprecated | | | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
|
| | | | |
| | | /** | |
| | | * @param mi A #MpdObj | |
| | | * @param path path of the playlist | |
| | | * | |
| | | * Deletes a playlist. | |
| | | * @returns | |
| | | */ | |
| | | | |
| | | int mpd_database_delete_playlist(MpdObj *mi,char *path); | |
| | | | |
| /** | | /** | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
|
| * @param field The table field | | * @param name The name of the playlist | |
| * @returns a #MpdData | | * | |
| | | * Saves the current playlist to a file. | |
| | | * | |
| | | * @returns a #MpdError. #MPD_OK if succesfull, | |
| | | * #MPD_DATABASE_PLAYLIST_EXIST when the playlist allready exists. | |
| */ | | */ | |
|
| MpdData * mpd_database_get_unique_tags (MpdObj *mi, int fie | | int mpd_database_save_playlist (MpdObj *mi, | |
| ld,...) __attribute__((deprecated)); | | char *name); | |
| | | | |
| /** | | /** | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
|
| * @param exact 1 for exact search 0 for fuzzy | | * @param playlist the playlist you need the content off. | |
| * | | * | |
|
| * WARNING: This function is deprecated, use mpd_database_search_start | | * Needs mpd 0.12.0 or higher. | |
| * @returns a #MpdData | | * | |
| | | * @returns a #MpdData list | |
| */ | | */ | |
|
| MpdData * mpd_database_find_adv (MpdObj *mi,int exact, ...) | | MpdData *mpd_database_get_playlist_content(MpdObj *mi,char *playlist); | |
| __attribute__((deprecated)); | | | |
| /*@}*/ | | | |
| | | | |
|
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param path a string contains the path of the playlist | |
| | | * @param file a string contains the path of the song to add | |
| | | * | |
| | | * Add a path to a stored playlist. | |
| | | * Needs 0.13.0 | |
| | | */ | |
| | | void mpd_database_playlist_list_add(MpdObj *mi, const char *path, const cha | |
| | | r *file); | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param path a string contains the path of the playlist | |
| | | * @param pos a int representing the position of a song | |
| | | * | |
| | | * Deletes the song at position pos from a playlist. | |
| | | * Needs mpd 0.13.0 | |
| | | * | |
| | | */ | |
| | | void mpd_database_playlist_list_delete(MpdObj *mi, const char *path, int po | |
| | | s); | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param path a string contains the path of the playlist | |
| | | * | |
| | | * Clears the content of a stored playlist, also used to create an empty pl | |
| | | aylist | |
| | | * Needs mpd 0.13.0 | |
| | | */ | |
| | | void mpd_database_playlist_clear(MpdObj *mi,const char *path); | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param old a string, old playlist name | |
| | | * @param new a string, new playlist name | |
| | | * | |
| | | * Renames a stored playlist | |
| | | * Needs mpd 0.13.0 | |
| | | */ | |
| | | void mpd_database_playlist_rename(MpdObj *mi, const char *old, const char * | |
| | | c_new); | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param playlist a string contains the path of the playlist | |
| | | * @param old_pos integer representing old position | |
| | | * @param new_pos integer representing the position to move old_pos to. | |
| | | * | |
| | | * Moves songs in a stored playlists | |
| | | * Needs mpd 0.13.0 | |
| | | */ | |
| | | int mpd_database_playlist_move(MpdObj *mi, const char *playlist, int old_po | |
| | | s, int new_pos); | |
| | | /*@}*/ | |
| #endif | | #endif | |
| | | | |
End of changes. 17 change blocks. |
| 65 lines changed or deleted | | 142 lines changed or added | |
|
| libmpd-internal.h | | libmpd-internal.h | |
| #ifndef __MPD_INTERNAL_LIB_ | | #ifndef __MPD_INTERNAL_LIB_ | |
| #define __MPD_INTERNAL_LIB_ | | #define __MPD_INTERNAL_LIB_ | |
| | | | |
| #include "libmpdclient.h" | | #include "libmpdclient.h" | |
| struct _MpdData_real; | | struct _MpdData_real; | |
|
| struct _MpdDataPool; | | | |
| | | | |
| typedef struct _MpdData_head { | | | |
| struct _MpdData_real *first; | | | |
| struct _MpdDataPool *pool; | | | |
| struct _MpdDataPool *current; | | | |
| } MpdData_head; | | | |
| | | | |
| typedef struct _MpdData_real { | | typedef struct _MpdData_real { | |
| /* MpdDataType */ | | /* MpdDataType */ | |
| MpdDataType type; | | MpdDataType type; | |
| | | | |
| union { | | union { | |
| struct { | | struct { | |
| int tag_type; | | int tag_type; | |
| char *tag; | | char *tag; | |
| }; | | }; | |
| char *directory; | | char *directory; | |
| char *playlist; /*is a path*/ | | char *playlist; /*is a path*/ | |
| mpd_Song *song; | | mpd_Song *song; | |
| mpd_OutputEntity *output_dev; /* from devices */ | | mpd_OutputEntity *output_dev; /* from devices */ | |
| }; | | }; | |
| struct _MpdData_real *next; | | struct _MpdData_real *next; | |
| /* Previous MpdData in the list */ | | /* Previous MpdData in the list */ | |
| struct _MpdData_real *prev; | | struct _MpdData_real *prev; | |
|
| /* First MpdData in the list */ | | struct _MpdData_real *first; | |
| MpdData_head *head; | | | |
| }MpdData_real; | | }MpdData_real; | |
| | | | |
|
| #define MPD_DATA_POOL_SIZE 256 | | | |
| typedef struct _MpdDataPool { | | | |
| MpdData_real pool[MPD_DATA_POOL_SIZE]; | | | |
| unsigned int space_left; | | | |
| struct _MpdDataPool *next; | | | |
| } MpdDataPool; | | | |
| | | | |
| /* queue struct */ | | /* queue struct */ | |
| typedef struct _MpdQueue MpdQueue; | | typedef struct _MpdQueue MpdQueue; | |
| typedef struct _MpdServerState { | | typedef struct _MpdServerState { | |
| /* information needed to detect changes on mpd's side */ | | /* information needed to detect changes on mpd's side */ | |
|
| long long playlistid; | | long long playlistid; | |
| int songid; | | long long queueid; | |
| int songpos; | | long long storedplaylistid; | |
| int state; | | int songid; | |
| | | int songpos; | |
| | | int state; | |
| unsigned long dbUpdateTime; | | unsigned long dbUpdateTime; | |
|
| int updatingDb; | | int updatingDb; | |
| int random; | | int random; | |
| int repeat; | | int repeat; | |
| int volume; | | int volume; | |
| int xfade; | | int xfade; | |
| int totaltime; | | int totaltime; | |
| int elapsedtime; | | int elapsedtime; | |
| int bitrate; | | int bitrate; | |
| unsigned int samplerate; | | unsigned int samplerate; | |
|
| int bits; | | int bits; | |
| int channels; | | int channels; | |
| | | unsigned long playlistLength; | |
| | | char error[512]; | |
| } MpdServerState; | | } MpdServerState; | |
| | | | |
| /* command struct */ | | /* command struct */ | |
| /* internal use only */ | | /* internal use only */ | |
| typedef struct _MpdCommand { | | typedef struct _MpdCommand { | |
| char *command_name; | | char *command_name; | |
| int enabled; | | int enabled; | |
| } MpdCommand; | | } MpdCommand; | |
| | | | |
| typedef struct _MpdObj { | | typedef struct _MpdObj { | |
| | | | |
| skipping to change at line 131 | | skipping to change at line 120 | |
| */ | | */ | |
| int search_type; | | int search_type; | |
| int search_field; | | int search_field; | |
| }_MpdObj; | | }_MpdObj; | |
| | | | |
| typedef enum MpdQueueType { | | typedef enum MpdQueueType { | |
| MPD_QUEUE_ADD, | | MPD_QUEUE_ADD, | |
| MPD_QUEUE_LOAD, | | MPD_QUEUE_LOAD, | |
| MPD_QUEUE_DELETE_ID, | | MPD_QUEUE_DELETE_ID, | |
| MPD_QUEUE_DELETE_POS, | | MPD_QUEUE_DELETE_POS, | |
|
| MPD_QUEUE_COMMAND /* abuse!!! */ | | MPD_QUEUE_COMMAND, /* abuse!!! */ | |
| | | MPD_QUEUE_MPD_QUEUE_ADD, | |
| | | MPD_QUEUE_MPD_QUEUE_REMOVE | |
| } MpdQueueType; | | } MpdQueueType; | |
| | | | |
| typedef struct _MpdQueue { | | typedef struct _MpdQueue { | |
| struct _MpdQueue *next; | | struct _MpdQueue *next; | |
| struct _MpdQueue *prev; | | struct _MpdQueue *prev; | |
| struct _MpdQueue *first; | | struct _MpdQueue *first; | |
| | | | |
| /* what item to queue, (add/load/remove)*/ | | /* what item to queue, (add/load/remove)*/ | |
| int type; | | int type; | |
| /* for adding files/load playlist/adding streams */ | | /* for adding files/load playlist/adding streams */ | |
| char *path; | | char *path; | |
| /* for removing */ | | /* for removing */ | |
| int id; | | int id; | |
| }_MpdQueue; | | }_MpdQueue; | |
| | | | |
| /* Internal Queue struct functions */ | | /* Internal Queue struct functions */ | |
| MpdQueue * mpd_new_queue_struct (); | | MpdQueue * mpd_new_queue_struct (); | |
| void mpd_queue_get_next (MpdObj *mi); | | void mpd_queue_get_next (MpdObj *mi); | |
| | | | |
| /* Internal Data struct functions */ | | /* Internal Data struct functions */ | |
|
| inline MpdData * mpd_new_data_struct (MpdData_hea | | inline MpdData * mpd_new_data_struct (void); | |
| d * const head); | | inline MpdData * mpd_new_data_struct_append (MpdData * d | |
| inline MpdData * mpd_new_data_struct_append (MpdData * c | | ata); | |
| onst data); | | | |
| inline MpdData_head * mpd_data_get_head (MpdData con | | | |
| st * const data); | | | |
| inline MpdData * mpd_data_concatenate (MpdData * c
onst first, MpdData * const second); | | inline MpdData * mpd_data_concatenate (MpdData * c
onst first, MpdData * const second); | |
| inline MpdData * mpd_data_get_next_real (MpdData * c
onst data, int kill_list); | | inline MpdData * mpd_data_get_next_real (MpdData * c
onst data, int kill_list); | |
| /* more internal stuff*/ | | /* more internal stuff*/ | |
| | | | |
| /** | | /** | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
| * | | * | |
| * Checks if mpd_stats is availible, and updates when needed. | | * Checks if mpd_stats is availible, and updates when needed. | |
| * | | * | |
| * @returns a #MpdError | | * @returns a #MpdError | |
| | | | |
| skipping to change at line 184 | | skipping to change at line 174 | |
| char * strndup (const char
*s, size_t n); | | char * strndup (const char
*s, size_t n); | |
| #endif | | #endif | |
| | | | |
| int mpd_server_get_allowed_commands(MpdObj *mi); | | int mpd_server_get_allowed_commands(MpdObj *mi); | |
| typedef enum _MpdSearchType { | | typedef enum _MpdSearchType { | |
| MPD_SEARCH_TYPE_NONE, | | MPD_SEARCH_TYPE_NONE, | |
| MPD_SEARCH_TYPE_FIND, | | MPD_SEARCH_TYPE_FIND, | |
| MPD_SEARCH_TYPE_SEARCH, | | MPD_SEARCH_TYPE_SEARCH, | |
| MPD_SEARCH_TYPE_LIST, | | MPD_SEARCH_TYPE_LIST, | |
| MPD_SEARCH_TYPE_PLAYLIST_FIND, | | MPD_SEARCH_TYPE_PLAYLIST_FIND, | |
|
| MPD_SEARCH_TYPE_PLAYLIST_SEARCH | | MPD_SEARCH_TYPE_PLAYLIST_SEARCH, | |
| | | MPD_SEARCH_TYPE_STATS | |
| }MpdSearchType; | | }MpdSearchType; | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 38 lines changed or deleted | | 27 lines changed or added | |
|
| libmpd-playlist.h | | libmpd-playlist.h | |
| | | | |
| skipping to change at line 248 | | skipping to change at line 248 | |
| | | | |
| /** | | /** | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
| * | | * | |
| * Commits the queue'd commands in a command list. This is an efficient way
of doing alot of add's/removes. | | * Commits the queue'd commands in a command list. This is an efficient way
of doing alot of add's/removes. | |
| * | | * | |
| * @returns a #MpdError | | * @returns a #MpdError | |
| */ | | */ | |
| int mpd_playlist_queue_commit (MpdObj *mi); | | int mpd_playlist_queue_commit (MpdObj *mi); | |
| | | | |
|
| | | /*@}*/ | |
| | | | |
| | | /** \defgroup playlistsearch Playlist Search | |
| | | * \ingroup Playlist | |
| | | * Allow server side search of the current playlist. | |
| | | */ | |
| | | /*@{*/ | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param exact if #TRUE only return exact matches | |
| | | * | |
| | | * Starts a playlist search. Add constraints using #mpd_playlist_search_add | |
| | | _constraint | |
| | | * And execute the search with #mpd_playlist_search_commit | |
| | | * | |
| | | */ | |
| | | void mpd_playlist_search_start(MpdObj *mi, int exact); | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * | |
| | | * Executes the playlist search. This needs to be started with #mpd_playlis | |
| | | t_search_start | |
| | | * | |
| | | * @returns a #MpdData list | |
| | | */ | |
| MpdData * mpd_playlist_search_commit(MpdObj *mi); | | MpdData * mpd_playlist_search_commit(MpdObj *mi); | |
| | | | |
|
| | | /** | |
| | | * @param mi A #MpdObj | |
| | | * @param field A #mpd_TagItems | |
| | | * @param value a string to match the field against | |
| | | * | |
| | | * Adds a constraint to the playlist search. | |
| | | */ | |
| void mpd_playlist_search_add_constraint(MpdObj *mi, mpd_TagItems field, con
st char *value); | | void mpd_playlist_search_add_constraint(MpdObj *mi, mpd_TagItems field, con
st char *value); | |
| | | | |
|
| void mpd_playlist_search_start(MpdObj *mi, int exact); | | /*@}*/ | |
| | | | |
| | | /** \defgroup playlistqueue Playlist Queue | |
| | | * \ingroup Playlist | |
| | | * Allow control of MPD new queue system | |
| | | */ | |
| | | /*@{*/ | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * | |
| | | * Lists the playlist queue of mpd | |
| | | * | |
| | | * @returns a #MpdData list | |
| | | */ | |
| | | MpdData *mpd_playlist_get_mpd_queue(MpdObj *mi); | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param songid the id of the song to add | |
| | | * | |
| | | * Add the song from the playlist with id id. | |
| | | * | |
| | | * @returns a #MpdError | |
| | | */ | |
| | | int mpd_playlist_mpd_queue_add(MpdObj *mi, int songid); | |
| | | | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param songpos the pos of the song to remove | |
| | | * | |
| | | * Removes the song from the queue at position pos | |
| | | * | |
| | | * @returns a #MpdError | |
| | | */ | |
| | | int mpd_playlist_mpd_queue_remove(MpdObj *mi, int songpos); | |
| | | | |
|
| | | /** | |
| | | * | |
| | | * @param mi a #MpdObj | |
| | | * @param id Add the song with id to the queue | |
| | | * | |
| | | * This only queues the add, use #mpd_playlist_queue_commit to actually com | |
| | | mit it. | |
| | | * | |
| | | * @returns a #MpdError | |
| | | */ | |
| | | int mpd_playlist_queue_mpd_queue_add(MpdObj *mi,int id); | |
| | | /** | |
| | | * @param mi a #MpdObj | |
| | | * @param pos the pos of the song to remove | |
| | | * | |
| | | * This only queues the remove, use #mpd_playlist_queue_commit to actually | |
| | | commit it. | |
| | | * | |
| | | * @returns a #MpdError | |
| | | */ | |
| | | int mpd_playlist_queue_mpd_queue_remove(MpdObj *mi,int pos); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 91 lines changed or added | |
|
| libmpd.h | | libmpd.h | |
| | | | |
| skipping to change at line 140 | | skipping to change at line 140 | |
| | | | |
| /** | | /** | |
| * \ingroup #MpdData | | * \ingroup #MpdData | |
| * A fast linked list that is used to pass data from libmpd to the client. | | * A fast linked list that is used to pass data from libmpd to the client. | |
| */ | | */ | |
| typedef struct _MpdData { | | typedef struct _MpdData { | |
| /** a #MpdDataType */ | | /** a #MpdDataType */ | |
| MpdDataType type; | | MpdDataType type; | |
| union { | | union { | |
| struct { | | struct { | |
|
| /** a #mpd_TagType defining what #tag contains */ | | /** a #mpd_TagItems defining what #tag contains */ | |
| int tag_type; | | int tag_type; | |
| /** a string containing the tag*/ | | /** a string containing the tag*/ | |
| char *tag; | | char *tag; | |
| }; | | }; | |
| /** a directory */ | | /** a directory */ | |
| char *directory; | | char *directory; | |
| /** a path to a playlist */ | | /** a path to a playlist */ | |
| char *playlist; | | char *playlist; | |
| /** a mpd_Song */ | | /** a mpd_Song */ | |
| mpd_Song *song; | | mpd_Song *song; | |
| | | | |
| skipping to change at line 240 | | skipping to change at line 240 | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
| * @param timeout: A timeout (in seconds) | | * @param timeout: A timeout (in seconds) | |
| * | | * | |
| * Set the timeout of the connection. | | * Set the timeout of the connection. | |
| * If allready connected the timeout of the running connection | | * If allready connected the timeout of the running connection | |
| * | | * | |
| * @returns a #MpdError. (MPD_OK if everything went ok) | | * @returns a #MpdError. (MPD_OK if everything went ok) | |
| */ | | */ | |
| int mpd_set_connection_timeout(MpdObj * mi, float timeout); | | int mpd_set_connection_timeout(MpdObj * mi, float timeout); | |
| | | | |
|
| | | int mpd_connect_real(MpdObj *mi,mpd_Connection *connection); | |
| /** | | /** | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
| * | | * | |
| * Connect to the mpd daemon. | | * Connect to the mpd daemon. | |
| * Warning: mpd_connect connects anonymous, to authentificate use #mpd_send
_password | | * Warning: mpd_connect connects anonymous, to authentificate use #mpd_send
_password | |
| * | | * | |
| * @returns returns a #MpdError, MPD_OK when successful | | * @returns returns a #MpdError, MPD_OK when successful | |
| */ | | */ | |
| int mpd_connect(MpdObj * mi); | | int mpd_connect(MpdObj * mi); | |
| | | | |
| | | | |
| skipping to change at line 347 | | skipping to change at line 348 | |
| MPD_CST_REPEAT = 0x0400, | | MPD_CST_REPEAT = 0x0400, | |
| /** Not implemented */ | | /** Not implemented */ | |
| MPD_CST_AUDIO = 0x0800, | | MPD_CST_AUDIO = 0x0800, | |
| /** The state of the player has changed.*/ | | /** The state of the player has changed.*/ | |
| MPD_CST_STATE = 0x1000, | | MPD_CST_STATE = 0x1000, | |
| /** The permissions the client has, has changed.*/ | | /** The permissions the client has, has changed.*/ | |
| MPD_CST_PERMISSION = 0x2000, | | MPD_CST_PERMISSION = 0x2000, | |
| /** The bitrate of the playing song has changed. */ | | /** The bitrate of the playing song has changed. */ | |
| MPD_CST_BITRATE = 0x4000, | | MPD_CST_BITRATE = 0x4000, | |
| /** the audio format of the playing song changed.*/ | | /** the audio format of the playing song changed.*/ | |
|
| MPD_CST_AUDIOFORMAT = 0x8000 | | MPD_CST_AUDIOFORMAT = 0x8000, | |
| | | /** the queue has changed */ | |
| | | MPD_CST_QUEUE = 0x10000, | |
| | | /** the queue has changed */ | |
| | | MPD_CST_STORED_PLAYLIST = 0x20000, | |
| | | /** server error */ | |
| | | MPD_CST_SERVER_ERROR = 0x30000 | |
| } ChangedStatusType; | | } ChangedStatusType; | |
| | | | |
| /* callback typedef's */ | | /* callback typedef's */ | |
| /** | | /** | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
| * @param what a #ChangedStatusType that determines what changed triggered
the signal. This is a bitmask. | | * @param what a #ChangedStatusType that determines what changed triggered
the signal. This is a bitmask. | |
| * @param userdata user data set when the signal handler was connected. | | * @param userdata user data set when the signal handler was connected. | |
| * | | * | |
| * Signal that get's called when the state of mpd changed. Look #ChangedSta
tusType to see the possible events. | | * Signal that get's called when the state of mpd changed. Look #ChangedSta
tusType to see the possible events. | |
| */ | | */ | |
| | | | |
| skipping to change at line 526 | | skipping to change at line 533 | |
| /** | | /** | |
| * @param mi a #MpdObj | | * @param mi a #MpdObj | |
| * @param command the command to check | | * @param command the command to check | |
| * | | * | |
| * Checks if the user is allowed to execute the command and if the server s
upports it | | * Checks if the user is allowed to execute the command and if the server s
upports it | |
| * | | * | |
| * @returns Returns #MpdServerCommand | | * @returns Returns #MpdServerCommand | |
| */ | | */ | |
| int mpd_server_check_command_allowed(MpdObj * mi, const char *command); | | int mpd_server_check_command_allowed(MpdObj * mi, const char *command); | |
| | | | |
|
| /*@}*/ | | | |
| | | | |
| /** \defgroup Misc Misc | | | |
| * Helper functions. | | | |
| */ | | | |
| /*@{*/ | | | |
| | | | |
| /** | | /** | |
|
| * @param string A NULL terminated string | | * @param mi a #MpdObj | |
| * | | | |
| * Splits a string in tokens while keeping ()[] in tact. | | | |
| * This can be used to match a string tokenized | | | |
| * and with regex support agains a user defined string. | | | |
| * | | * | |
|
| * @returns An array of regex patterns | | * @returns an array with urlhandlers (NULL terminated). Result must be fre
e-ed. | |
| */ | | */ | |
|
| regex_t **mpd_misc_tokenize(char *string); | | char ** mpd_server_get_url_handlers(MpdObj *mi); | |
| | | | |
| /** | | /** | |
|
| * @param tokens an array of regex patterns. | | * @param mi a #MpdObj | |
| * | | * | |
|
| * Free's a list of regex patterns | | * @returns an array with supported tag types. (NULL Terminated). Result mu
st be free-ed. | |
| */ | | */ | |
|
| void mpd_misc_tokens_free(regex_t ** tokens); | | | |
| | | char ** mpd_server_get_tag_types(MpdObj *mi); | |
| | | /*@}*/ | |
| | | | |
| | | /** \defgroup Misc Misc | |
| | | * Helper functions. | |
| | | */ | |
| | | /*@{*/ | |
| | | | |
| /** | | /** | |
| * @param name a NULL terminated string | | * @param name a NULL terminated string | |
| * | | * | |
| * gets the Matching #MpdDataType matching at the string | | * gets the Matching #MpdDataType matching at the string | |
| * | | * | |
| * @returns a #MpdDataType | | * @returns a #MpdDataType | |
| */ | | */ | |
| int mpd_misc_get_tag_by_name(char *name); | | int mpd_misc_get_tag_by_name(char *name); | |
| | | | |
| | | | |
End of changes. 10 change blocks. |
| 19 lines changed or deleted | | 22 lines changed or added | |
|
| libmpdclient.h | | libmpdclient.h | |
| | | | |
| skipping to change at line 176 | | skipping to change at line 176 | |
| /* 0-100, or MPD_STATUS_NO_VOLUME when there is no volume support */ | | /* 0-100, or MPD_STATUS_NO_VOLUME when there is no volume support */ | |
| int volume; | | int volume; | |
| /* 1 if repeat is on, 0 otherwise */ | | /* 1 if repeat is on, 0 otherwise */ | |
| int repeat; | | int repeat; | |
| /* 1 if random is on, 0 otherwise */ | | /* 1 if random is on, 0 otherwise */ | |
| int random; | | int random; | |
| /* playlist length */ | | /* playlist length */ | |
| int playlistLength; | | int playlistLength; | |
| /* playlist, use this to determine when the playlist has changed */ | | /* playlist, use this to determine when the playlist has changed */ | |
| long long playlist; | | long long playlist; | |
|
| | | /* playlistqueue, use this to determine when the queue has changed * | |
| | | / | |
| | | long long playlistqueue; | |
| | | /* The id, used to determine is one of the playlists are changed */ | |
| | | long long storedplaylist; | |
| /* use with MPD_STATUS_STATE_* to determine state of player */ | | /* use with MPD_STATUS_STATE_* to determine state of player */ | |
| int state; | | int state; | |
| /* crossfade setting in seconds */ | | /* crossfade setting in seconds */ | |
| int crossfade; | | int crossfade; | |
| /* if a song is currently selected (always the case when state is | | /* if a song is currently selected (always the case when state is | |
| * PLAY or PAUSE), this is the position of the currently | | * PLAY or PAUSE), this is the position of the currently | |
| * playing song in the playlist, beginning with 0 | | * playing song in the playlist, beginning with 0 | |
| */ | | */ | |
| int song; | | int song; | |
| /* Song ID of the currently selected song */ | | /* Song ID of the currently selected song */ | |
| | | | |
| skipping to change at line 474 | | skipping to change at line 478 | |
| void mpd_sendDeleteCommand(mpd_Connection * connection, int songNum); | | void mpd_sendDeleteCommand(mpd_Connection * connection, int songNum); | |
| | | | |
| void mpd_sendDeleteIdCommand(mpd_Connection * connection, int songNum); | | void mpd_sendDeleteIdCommand(mpd_Connection * connection, int songNum); | |
| | | | |
| void mpd_sendSaveCommand(mpd_Connection * connection, const char * name); | | void mpd_sendSaveCommand(mpd_Connection * connection, const char * name); | |
| | | | |
| void mpd_sendLoadCommand(mpd_Connection * connection, const char * name); | | void mpd_sendLoadCommand(mpd_Connection * connection, const char * name); | |
| | | | |
| void mpd_sendRmCommand(mpd_Connection * connection, const char * name); | | void mpd_sendRmCommand(mpd_Connection * connection, const char * name); | |
| | | | |
|
| | | void mpd_sendRenameCommand(mpd_Connection *connection, const char *from, | |
| | | const char *to); | |
| | | | |
| void mpd_sendShuffleCommand(mpd_Connection * connection); | | void mpd_sendShuffleCommand(mpd_Connection * connection); | |
| | | | |
| void mpd_sendClearCommand(mpd_Connection * connection); | | void mpd_sendClearCommand(mpd_Connection * connection); | |
| | | | |
| /* use this to start playing at the beginning, useful when in random mode *
/ | | /* use this to start playing at the beginning, useful when in random mode *
/ | |
| #define MPD_PLAY_AT_BEGINNING -1 | | #define MPD_PLAY_AT_BEGINNING -1 | |
| | | | |
| void mpd_sendPlayCommand(mpd_Connection * connection, int songNum); | | void mpd_sendPlayCommand(mpd_Connection * connection, int songNum); | |
| | | | |
| void mpd_sendPlayIdCommand(mpd_Connection * connection, int songNum); | | void mpd_sendPlayIdCommand(mpd_Connection * connection, int songNum); | |
| | | | |
| skipping to change at line 663 | | skipping to change at line 670 | |
| void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path); | | void mpd_sendPlaylistClearCommand(mpd_Connection *connection, char *path); | |
| | | | |
| void mpd_sendPlaylistAddCommand(mpd_Connection *connection, | | void mpd_sendPlaylistAddCommand(mpd_Connection *connection, | |
| char *playlist, char *path); | | char *playlist, char *path); | |
| | | | |
| void mpd_sendPlaylistMoveCommand(mpd_Connection *connection, | | void mpd_sendPlaylistMoveCommand(mpd_Connection *connection, | |
| char *playlist, int from, int to); | | char *playlist, int from, int to); | |
| | | | |
| void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection, | | void mpd_sendPlaylistDeleteCommand(mpd_Connection *connection, | |
| char *playlist, int pos); | | char *playlist, int pos); | |
|
| | | | |
| | | /* | |
| | | * List the content of the queue | |
| | | */ | |
| | | void mpd_sendQueueInfoCommand(mpd_Connection * connection); | |
| | | | |
| | | /* | |
| | | * Dequeue a song from the queue | |
| | | * SongPos is the position in the queue | |
| | | */ | |
| | | void mpd_sendDequeueCommand(mpd_Connection * connection, int songPos); | |
| | | | |
| | | /* | |
| | | * Queue a song from the playlist | |
| | | * Id is the songid of the song to queue | |
| | | */ | |
| | | void mpd_sendQueueIdCommand(mpd_Connection * connection, int songId); | |
| | | void mpd_sendClearErrorCommand(mpd_Connection * connection); | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 26 lines changed or added | |
|