libgroove  5.0.0
fingerprinter.h File Reference

Go to the source code of this file.

Data Structures

struct  GrooveFingerprinterInfo
 use this to find out the unique id of an audio track More...
 
struct  GrooveFingerprinter
 

Functions

struct GrooveFingerprintergroove_fingerprinter_create (void)
 
void groove_fingerprinter_destroy (struct GrooveFingerprinter *printer)
 
int groove_fingerprinter_attach (struct GrooveFingerprinter *printer, struct GroovePlaylist *playlist)
 once you attach, you must detach before destroying the playlist More...
 
int groove_fingerprinter_detach (struct GrooveFingerprinter *printer)
 
int groove_fingerprinter_info_get (struct GrooveFingerprinter *printer, struct GrooveFingerprinterInfo *info, int block)
 returns < 0 on error, 0 on aborted (block=1) or no info ready (block=0), 1 on info returned. More...
 
void groove_fingerprinter_free_info (struct GrooveFingerprinterInfo *info)
 
int groove_fingerprinter_info_peek (struct GrooveFingerprinter *printer, int block)
 returns < 0 on error, 0 on no info ready, 1 on info ready if block is 1, block until info is ready More...
 
void groove_fingerprinter_position (struct GrooveFingerprinter *printer, struct GroovePlaylistItem **item, double *seconds)
 get the position of the printer head both the current playlist item and the position in seconds in the playlist item are given. More...
 
int groove_fingerprinter_encode (int32_t *fp, int size, char **encoded_fp)
 Compress and base64-encode a raw fingerprint. More...
 
int groove_fingerprinter_decode (char *encoded_fp, int32_t **fp, int *size)
 Uncompress and base64-decode an encoded fingerprint. More...
 
void groove_fingerprinter_dealloc (void *ptr)
 

Function Documentation

int groove_fingerprinter_attach ( struct GrooveFingerprinter printer,
struct GroovePlaylist playlist 
)

once you attach, you must detach before destroying the playlist

Examples:
fingerprint.c.
struct GrooveFingerprinter* groove_fingerprinter_create ( void  )
Examples:
fingerprint.c.
void groove_fingerprinter_dealloc ( void *  ptr)
Examples:
fingerprint.c.
int groove_fingerprinter_decode ( char *  encoded_fp,
int32_t **  fp,
int *  size 
)

Uncompress and base64-decode an encoded fingerprint.

The caller is responsible for freeing the returned pointer using groove_fingerprinter_dealloc().

Parameters:

  • encoded_fp: Pointer to an encoded fingerprint
  • encoded_size: Size of the encoded fingerprint in bytes
  • fp: Pointer to a pointer, where the decoded raw fingerprint (array of signed 32-bit integers) will be stored
  • size: Number of items in the returned raw fingerprint

Returns:

  • 0 on success, < 0 on error
void groove_fingerprinter_destroy ( struct GrooveFingerprinter printer)
Examples:
fingerprint.c.
int groove_fingerprinter_detach ( struct GrooveFingerprinter printer)
Examples:
fingerprint.c.
int groove_fingerprinter_encode ( int32_t *  fp,
int  size,
char **  encoded_fp 
)

Compress and base64-encode a raw fingerprint.

The caller is responsible for freeing the returned pointer using groove_fingerprinter_dealloc().

Parameters:

  • fp: pointer to an array of signed 32-bit integers representing the raw fingerprint to be encoded
  • size: number of items in the raw fingerprint
  • encoded_fp: pointer to a pointer, where the encoded fingerprint will be stored

Returns:

  • 0 on success, < 0 on error
Examples:
fingerprint.c.
void groove_fingerprinter_free_info ( struct GrooveFingerprinterInfo info)
Examples:
fingerprint.c.
int groove_fingerprinter_info_get ( struct GrooveFingerprinter printer,
struct GrooveFingerprinterInfo info,
int  block 
)

returns < 0 on error, 0 on aborted (block=1) or no info ready (block=0), 1 on info returned.

When you get info you must free it with groove_fingerprinter_free_info.

Examples:
fingerprint.c.
int groove_fingerprinter_info_peek ( struct GrooveFingerprinter printer,
int  block 
)

returns < 0 on error, 0 on no info ready, 1 on info ready if block is 1, block until info is ready

void groove_fingerprinter_position ( struct GrooveFingerprinter printer,
struct GroovePlaylistItem **  item,
double *  seconds 
)

get the position of the printer head both the current playlist item and the position in seconds in the playlist item are given.

item will be set to NULL if the playlist is empty you may pass NULL for item or seconds