From 2b4fd9972f0418e6eea44926c9fada73a7e2eddb Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 17 Jan 2020 15:51:39 +0300 Subject: Create update-copyright.sh --- utils/update-copyright.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 utils/update-copyright.sh (limited to 'utils') diff --git a/utils/update-copyright.sh b/utils/update-copyright.sh new file mode 100755 index 0000000..6ff0dee --- /dev/null +++ b/utils/update-copyright.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +find . -type f -exec grep -Il "Copyright" {} \; \ +| grep -v \.git \ +| while read file; \ +do \ + LC_ALL=C sed -b -i "s/\(.*Copyright.*\)[0-9]\{4\}\( *Vitaly Novichkov\)/\1`date +%Y`\2/" "$file"; \ +done -- cgit v1.2.3 From 1ef47f7db773a76a5652094b5ac8a9ec6408d064 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 17 Jan 2020 15:52:29 +0300 Subject: Update copyright year --- utils/gen_adldata/ini/ini_processing.cpp | 2 +- utils/gen_adldata/ini/ini_processing.h | 2 +- utils/gen_adldata/ini/ini_processing_variant.h | 2 +- utils/midiplay/adlmidiplay.cpp | 2 +- utils/midiplay/audio.h | 2 +- utils/midiplay/audio_sdl.c | 2 +- utils/midiplay/audio_winmm.c | 2 +- utils/vlc_codec/libadlmidi.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'utils') diff --git a/utils/gen_adldata/ini/ini_processing.cpp b/utils/gen_adldata/ini/ini_processing.cpp index d43fb47..4336170 100644 --- a/utils/gen_adldata/ini/ini_processing.cpp +++ b/utils/gen_adldata/ini/ini_processing.cpp @@ -1,7 +1,7 @@ /* * INI Processor - a small library which allows you parsing INI-files * - * Copyright (c) 2015-2019 Vitaly Novichkov + * Copyright (c) 2015-2020 Vitaly Novichkov * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the "Software"), diff --git a/utils/gen_adldata/ini/ini_processing.h b/utils/gen_adldata/ini/ini_processing.h index c51f586..bd15e17 100644 --- a/utils/gen_adldata/ini/ini_processing.h +++ b/utils/gen_adldata/ini/ini_processing.h @@ -1,7 +1,7 @@ /* * INI Processor - a small library which allows you parsing INI-files * - * Copyright (c) 2015-2019 Vitaly Novichkov + * Copyright (c) 2015-2020 Vitaly Novichkov * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the "Software"), diff --git a/utils/gen_adldata/ini/ini_processing_variant.h b/utils/gen_adldata/ini/ini_processing_variant.h index b89be8b..289ec66 100644 --- a/utils/gen_adldata/ini/ini_processing_variant.h +++ b/utils/gen_adldata/ini/ini_processing_variant.h @@ -1,7 +1,7 @@ /* * INI Processor - a small library which allows you parsing INI-files * - * Copyright (c) 2015-2019 Vitaly Novichkov + * Copyright (c) 2015-2020 Vitaly Novichkov * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the "Software"), diff --git a/utils/midiplay/adlmidiplay.cpp b/utils/midiplay/adlmidiplay.cpp index bbf1dbf..0cb314e 100644 --- a/utils/midiplay/adlmidiplay.cpp +++ b/utils/midiplay/adlmidiplay.cpp @@ -3,7 +3,7 @@ * a Software MIDI synthesizer library with OPL3 emulation * * Original ADLMIDI code: Copyright (c) 2010-2014 Joel Yliluoma - * ADLMIDI Library API: Copyright (c) 2015-2019 Vitaly Novichkov + * ADLMIDI Library API: Copyright (c) 2015-2020 Vitaly Novichkov * * Library is based on the ADLMIDI, a MIDI player for Linux and Windows with OPL3 emulation: * http://iki.fi/bisqwit/source/adlmidi.html diff --git a/utils/midiplay/audio.h b/utils/midiplay/audio.h index 9e6c2b2..567465a 100644 --- a/utils/midiplay/audio.h +++ b/utils/midiplay/audio.h @@ -3,7 +3,7 @@ * a Software MIDI synthesizer library with OPL3 emulation * * Original ADLMIDI code: Copyright (c) 2010-2014 Joel Yliluoma - * ADLMIDI Library API: Copyright (c) 2015-2019 Vitaly Novichkov + * ADLMIDI Library API: Copyright (c) 2015-2020 Vitaly Novichkov * * Library is based on the ADLMIDI, a MIDI player for Linux and Windows with OPL3 emulation: * http://iki.fi/bisqwit/source/adlmidi.html diff --git a/utils/midiplay/audio_sdl.c b/utils/midiplay/audio_sdl.c index 02a9ee6..bd03d6e 100644 --- a/utils/midiplay/audio_sdl.c +++ b/utils/midiplay/audio_sdl.c @@ -3,7 +3,7 @@ * a Software MIDI synthesizer library with OPL3 emulation * * Original ADLMIDI code: Copyright (c) 2010-2014 Joel Yliluoma - * ADLMIDI Library API: Copyright (c) 2015-2019 Vitaly Novichkov + * ADLMIDI Library API: Copyright (c) 2015-2020 Vitaly Novichkov * * Library is based on the ADLMIDI, a MIDI player for Linux and Windows with OPL3 emulation: * http://iki.fi/bisqwit/source/adlmidi.html diff --git a/utils/midiplay/audio_winmm.c b/utils/midiplay/audio_winmm.c index e0aca93..afe712d 100644 --- a/utils/midiplay/audio_winmm.c +++ b/utils/midiplay/audio_winmm.c @@ -3,7 +3,7 @@ * a Software MIDI synthesizer library with OPL3 emulation * * Original ADLMIDI code: Copyright (c) 2010-2014 Joel Yliluoma - * ADLMIDI Library API: Copyright (c) 2015-2019 Vitaly Novichkov + * ADLMIDI Library API: Copyright (c) 2015-2020 Vitaly Novichkov * * Library is based on the ADLMIDI, a MIDI player for Linux and Windows with OPL3 emulation: * http://iki.fi/bisqwit/source/adlmidi.html diff --git a/utils/vlc_codec/libadlmidi.c b/utils/vlc_codec/libadlmidi.c index 77341b0..3d5e5fe 100644 --- a/utils/vlc_codec/libadlmidi.c +++ b/utils/vlc_codec/libadlmidi.c @@ -1,7 +1,7 @@ /***************************************************************************** * libadlmidi.c: Software MIDI synthesizer using OPL3 Synth emulation ***************************************************************************** - * Copyright © 2015-2018 Vitaly Novichkov + * Copyright © 2015-2020 Vitaly Novichkov * $Id$ * * This program is free software: you can redistribute it and/or modify -- cgit v1.2.3 From bdb7f81da3e43db01f4ab5781287d22ecb56e025 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Tue, 28 Jan 2020 17:36:42 +0300 Subject: Added MUS2MID conversion tool --- utils/mus2mid/CMakeLists.txt | 7 +++++ utils/mus2mid/mus2mid.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 utils/mus2mid/CMakeLists.txt create mode 100644 utils/mus2mid/mus2mid.cpp (limited to 'utils') diff --git a/utils/mus2mid/CMakeLists.txt b/utils/mus2mid/CMakeLists.txt new file mode 100644 index 0000000..6430dd4 --- /dev/null +++ b/utils/mus2mid/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable(mus2mid mus2mid.cpp) +# TODO: Use own library +target_include_directories(mus2mid PRIVATE ${PROJECT_SOURCE_DIR}/src) + +install(TARGETS mus2mid + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + diff --git a/utils/mus2mid/mus2mid.cpp b/utils/mus2mid/mus2mid.cpp new file mode 100644 index 0000000..f737f8c --- /dev/null +++ b/utils/mus2mid/mus2mid.cpp @@ -0,0 +1,74 @@ + +#include "cvt_mus2mid.hpp" +#include +#include +#if !defined(_WIN32) +#include +#else +#include +#define fileno(fd) _fileno(fd) +#define isatty(fd) _isatty(fd) +#endif + +int main(int argc, char *argv[]) +{ + if(argc != 2) + { + fprintf(stderr, "Usage: mus2mid \n"); + return 1; + } + + const char *filename = argv[1]; + + FILE *fh = fopen(filename, "rb"); + if(!fh) + { + fprintf(stderr, "Error opening file.\n"); + return 1; + } + + struct stat st; + if(fstat(fileno(fh), &st) != 0) + { + fprintf(stderr, "Error reading file status.\n"); + return 1; + } + + size_t insize = (size_t)st.st_size; + if(insize > 8 * 1024 * 1024) + { + fprintf(stderr, "File too large.\n"); + return 1; + } + + uint8_t *filedata = new uint8_t[insize]; + if(fread(filedata, 1, insize, fh) != insize) + { + fprintf(stderr, "Error reading file data.\n"); + return 1; + } + + uint8_t *xmidata = NULL; + uint32_t xmisize = 0; + if(Convert_mus2midi(filedata, static_cast(insize), &xmidata, &xmisize, 0) < 0) + { + fprintf(stderr, "Error converting MUS to SMF.\n"); + return 1; + } + + FILE *out = stdout; + if(isatty(fileno(out))) + { + fprintf(stderr, "Not writing SMF data on the text terminal.\n"); + } + else + { + if (fwrite(xmidata, 1, xmisize, out) != xmisize || fflush(out) != 0) + { + fprintf(stderr, "Error writing SMF data.\n"); + return 1; + } + } + + return 0; +} -- cgit v1.2.3