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>
|
|
|
|
|
2019-10-06 23:31:32 +02:00
|
|
|
#ifndef AUDACIOUS_VGMSTREAM_PRIORITY
|
2019-11-16 22:33:50 +01:00
|
|
|
// set higher than FFmpeg but lower than common plugins that use around 3
|
2019-11-24 10:50:49 +01:00
|
|
|
#ifdef _AUD_PLUGIN_DEFAULT_PRIO
|
|
|
|
# define AUDACIOUS_VGMSTREAM_PRIORITY (_AUD_PLUGIN_DEFAULT_PRIO - 1)
|
|
|
|
#else
|
|
|
|
# define AUDACIOUS_VGMSTREAM_PRIORITY 4
|
|
|
|
#endif
|
2019-10-06 23:31:32 +02:00
|
|
|
#endif
|
|
|
|
|
2017-05-01 10:56:40 +02:00
|
|
|
class VgmstreamPlugin : public InputPlugin {
|
2015-06-22 10:03:44 +02:00
|
|
|
public:
|
2019-10-13 19:09:17 +02:00
|
|
|
static const char *const exts[];
|
2017-05-01 10:56:40 +02:00
|
|
|
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,
|
|
|
|
};
|
|
|
|
|
2019-10-06 23:31:32 +02:00
|
|
|
constexpr VgmstreamPlugin() : InputPlugin (info,
|
2020-09-12 15:03:22 +02:00
|
|
|
InputInfo(FlagSubtunes) // allow subsongs
|
2019-11-16 22:33:50 +01:00
|
|
|
.with_priority(AUDACIOUS_VGMSTREAM_PRIORITY) // where 0=highest, 10=lowest (older) or 5 (newer)
|
2019-10-13 19:09:17 +02:00
|
|
|
.with_exts(exts)) {} // priority exts (accepted exts are still validated at runtime)
|
2017-05-01 10:56:40 +02:00
|
|
|
|
|
|
|
bool init();
|
|
|
|
void cleanup();
|
2020-08-01 10:30:12 +02:00
|
|
|
bool is_our_file(const char * filename, VFSFile & file);
|
|
|
|
Tuple read_tuple(const char * filename, VFSFile & file);
|
2017-05-01 10:56:40 +02:00
|
|
|
bool read_tag(const char * filename, VFSFile & file, Tuple & tuple, Index<char> * image);
|
2020-08-01 10:30:12 +02:00
|
|
|
bool play(const char * filename, VFSFile & file);
|
2015-06-22 10:03:44 +02:00
|
|
|
|
2017-05-01 10:56:40 +02:00
|
|
|
};
|
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;
|
2020-08-01 10:30:12 +02:00
|
|
|
bool ignore_loop;
|
2020-08-01 12:24:54 +02:00
|
|
|
double loop_count;
|
2020-08-01 10:30:12 +02:00
|
|
|
double fade_time;
|
2017-05-01 10:56:40 +02:00
|
|
|
double fade_delay;
|
2019-10-06 23:31:32 +02:00
|
|
|
int downmix_channels;
|
|
|
|
bool exts_unknown_on;
|
|
|
|
bool exts_common_on;
|
2020-09-12 15:03:22 +02:00
|
|
|
bool tagfile_disable;
|
2020-08-01 10:30:12 +02:00
|
|
|
} audacious_settings_t;
|
2015-06-22 10:03:44 +02:00
|
|
|
|
2020-08-01 10:30:12 +02:00
|
|
|
extern audacious_settings_t settings;
|
2015-06-22 10:03:44 +02:00
|
|
|
|
2019-10-06 23:31:32 +02:00
|
|
|
void vgmstream_settings_load();
|
|
|
|
void vgmstream_settings_save();
|
2015-06-22 10:03:44 +02:00
|
|
|
|
|
|
|
#endif
|