mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 08:20:54 +01:00
commit
da9c04551b
75
Makefile
75
Makefile
@ -4,16 +4,11 @@
|
||||
|
||||
ifeq ($(VGMSTREAM_VERSION),)
|
||||
# for current dir (expanded later)
|
||||
VGMSTREAM_VERSION_CURR=`./version-get.sh`
|
||||
# for subdirs (expanded later)
|
||||
VGMSTREAM_VERSION_PREV=`../version-get.sh`
|
||||
VGMSTREAM_VERSION=`sh ./version-get.sh`
|
||||
else
|
||||
VGMSTREAM_VERSION_CURR=$(VGMSTREAM_VERSION)
|
||||
VGMSTREAM_VERSION_PREV=$(VGMSTREAM_VERSION)
|
||||
VGMSTREAM_VERSION=$(VGMSTREAM_VERSION)
|
||||
endif
|
||||
|
||||
export VGMSTREAM_VERSION_PREV
|
||||
|
||||
DEF_CFLAGS += -DVGMSTREAM_VERSION_AUTO
|
||||
|
||||
###############################################################################
|
||||
### external defs
|
||||
@ -98,6 +93,7 @@ endif
|
||||
### external libs
|
||||
# (call "make VGM_xxx = 0/1" to override 0/1 defaults, as Make does)
|
||||
ifeq ($(TARGET_OS),Windows_NT)
|
||||
|
||||
# enabled by default on Windows
|
||||
VGM_VORBIS = 1
|
||||
ifneq ($(VGM_VORBIS),0)
|
||||
@ -222,14 +218,22 @@ export DEF_CFLAGS LIBS_CFLAGS LIBS_LDFLAGS LIBS_TARGET_EXT_LIBS
|
||||
|
||||
###############################################################################
|
||||
### internal defs
|
||||
ZIP_FILES = COPYING
|
||||
ZIP_FILES+= README.md
|
||||
ZIP_FILES+= cli/test.exe
|
||||
ZIP_FILES+= winamp/in_vgmstream.dll
|
||||
ZIP_FILES+= xmplay/xmp-vgmstream.dll
|
||||
ZIP_FILES+= ext_libs/*.dll
|
||||
ZIP_FILES+= ext_libs/libspeex/*.dll
|
||||
ZIP_FILES_AO = $(LIBAO_DLL_PATH)/*.dll
|
||||
ifeq ($(TARGET_OS),Windows_NT)
|
||||
ZIP_FILES = COPYING
|
||||
ZIP_FILES += README.md
|
||||
ZIP_FILES += cli/test.exe
|
||||
ZIP_FILES += winamp/in_vgmstream.dll
|
||||
ZIP_FILES += xmplay/xmp-vgmstream.dll
|
||||
ZIP_FILES += ext_libs/*.dll
|
||||
ZIP_FILES += ext_libs/libspeex/*.dll
|
||||
ZIP_FILES_AO = cli/vgmstream123.exe
|
||||
ZIP_FILES_AO += $(LIBAO_DLL_PATH)/*.dll
|
||||
else
|
||||
ZIP_FILES = COPYING
|
||||
ZIP_FILES += README.md
|
||||
ZIP_FILES += cli/vgmstream-cli
|
||||
ZIP_FILES_AO = cli/vgmstream123
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
### targets
|
||||
@ -240,33 +244,38 @@ buildrelease-ex: clean bin-ex
|
||||
buildfullrelease: clean sourceball bin
|
||||
|
||||
sourceball:
|
||||
rm -rf vgmstream-$(VGMSTREAM_VERSION_CURR)
|
||||
git checkout-index -f -a --prefix=vgmstream-$(VGMSTREAM_VERSION_CURR)/
|
||||
# git archive --format zip --output vgmstream-$(VGMSTREAM_VERSION_CURR).zip master
|
||||
echo "#!/bin/sh" > vgmstream-$(VGMSTREAM_VERSION_CURR)/version-get.sh
|
||||
echo "echo \"$(VGMSTREAM_VERSION_CURR)\"" >> vgmstream-$(VGMSTREAM_VERSION_CURR)/version-get.sh
|
||||
tar cvzf "vgmstream-$(VGMSTREAM_VERSION_CURR).tar.gz" vgmstream-$(VGMSTREAM_VERSION_CURR)/*
|
||||
rm -rf vgmstream-$(VGMSTREAM_VERSION_CURR)
|
||||
rm -rf vgmstream-$(VGMSTREAM_VERSION)
|
||||
git checkout-index -f -a --prefix=vgmstream-$(VGMSTREAM_VERSION)/
|
||||
# git archive --format zip --output vgmstream-$(VGMSTREAM_VERSION).zip master
|
||||
echo "#!/bin/sh" > vgmstream-$(VGMSTREAM_VERSION)/version-get.sh
|
||||
echo "echo \"$(VGMSTREAM_VERSION)\"" >> vgmstream-$(VGMSTREAM_VERSION)/version-get.sh
|
||||
tar cvzf "vgmstream-$(VGMSTREAM_VERSION)-src.tar.gz" vgmstream-$(VGMSTREAM_VERSION)/*
|
||||
rm -rf vgmstream-$(VGMSTREAM_VERSION)
|
||||
|
||||
bin mingwbin: vgmstream_cli winamp xmplay
|
||||
zip -FS -j "vgmstream-$(VGMSTREAM_VERSION_CURR)-test.zip" $(ZIP_FILES)
|
||||
bin: vgmstream_cli winamp xmplay
|
||||
mkdir -p bin
|
||||
zip -FS -j "bin/vgmstream-$(VGMSTREAM_VERSION).zip" $(ZIP_FILES)
|
||||
|
||||
#separate since vgmstream123 is kinda untested
|
||||
bin-ex mingwbin-ex: vgmstream_cli winamp xmplay vgmstream123
|
||||
zip -FS -j "vgmstream-$(VGMSTREAM_VERSION_CURR)-test.zip" $(ZIP_FILES) $(ZIP_FILES_AO)
|
||||
bin-ex: vgmstream_cli winamp xmplay vgmstream123
|
||||
mkdir -p bin
|
||||
zip -FS -j "bin/vgmstream-$(VGMSTREAM_VERSION).zip" $(ZIP_FILES) $(ZIP_FILES_AO)
|
||||
|
||||
vgmstream_cli mingw_test:
|
||||
vgmstream_cli: version
|
||||
$(MAKE) -C cli vgmstream_cli
|
||||
|
||||
vgmstream123:
|
||||
vgmstream123: version
|
||||
$(MAKE) -C cli vgmstream123
|
||||
|
||||
winamp mingw_winamp:
|
||||
winamp: version
|
||||
$(MAKE) -C winamp in_vgmstream
|
||||
|
||||
xmplay mingw_xmplay:
|
||||
xmplay: version
|
||||
$(MAKE) -C xmplay xmp_vgmstream
|
||||
|
||||
version:
|
||||
sh version-make.sh
|
||||
|
||||
clean:
|
||||
$(RMF) vgmstream-*.zip
|
||||
$(MAKE) -C src clean
|
||||
@ -275,6 +284,4 @@ clean:
|
||||
$(MAKE) -C xmplay clean
|
||||
$(MAKE) -C ext_libs clean
|
||||
|
||||
.PHONY: clean buildfullrelease buildrelease sourceball bin vgmstream_cli winamp xmplay mingwbin mingw_test mingw_winamp mingw_xmplay
|
||||
|
||||
#deprecated: buildfullrelease sourceball mingwbin mingw_test mingw_winamp mingw_xmplay
|
||||
.PHONY: clean buildfullrelease buildrelease sourceball bin vgmstream_cli winamp
|
||||
|
@ -6,7 +6,7 @@ inputplugindir = $(plugindir)/$(INPUT_PLUGIN_DIR)
|
||||
inputplugin_LTLIBRARIES = libvgmstream.la
|
||||
|
||||
AM_MAKEFLAGS=-f Makefile.autotools
|
||||
AM_CXXFLAGS = -DVGMSTREAM_VERSION=\"VGMSTREAM_VERSION\" -Wall -std=c++11 -fpermissive -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AUDACIOUS_CFLAGS) $(GTK_CFLAGS)
|
||||
AM_CXXFLAGS = -DVGMSTREAM_VERSION_AUTO -Wall -std=c++11 -fpermissive -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AUDACIOUS_CFLAGS) $(GTK_CFLAGS)
|
||||
AM_LIBS =
|
||||
|
||||
# sources/headers are updated automatically by ./bootstrap script (not all headers are needed though)
|
||||
|
@ -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} */
|
||||
|
@ -25,11 +25,9 @@ sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $META_HDRS/g" ./src/meta/Makefile.autot
|
||||
sed -i -e "s/libvgmstream_la_SOURCES =.*/libvgmstream_la_SOURCES = $AUDACIOUS_SRCS/g" ./audacious/Makefile.autotools.am
|
||||
sed -i -e "s/EXTRA_DIST =.*/EXTRA_DIST = $AUDACIOUS_HDRS/g" ./audacious/Makefile.autotools.am
|
||||
|
||||
# get version to show in about dialogs
|
||||
# make version to show in about dialogs
|
||||
# again, not very pretty
|
||||
VGMSTREAM_VERSION=`./version-get.sh`
|
||||
sed -i -e "s/VGMSTREAM_VERSION/$VGMSTREAM_VERSION/g" ./audacious/Makefile.autotools.am
|
||||
sed -i -e "s/VGMSTREAM_VERSION/$VGMSTREAM_VERSION/g" ./cli/Makefile.autotools.am
|
||||
sh version-make.sh
|
||||
|
||||
# create fake files expected by automake and process
|
||||
touch README AUTHORS NEWS ChangeLog
|
||||
|
@ -44,11 +44,11 @@ export CFLAGS LDFLAGS
|
||||
### targets
|
||||
|
||||
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||
$(CC) $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" vgmstream_cli.c $(LDFLAGS) -o $(OUTPUT_CLI)
|
||||
$(CC) $(CFLAGS) vgmstream_cli.c $(LDFLAGS) -o $(OUTPUT_CLI)
|
||||
$(STRIP) $(OUTPUT_CLI)
|
||||
|
||||
vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||
$(CC) $(CFLAGS) $(LIBAO_INC) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" vgmstream123.c $(LDFLAGS) $(LIBAO_LIB) -o $(OUTPUT_123)
|
||||
$(CC) $(CFLAGS) $(LIBAO_INC) vgmstream123.c $(LDFLAGS) $(LIBAO_LIB) -o $(OUTPUT_123)
|
||||
$(STRIP) $(OUTPUT_123)
|
||||
|
||||
libvgmstream.a:
|
||||
|
@ -6,7 +6,7 @@ if HAVE_LIBAO
|
||||
bin_PROGRAMS += vgmstream123
|
||||
endif
|
||||
|
||||
AM_CFLAGS = -DVGMSTREAM_VERSION=\"VGMSTREAM_VERSION\" -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AO_CFLAGS)
|
||||
AM_CFLAGS = -DVGMSTREAM_VERSION_AUTO -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/ext_includes/ $(AO_CFLAGS)
|
||||
AM_MAKEFLAGS = -f Makefile.autotools
|
||||
|
||||
vgmstream_cli_SOURCES = vgmstream_cli.c
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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);
|
||||
|
@ -1,18 +1,50 @@
|
||||
#!/bin/sh
|
||||
|
||||
# echo current git version (doesn't make version_auto.h)
|
||||
VERSION_EMPTY=$1
|
||||
#VERSION_FILE=--
|
||||
VERSION_NAME=$2
|
||||
if [ -z "$VERSION_EMPTY" ]; then VERSION_EMPTY=false; fi
|
||||
#if [ -z "$VERSION_FILE" ]; then VERSION_FILE=version_auto.h; fi
|
||||
if [ -z "$VERSION_NAME" ]; then VERSION_NAME=VGMSTREAM_VERSION; fi
|
||||
VERSION_DEFAULT=unknown
|
||||
|
||||
# try get version from Git (dynamic), including lightweight tags
|
||||
if ! command -v git > /dev/null
|
||||
then
|
||||
VERSION="unknown"
|
||||
if ! command -v git > /dev/null ; then
|
||||
VERSION=""
|
||||
else
|
||||
VERSION=$(git describe --tags --always 2>&1 | tr : _ )
|
||||
if case "$VERSION" in fatal*) true;; *) false;; esac; then
|
||||
VERSION=""
|
||||
fi
|
||||
fi
|
||||
|
||||
# ignore git stderr "fatal:
|
||||
if case $VERSION in fatal*) ;; *) false;; esac; then
|
||||
echo "unknown"
|
||||
|
||||
if [ ! -z "$VERSION" ]; then
|
||||
LINE="$VERSION"
|
||||
else
|
||||
echo "$VERSION"
|
||||
fi;
|
||||
# try to get version from version.h (static)
|
||||
#echo "Git version not found, can't autogenerate version (using default)"
|
||||
|
||||
# option to output empty line instead of default version, so plugins can detect git-less builds
|
||||
if [ "$VERSION_EMPTY" = "true" ]; then
|
||||
LINE="/* ignored */"
|
||||
else
|
||||
LINE="$VERSION_DEFAULT"
|
||||
while IFS= read -r <&3 ITEM; do
|
||||
COMP="#define $VERSION_NAME"
|
||||
if case "$ITEM" in *"$COMP"*) true;; *) false;; esac; then
|
||||
# clean "#define ..." leaving rXXXX only
|
||||
REGEX_REMOVE1="#define $VERSION_NAME \""
|
||||
REGEX_REMOVE2="\".*"
|
||||
LINE="$ITEM"
|
||||
LINE=$(echo $LINE | sed "s/$REGEX_REMOVE1//")
|
||||
LINE=$(echo $LINE | sed "s/$REGEX_REMOVE2//")
|
||||
fi
|
||||
done 3< "version.h"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# final print
|
||||
echo "$LINE"
|
||||
|
@ -2,15 +2,13 @@
|
||||
setlocal enableextensions enabledelayedexpansion
|
||||
|
||||
REM creates or updates version_auto.h
|
||||
REM params: $1=filename (usually version_auto.h), $2=VARNAME (usually VGMSTREAM_VERSION)
|
||||
|
||||
|
||||
REM defaults
|
||||
set VERSION_EMPTY=%1
|
||||
set VERSION_FILE=%2
|
||||
set VERSION_NAME=%3
|
||||
if "%~1" == "" set VERSION_EMPTY=false
|
||||
if "%~2" == "" set VERSION_FILE=version_auto.h
|
||||
if "%~3" == "" set VERSION_NAME=VGMSTREAM_VERSION
|
||||
set VERSION_DEFAULT=unknown
|
||||
set VERSION_FILE=%1
|
||||
set VERSION_NAME=%2
|
||||
if "%~1" == "" set VERSION_FILE=version_auto.h
|
||||
if "%~2" == "" set VERSION_NAME=VGMSTREAM_VERSION
|
||||
|
||||
if not "%VERSION%"=="" set VERSION=!VERSION:^:=_!
|
||||
cd /d "%~dp0"
|
||||
@ -29,12 +27,17 @@ goto :got_version
|
||||
REM try to get version from version.h (static)
|
||||
:get_version_h
|
||||
echo Git version not found, can't autogenerate version (using default)
|
||||
set LINE=#define %VERSION_NAME% "%VERSION_DEFAULT%" /* autogenerated */
|
||||
if exist "version.h" (
|
||||
for /F "tokens=*" %%v in (version.h) do (
|
||||
set TOKEN=%%v
|
||||
REM set COMP=#define %VERSION_NAME% #todo
|
||||
if /i "!TOKEN:~0,25!"=="#define VGMSTREAM_VERSION" set LINE=%%v
|
||||
REM option to output empty line instead of default version, so plugins can detect git-less builds
|
||||
if "%VERSION_EMPTY%"=="true" (
|
||||
set LINE=/* ignored */
|
||||
) else (
|
||||
set LINE=#define %VERSION_NAME% "%VERSION_DEFAULT%" /* autogenerated */
|
||||
if exist "version.h" (
|
||||
for /F "tokens=*" %%v in (version.h) do (
|
||||
set TOKEN=%%v
|
||||
REM set COMP=#define %VERSION_NAME% #todo
|
||||
if /i "!TOKEN:~0,25!"=="#define VGMSTREAM_VERSION" set LINE=%%v /* default */
|
||||
)
|
||||
)
|
||||
)
|
||||
goto :got_version
|
||||
|
@ -1,33 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
# make current git version (overwrites version_auto.h)
|
||||
VERSION_EMPTY=$1
|
||||
VERSION_FILE=$2
|
||||
VERSION_NAME=$3
|
||||
if [ -z "$VERSION_EMPTY" ]; then VERSION_EMPTY=false; fi
|
||||
if [ -z "$VERSION_FILE" ]; then VERSION_FILE=version_auto.h; fi
|
||||
if [ -z "$VERSION_NAME" ]; then VERSION_NAME=VGMSTREAM_VERSION; fi
|
||||
VERSION_DEFAULT=unknown
|
||||
VERSION_NAME=VGMSTREAM_VERSION
|
||||
VERSION_FILE=version_auto.h
|
||||
|
||||
|
||||
# try get version from Git (dynamic), including lightweight tags
|
||||
if ! command -v git > /dev/null ; then
|
||||
VERSION=""
|
||||
else
|
||||
VERSION=$(git describe --tags --always 2>&1 | tr : _ )
|
||||
if case "$VERSION" in fatal*) true;; *) false;; esac; then
|
||||
VERSION=""
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# ignore git stderr "fatal:*" or blank
|
||||
if [[ $VERSION != fatal* ]] && [ ! -z "$VERSION" ] ; then
|
||||
if [ ! -z "$VERSION" ]; then
|
||||
LINE="#define $VERSION_NAME \"$VERSION\" /* autogenerated */"
|
||||
else
|
||||
# try to get version from version.h (static)
|
||||
echo "Git version not found, can't autogenerate version (using default)"
|
||||
LINE="#define $VERSION_NAME \"$VERSION_DEFAULT\" /* autogenerated */"
|
||||
|
||||
while IFS= read -r -u3 item; do
|
||||
COMP="#define $VERSION_NAME*"
|
||||
if [[ $item == $COMP ]] ; then
|
||||
LINE=$item
|
||||
fi
|
||||
done 3< "version.h"
|
||||
# option to output empty line instead of default version, so plugins can detect git-less builds
|
||||
if [ "$VERSION_EMPTY" = "true" ]; then
|
||||
LINE="/* ignored */"
|
||||
else
|
||||
LINE="#define $VERSION_NAME \"$VERSION_DEFAULT\" /* autogenerated */"
|
||||
while IFS= read -r <&3 ITEM; do
|
||||
COMP="#define $VERSION_NAME"
|
||||
if case "$ITEM" in *"$COMP"*) true;; *) false;; esac; then
|
||||
LINE="$ITEM /* default */"
|
||||
fi
|
||||
done 3< "version.h"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@ -36,6 +46,6 @@ LINE_ORIGINAL="none"
|
||||
if test -f "version_auto.h"; then
|
||||
LINE_ORIGINAL=$(<version_auto.h)
|
||||
fi
|
||||
if [[ $LINE != $LINE_ORIGINAL ]] ; then
|
||||
if [ ! "$LINE" = "$LINE_ORIGINAL" ]; then
|
||||
echo "$LINE" > "$VERSION_FILE"
|
||||
fi
|
||||
|
@ -9,9 +9,9 @@
|
||||
#else
|
||||
/* Static/fallback version.
|
||||
* Version is autogenerated from Git (passed via compiler args, or updated with scripts), but this file is
|
||||
* for Git-less builds (not installed or downloaded master) and builds that don't do the above should still work
|
||||
* for Git-less builds (not installed or downloaded master). Builds that don't do the above should still work
|
||||
* (compiling a well-behaved src shouldn't depend on calling arbitrary scripts). */
|
||||
#define VGMSTREAM_VERSION "r1625"
|
||||
#define VGMSTREAM_VERSION "r1626"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -40,7 +40,7 @@ SRC_SRCS = in_vgmstream.c in_streamfile.c in_config.c
|
||||
### targets
|
||||
|
||||
in_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS) resource.o
|
||||
$(CC) -shared -static-libgcc $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" $(SRC_SRCS) resource.o $(LDFLAGS) -o $(OUTPUT_WINAMP)
|
||||
$(CC) -shared -static-libgcc $(CFLAGS) $(SRC_SRCS) resource.o $(LDFLAGS) -o $(OUTPUT_WINAMP)
|
||||
$(STRIP) $(OUTPUT_WINAMP)
|
||||
|
||||
resource.o: resource.rc resource.h
|
||||
|
@ -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,
|
||||
|
@ -36,7 +36,7 @@ export CFLAGS LDFLAGS
|
||||
### targets
|
||||
|
||||
xmp_vgmstream: libvgmstream.a $(TARGET_EXT_LIBS)
|
||||
$(CC) -shared -static-libgcc $(CFLAGS) "-DVGMSTREAM_VERSION=\"$(VGMSTREAM_VERSION_PREV)\"" xmp_vgmstream.c $(LDFLAGS) -o $(OUTPUT_XMPLAY) xmpin.def
|
||||
$(CC) -shared -static-libgcc $(CFLAGS) xmp_vgmstream.c $(LDFLAGS) -o $(OUTPUT_XMPLAY) xmpin.def
|
||||
$(STRIP) $(OUTPUT_XMPLAY)
|
||||
|
||||
libvgmstream.a:
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user