2015-06-22 10:03:44 +02:00
|
|
|
#ifndef __PLUGIN__
|
|
|
|
#define __PLUGIN__
|
|
|
|
|
|
|
|
#include <libaudcore/audstrings.h>
|
|
|
|
#include <libaudcore/i18n.h>
|
|
|
|
#include <libaudcore/plugin.h>
|
|
|
|
#include <libaudcore/preferences.h>
|
|
|
|
#include <libaudcore/runtime.h>
|
|
|
|
|
2017-05-01 10:56:40 +02:00
|
|
|
class VgmstreamPlugin : public InputPlugin {
|
2015-06-22 10:03:44 +02:00
|
|
|
public:
|
2017-05-01 10:56:40 +02:00
|
|
|
//static const char *const exts[];
|
|
|
|
static const char *const defaults[];
|
|
|
|
static const char about[];
|
|
|
|
static const PreferencesWidget widgets[];
|
|
|
|
static const PluginPreferences prefs;
|
|
|
|
|
|
|
|
static constexpr PluginInfo info = {
|
|
|
|
N_("vgmstream Decoder"), N_("vgmstream"), about, &prefs,
|
|
|
|
};
|
|
|
|
|
|
|
|
// accepted exts are validated at runtime in is_our_file now, this is to set a static list
|
|
|
|
//static constexpr auto iinfo = InputInfo().with_exts(exts);
|
|
|
|
//constexpr VgmstreamPlugin() : InputPlugin(info, iinfo) {}
|
|
|
|
//constexpr VgmstreamPlugin() : InputPlugin (info, InputInfo().with_exts(exts)) {}
|
|
|
|
|
|
|
|
constexpr VgmstreamPlugin() : InputPlugin (info, NULL) {}
|
|
|
|
|
|
|
|
bool init();
|
|
|
|
void cleanup();
|
|
|
|
bool is_our_file(const char *filename, VFSFile &file);
|
|
|
|
Tuple read_tuple(const char *filename, VFSFile &file);
|
|
|
|
bool read_tag(const char * filename, VFSFile & file, Tuple & tuple, Index<char> * image);
|
|
|
|
bool play(const char *filename, VFSFile &file);
|
2015-06-22 10:03:44 +02:00
|
|
|
|
2017-05-01 10:56:40 +02:00
|
|
|
private:
|
|
|
|
void seek(int seek_value, int ¤t_sample_pos);
|
2015-06-22 10:03:44 +02:00
|
|
|
|
2017-05-01 10:56:40 +02:00
|
|
|
};
|
2015-06-22 10:03:44 +02:00
|
|
|
|
2017-05-01 10:56:40 +02:00
|
|
|
// reminder of usage, probably no more need
|
|
|
|
//const char *const VgmstreamPlugin::exts[] = { "ext1", "ext2", ..., NULL }
|
2015-06-22 10:03:44 +02:00
|
|
|
|
|
|
|
|
2015-07-10 04:32:53 +02:00
|
|
|
typedef struct {
|
2017-05-01 10:56:40 +02:00
|
|
|
bool loop_forever;
|
|
|
|
int loop_count;
|
|
|
|
double fade_length;
|
|
|
|
double fade_delay;
|
2015-06-22 10:03:44 +02:00
|
|
|
} Settings;
|
|
|
|
|
|
|
|
extern Settings vgmstream_cfg;
|
|
|
|
|
|
|
|
void debugMessage(const char *str);
|
|
|
|
void vgmstream_cfg_load();
|
|
|
|
void vgmstream_cfg_save();
|
|
|
|
|
|
|
|
#endif
|