summaryrefslogtreecommitdiff
path: root/plugins/artwork/artwork.h
blob: 9d8a2a7dddab65f2f0c08463979463e8ff33440c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef __ARTWORK_H
#define __ARTWORK_H

#include "../../deadbeef.h"

extern DB_FILE *current_file;

typedef void (*artwork_callback) (const char *fname, const char *artist, const char *album, void *user_data);

typedef struct {
    DB_misc_t plugin;
    // returns filename of cached image, or NULL
    char* (*get_album_art) (const char *fname, const char *artist, const char *album, int size, artwork_callback callback, void *user_data);

    // this has to be called to clear queue on exit, before caller terminates
    // `fast=1' means "don't wait, just flush queue"
    void (*reset) (int fast);

    // returns path to default album art
    const char *(*get_default_cover) (void);

    // synchronously get filename
    char* (*get_album_art_sync) (const char *fname, const char *artist, const char *album, int size);

    // creates full path string for cache storage
    void (*make_cache_path) (char *path, int size, const char *album, const char *artist, int img_size);
} DB_artwork_plugin_t;

#endif /*__ARTWORK_H*/