-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.h
executable file
·63 lines (48 loc) · 1.45 KB
/
plugin.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _USF_PLUGIN_H_
#define _USF_PLUGIN_H_
/* For standalone compiling */
#ifndef PACKAGE
#define PACKAGE "audacious-plugins"
#endif
#ifndef EXPORT
#define EXPORT __attribute__((visibility("default")))
#endif
//AUD_PLUGIN_VERSION
#include <usf/usf.h>
#include "psftag.h"
class LazyUSF2Plugin : public InputPlugin
{
public:
static const char about[];
static const char * const exts[];
static const char * const defaults[];
static const PreferencesWidget widgets[];
static const PluginPreferences prefs;
static constexpr PluginInfo info = {
N_("LazyUSF2 USF Decoder"),
PACKAGE,
about,
#ifdef HAS_PREFS
&prefs
#endif
};
static constexpr auto iinfo = InputInfo ()
.with_exts (exts);
constexpr LazyUSF2Plugin() : InputPlugin (info, iinfo), state(nullptr), play_length(300.0), fade_length(0.0) {}
bool init ();
void cleanup ();
bool is_our_file (const char * filename, VFSFile & file);
Tuple read_tuple (const char * filename, VFSFile & file);
bool write_tuple (const char * filename, VFSFile & file, const Tuple & tuple);
bool play (const char * filename, VFSFile & file);
void update(const void *data, int bytes);
#if _AUD_PLUGIN_VERSION >= 48
bool read_tag (const char * filename, VFSFile & file, Tuple & tuple, Index<char> * image);
#endif
private:
usf_state_t * state;
bool usf_load(const char * file_name, VFSFile & file);
double play_length;
double fade_length;
};
#endif