Adding tagtypes command to list available tag types (takes metadata_to_use
into account). git-svn-id: https://svn.musicpd.org/mpd/trunk@5792 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
2215c1796d
commit
e3e4964f59
@ -95,6 +95,7 @@
|
|||||||
#define COMMAND_PLAYLISTADD "playlistadd"
|
#define COMMAND_PLAYLISTADD "playlistadd"
|
||||||
#define COMMAND_PLAYLISTFIND "playlistfind"
|
#define COMMAND_PLAYLISTFIND "playlistfind"
|
||||||
#define COMMAND_PLAYLISTSEARCH "playlistsearch"
|
#define COMMAND_PLAYLISTSEARCH "playlistsearch"
|
||||||
|
#define COMMAND_TAGTYPES "tagtypes"
|
||||||
|
|
||||||
#define COMMAND_STATUS_VOLUME "volume"
|
#define COMMAND_STATUS_VOLUME "volume"
|
||||||
#define COMMAND_STATUS_STATE "state"
|
#define COMMAND_STATUS_STATE "state"
|
||||||
@ -177,6 +178,12 @@ static int handleUrlHandlers(int fd, int *permission, int argc, char *argv[])
|
|||||||
return printRemoteUrlHandlers(fd);
|
return printRemoteUrlHandlers(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int handleTagTypes(int fd, int *permission, int argc, char *argv[])
|
||||||
|
{
|
||||||
|
printTagTypes(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int handlePlay(int fd, int *permission, int argc, char *argv[])
|
static int handlePlay(int fd, int *permission, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int song = -1;
|
int song = -1;
|
||||||
@ -1043,6 +1050,7 @@ void initCommands(void)
|
|||||||
addCommand(COMMAND_PLAYLISTADD, PERMISSION_CONTROL, 2, 2, handlePlaylistAdd, NULL);
|
addCommand(COMMAND_PLAYLISTADD, PERMISSION_CONTROL, 2, 2, handlePlaylistAdd, NULL);
|
||||||
addCommand(COMMAND_PLAYLISTFIND, PERMISSION_READ, 2, -1, handlePlaylistFind, NULL);
|
addCommand(COMMAND_PLAYLISTFIND, PERMISSION_READ, 2, -1, handlePlaylistFind, NULL);
|
||||||
addCommand(COMMAND_PLAYLISTSEARCH, PERMISSION_READ, 2, -1, handlePlaylistSearch, NULL);
|
addCommand(COMMAND_PLAYLISTSEARCH, PERMISSION_READ, 2, -1, handlePlaylistSearch, NULL);
|
||||||
|
addCommand(COMMAND_TAGTYPES, PERMISSION_READ, 0, 0, handleTagTypes, NULL);
|
||||||
|
|
||||||
sortList(commandList);
|
sortList(commandList);
|
||||||
}
|
}
|
||||||
|
10
src/tag.c
10
src/tag.c
@ -116,6 +116,16 @@ void initTagConfig(void)
|
|||||||
free(temp);
|
free(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void printTagTypes(int fd)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) {
|
||||||
|
if (ignoreTagItems[i] == 0)
|
||||||
|
fdprintf(fd, "tagtype: %s\n", mpdTagItemKeys[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void printMpdTag(int fd, MpdTag * tag)
|
void printMpdTag(int fd, MpdTag * tag)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -78,6 +78,8 @@ void addItemToMpdTagWithLen(MpdTag * tag, int itemType, char *value, int len);
|
|||||||
#define addItemToMpdTag(tag, itemType, value) \
|
#define addItemToMpdTag(tag, itemType, value) \
|
||||||
addItemToMpdTagWithLen(tag, itemType, value, strlen(value))
|
addItemToMpdTagWithLen(tag, itemType, value, strlen(value))
|
||||||
|
|
||||||
|
void printTagTypes(int fd);
|
||||||
|
|
||||||
void printMpdTag(int fd, MpdTag * tag);
|
void printMpdTag(int fd, MpdTag * tag);
|
||||||
|
|
||||||
MpdTag *mpdTagDup(MpdTag * tag);
|
MpdTag *mpdTagDup(MpdTag * tag);
|
||||||
|
Loading…
Reference in New Issue
Block a user