libmpdclient 2.22
Enumerations | Functions
fingerprint.h File Reference

MPD client library. More...

#include "compiler.h"
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for fingerprint.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  mpd_fingerprint_type { MPD_FINGERPRINT_TYPE_UNKNOWN , MPD_FINGERPRINT_TYPE_CHROMAPRINT }
 

Functions

enum mpd_fingerprint_type mpd_parse_fingerprint_type (const char *name)
 
bool mpd_send_getfingerprint (struct mpd_connection *connection, const char *uri)
 
const char * mpd_run_getfingerprint_chromaprint (struct mpd_connection *connection, const char *uri, char *buffer, size_t buffer_size)
 

Detailed Description

MPD client library.

Do not include this header directly. Use mpd/client.h instead.

Definition in file fingerprint.h.

Enumeration Type Documentation

◆ mpd_fingerprint_type

Enumerator
MPD_FINGERPRINT_TYPE_UNKNOWN 
MPD_FINGERPRINT_TYPE_CHROMAPRINT 

Definition at line 50 of file fingerprint.h.

Function Documentation

◆ mpd_parse_fingerprint_type()

enum mpd_fingerprint_type mpd_parse_fingerprint_type ( const char *  name)

Parse a mpd_pair name to check which fingerprint type it contains.

◆ mpd_send_getfingerprint()

bool mpd_send_getfingerprint ( struct mpd_connection connection,
const char *  uri 
)

Sends the "getfingerprint" command to MPD. Call mpd_recv_pair() to read response lines. Use mpd_parse_fingerprint_type() to check each pair's name; the pair's value then contains the actual fingerprint.

Parameters
connectiona valid and connected mpd_connection
urithe song URI
Returns
true on success
Since
libmpdclient 2.17, MPD 0.22

◆ mpd_run_getfingerprint_chromaprint()

const char * mpd_run_getfingerprint_chromaprint ( struct mpd_connection connection,
const char *  uri,
char *  buffer,
size_t  buffer_size 
)

Shortcut for mpd_send_getfingerprint(), mpd_recv_pair_named() and mpd_response_finish().

Parameters
connectiona valid and connected mpd_connection
urithe song URI
buffera buffer for the fingerprint string
buffer_sizethe size of the buffer (with enough room for a trailing null byte); if the buffer is too small, behavior is undefined; the library may truncate the string or fail
Returns
a pointer to the buffer on success or NULL on error (or if there was no chromaprint in MPD's response)
Since
libmpdclient 2.17, MPD 0.22