plugin: unify version format

This commit is contained in:
bnnm 2021-08-15 19:24:48 +02:00
parent 2fbbe32386
commit 4d582b09de
7 changed files with 65 additions and 47 deletions

View File

@ -24,9 +24,13 @@ extern "C" {
#include "../version.h"
#ifndef VGMSTREAM_VERSION
#define VGMSTREAM_VERSION "(unknown-version)"
#define VGMSTREAM_VERSION "unknown version " __DATE__
#endif
#define PLUGIN_NAME "vgmstream plugin " VGMSTREAM_VERSION
#define PLUGIN_INFO PLUGIN_NAME " (" __DATE__ ")"
#define CFG_ID "vgmstream" // ID for storing in audacious
#define MIN_BUFFER_SIZE 576
@ -62,15 +66,15 @@ const char *const VgmstreamPlugin::defaults[] = {
// N_(...) for i18n but not much point here
const char VgmstreamPlugin::about[] =
"vgmstream plugin " VGMSTREAM_VERSION " " __DATE__ "\n"
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n"
PLUGIN_INFO "\n"
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm, Nicknine, Thealexbarney, CyberBotX, and many others\n"
"\n"
"Audacious plugin:\n"
"ported to Audacious 3.6 by Brandon Whitehead\n"
"adopted from Audacious 3 port by Thomas Eppers\n"
"originally written by Todd Jeffreys (http://voidpointer.org/)\n"
"- ported to Audacious 3.6 by Brandon Whitehead\n"
"- adopted from Audacious 3 port by Thomas Eppers\n"
"- originally written by Todd Jeffreys (http://voidpointer.org/)\n"
"\n"
"https://github.com/kode54/vgmstream/\n"
"https://github.com/vgmstream/vgmstream/\n"
"https://sourceforge.net/projects/vgmstream/ (original)";
/* widget config: {min, max, step} */

View File

@ -39,12 +39,15 @@
#include "../src/vgmstream.h"
#include "../src/plugins.h"
#include "../version.h"
#ifndef VGMSTREAM_VERSION
# define VGMSTREAM_VERSION "(unknown version)"
#define VGMSTREAM_VERSION "unknown version " __DATE__
#endif
#define APP_NAME "vgmstream123 player " VGMSTREAM_VERSION
#define APP_INFO APP_NAME " (" __DATE__ ")"
//TODO: improve WIN32 builds (some features/behaviors are missing but works)
#ifdef WIN32
#define getline(line, line_mem, f) 0
@ -122,9 +125,9 @@ static int record_interrupt(void) {
return ret;
}
static void usage(const char *progname) {
static void usage(const char* progname) {
song_settings_t default_par = DEFAULT_PARAMS;
const char *default_driver = "???";
const char* default_driver = "???";
{
ao_info *info = ao_driver_info(driver_id);
@ -132,10 +135,8 @@ static void usage(const char *progname) {
default_driver = info->short_name;
}
printf("vgmstream123 " VGMSTREAM_VERSION ", built " __DATE__ "\n"
"\n"
"Usage: %s [options] INFILE ...\n"
"Play streamed audio from video games.\n"
printf(APP_INFO "\n"
"Usage: %s [options] <infile> ...\n"
"\n"
"Options:\n"
" -d DRV Use output driver DRV [%s]; available drivers:\n"
@ -175,7 +176,7 @@ static void usage(const char *progname) {
" -E Really force loop (repeat file)\n"
" -p Play forever (loops file until stopped)\n"
"\n"
"INFILE can be any stream file type supported by vgmstream, or an .m3u/.m3u8\n"
"<infile> can be any stream file type supported by vgmstream, or an .m3u/.m3u8\n"
"playlist referring to same. This program supports the \"EXT-X-VGMSTREAM\" tag\n"
"in playlists, and files compressed with gzip/bzip2/xz.\n",
buffer_size_kb,
@ -254,11 +255,11 @@ static void apply_config(VGMSTREAM* vgmstream, song_settings_t* cfg) {
vgmstream_apply_config(vgmstream, &vcfg);
}
static int play_vgmstream(const char *filename, song_settings_t *cfg) {
static int play_vgmstream(const char* filename, song_settings_t* cfg) {
int ret = 0;
STREAMFILE* sf;
VGMSTREAM *vgmstream;
FILE *save_fps[4];
VGMSTREAM* vgmstream;
FILE* save_fps[4];
size_t buffer_size;
int32_t max_buffer_samples;
int i;

View File

@ -1,9 +1,16 @@
/**
* vgmstream CLI decoder
*/
#define POSIXLY_CORRECT
#include <getopt.h>
#include "../src/vgmstream.h"
#include "../src/plugins.h"
#include "../src/util.h"
//todo use <>?
#ifdef HAVE_JSON
#include "jansson/jansson.h"
#endif
#ifdef WIN32
#include <io.h>
@ -16,14 +23,14 @@
#define STDOUT_FILENO 1
#endif
#include "../version.h"
#ifndef VGMSTREAM_VERSION
#define VGMSTREAM_VERSION "(unknown version)"
#define VGMSTREAM_VERSION "unknown version " __DATE__
#endif
#define APP_NAME "vgmstream CLI decoder " VGMSTREAM_VERSION
#define APP_INFO APP_NAME " (" __DATE__ ")"
#ifdef HAVE_JSON
#include "jansson/jansson.h"
#endif
/* low values are ok as there is very little performance difference, but higher
* may improve write I/O in some systems as this*channels doubles as output buffer */
@ -37,8 +44,8 @@
static size_t make_wav_header(uint8_t* buf, size_t buf_size, int32_t sample_count, int32_t sample_rate, int channels, int smpl_chunk, int32_t loop_start, int32_t loop_end);
static void usage(const char* name, int is_full) {
fprintf(stderr,"vgmstream CLI decoder " VGMSTREAM_VERSION " " __DATE__ "\n"
"Usage: %s [-o <outfile.wav>] [options] <infile>\n"
fprintf(stderr, APP_INFO "\n"
"Usage: %s [-o <outfile.wav>] [options] <infile> ...\n"
"Options:\n"
" -o <outfile.wav>: name of output .wav file, default <infile>.wav\n"
" <outfile> wildcards can be ?s=subsong, ?n=stream name, ?f=infile\n"

View File

@ -48,7 +48,7 @@ Generating done
Before that you'll see what options are enabled and disabled, what is going to be built and where they will be installed to.
You may need to select a Generator first, depending on your installed tools (for example, Visual Studio 16 2019 or MingW Make on Windows). If you need to change it later, select *File > Delete Cache*.
You may need to select a Generator first, depending on your installed tools (for example, Visual Studio 16 2019 or MingW Make on Windows). If you need to change it later, select *File > Delete Cache*. You may need to include those tools in the *Path* variable, inside *Environment...* options.
If you decided to build for a project-based GUI, you can click on Open Project to open that. (NOTE: Only Visual Studio has been tested as a project-based GUI.) If you decided to build for a command line build system, you can open up the command line for the build directory and run your build system.

View File

@ -19,20 +19,21 @@ extern "C" {
#include "foo_vgmstream.h"
#include "foo_filetypes.h"
#include "../version.h"
#ifndef VGMSTREAM_VERSION
#define PLUGIN_VERSION __DATE__
#else
#define PLUGIN_VERSION VGMSTREAM_VERSION
#define VGMSTREAM_VERSION "unknown version " __DATE__
#endif
#define APP_NAME "vgmstream plugin"
#define PLUGIN_DESCRIPTION "vgmstream plugin " VGMSTREAM_VERSION " " __DATE__ "\n" \
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n" \
#define PLUGIN_NAME "vgmstream plugin"
#define PLUGIN_VERSION VGMSTREAM_VERSION
#define PLUGIN_INFO PLUGIN_NAME " " PLUGIN_VERSION " (" __DATE__ ")"
#define PLUGIN_DESCRIPTION PLUGIN_INFO "\n" \
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm, Nicknine, Thealexbarney, CyberBotX, and many others\n" \
"\n" \
"foobar2000 plugin by Josh W, kode54\n" \
"foobar2000 plugin by Josh W, kode54, others\n" \
"\n" \
"https://github.com/kode54/vgmstream/\n" \
"https://github.com/vgmstream/vgmstream/\n" \
"https://sourceforge.net/projects/vgmstream/ (original)"
#define PLUGIN_FILENAME "foo_input_vgmstream.dll"
@ -499,5 +500,5 @@ bool input_vgmstream::g_is_low_merit() {
// foobar plugin defs
static input_factory_t<input_vgmstream> g_input_vgmstream_factory;
DECLARE_COMPONENT_VERSION(APP_NAME, PLUGIN_VERSION, PLUGIN_DESCRIPTION);
DECLARE_COMPONENT_VERSION(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_DESCRIPTION);
VALIDATE_COMPONENT_FILENAME(PLUGIN_FILENAME);

View File

@ -3,12 +3,14 @@
*/
#include "in_vgmstream.h"
#include "../version.h"
#ifndef VGMSTREAM_VERSION
#define VGMSTREAM_VERSION "(unknown version)"
#define VGMSTREAM_VERSION "unknown version " __DATE__
#endif
#define PLUGIN_DESCRIPTION "vgmstream plugin " VGMSTREAM_VERSION " " __DATE__
#define PLUGIN_NAME "vgmstream plugin " VGMSTREAM_VERSION
#define PLUGIN_INFO PLUGIN_NAME " (" __DATE__ ")"
/* ***************************************** */
@ -320,12 +322,12 @@ static double get_album_gain_volume(const in_char* fn) {
/* about dialog */
void winamp_About(HWND hwndParent) {
const char* ABOUT_TEXT =
PLUGIN_DESCRIPTION "\n"
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n"
PLUGIN_INFO "\n"
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm, Nicknine, Thealexbarney, CyberBotX, and many others\n"
"\n"
"Winamp plugin by hcs, others\n"
"\n"
"https://github.com/kode54/vgmstream/\n"
"https://github.com/vgmstream/vgmstream/\n"
"https://sourceforge.net/projects/vgmstream/ (original)";
{
@ -536,7 +538,7 @@ int winamp_InfoBox(const in_char *fn, HWND hwnd) {
size_t description_size = 1024;
double tmpVolume = 1.0;
concatn(description_size,description,PLUGIN_DESCRIPTION "\n\n");
concatn(description_size,description,PLUGIN_INFO "\n\n");
if (!fn || !*fn) {
/* no filename = current playing file */
@ -759,7 +761,7 @@ void winamp_Config(HWND hwndParent) {
/* main plugin def */
In_Module input_module = {
IN_VER,
PLUGIN_DESCRIPTION,
PLUGIN_NAME,
0, /* hMainWindow (filled in by Winamp) */
0, /* hDllInstance (filled in by Winamp) */
working_extension_list,

View File

@ -18,8 +18,11 @@
#include "../version.h"
#ifndef VGMSTREAM_VERSION
#define VGMSTREAM_VERSION "(unknown version)"
#define VGMSTREAM_VERSION "unknown version " __DATE__
#endif
#define PLUGIN_NAME "vgmstream plugin " VGMSTREAM_VERSION
#define PLUGIN_INFO PLUGIN_NAME " (" __DATE__ ")"
/* ************************************* */
@ -433,12 +436,12 @@ static void build_extension_list() {
/* info for the "about" button in plugin options */
void WINAPI xmplay_About(HWND win) {
MessageBox(win,
"vgmstream plugin " VGMSTREAM_VERSION " " __DATE__ "\n"
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm and many others\n"
PLUGIN_INFO "\n"
"by hcs, FastElbja, manakoAT, bxaimc, snakemeat, soneek, kode54, bnnm, Nicknine, Thealexbarney, CyberBotX, and many others\n"
"\n"
"XMPlay plugin by unknownfile, PSXGamerPro1, kode54\n"
"XMPlay plugin by unknownfile, PSXGamerPro1, kode54, others\n"
"\n"
"https://github.com/kode54/vgmstream/\n"
"https://github.com/vgmstream/vgmstream/\n"
"https://sourceforge.net/projects/vgmstream/ (original)"
,"about xmp-vgmstream",MB_OK);
}