diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/appveyor.yml kodi-audiodecoder-fluidsynth-2.1.0/appveyor.yml --- kodi-audiodecoder-fluidsynth-2.0.0/appveyor.yml 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -version: BuildNr.{build} - -image: Visual Studio 2015 - -shallow_clone: true - -clone_folder: c:\projects\audiodecoder.fluidsynth - -environment: - app_id: audiodecoder.fluidsynth - - matrix: - - GENERATOR: "Visual Studio 14" - CONFIG: Release - - GENERATOR: "Visual Studio 14 Win64" - CONFIG: Release - -build_script: - - cd .. - - git clone --depth=1 https://github.com/xbmc/xbmc.git - - cd %app_id% - - mkdir build - - cd build - - mkdir -p definition\%app_id% - - echo %app_id% %APPVEYOR_BUILD_FOLDER% %APPVEYOR_REPO_COMMIT% > definition\%app_id%\%app_id%.txt - - cmake -T host=x64 -G "%GENERATOR%" -DADDONS_TO_BUILD=%app_id% -DCMAKE_BUILD_TYPE=%CONFIG% -DADDONS_DEFINITION_DIR=%APPVEYOR_BUILD_FOLDER%/build/definition -DADDON_SRC_PREFIX=../.. -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons - - cmake --build . --config %CONFIG% --target %app_id% diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/addon.xml.in kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/addon.xml.in --- kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/addon.xml.in 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/addon.xml.in 2014-05-17 10:40:22.000000000 +0000 @@ -1,18 +1,23 @@ @ADDON_DEPENDS@ - FluidSynth MIDI Audio Decoder - FluidSynth MIDI Audio Decoder + A SoundFont Synthesizer + FluidSynth is a real-time software synthesizer based on the SoundFont 2 specifications and has reached widespread distribution. FluidSynth itself does not have a graphical user interface, but due to its powerful API several applications utilize it and it has even found its way onto embedded systems and is used in some mobile apps. @PLATFORM@ + + resources/icon.png + resources/fanart.jpg + Binary files /tmp/tmp5TqZzA/Fo4c7ZNt02/kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/resources/fanart.jpg and /tmp/tmp5TqZzA/zKnGdqd0XV/kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/resources/fanart.jpg differ Binary files /tmp/tmp5TqZzA/Fo4c7ZNt02/kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/resources/icon.png and /tmp/tmp5TqZzA/zKnGdqd0XV/kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/resources/icon.png differ diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/resources/language/English/strings.po kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/resources/language/English/strings.po --- kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/resources/language/English/strings.po 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/resources/language/English/strings.po 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: XBMC Main Translation Project (Frodo)\n" -"Report-Msgid-Bugs-To: http://trac.xbmc.org/\n" -"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: XBMC Translation Team\n" -"Language-Team: English (http://www.transifex.com/projects/p/XBMC-Main-Frodo/language/en/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -msgctxt "#30000" -msgid "Soundfont" -msgstr "" - -msgctxt "#30001" -msgid "Soundfont not configured" -msgstr "" - -msgctxt "#30002" -msgid "Check add-on settings" -msgstr "" diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/resources/language/resource.language.en_gb/strings.po kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/resources/language/resource.language.en_gb/strings.po --- kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/resources/language/resource.language.en_gb/strings.po 1970-01-01 00:00:00.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/resources/language/resource.language.en_gb/strings.po 2014-05-17 10:40:22.000000000 +0000 @@ -0,0 +1,37 @@ +msgid "" +msgstr "" +"Project-Id-Version: XBMC Main Translation Project (Frodo)\n" +"Report-Msgid-Bugs-To: http://trac.xbmc.org/\n" +"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: XBMC Translation Team\n" +"Language-Team: English (http://www.transifex.com/projects/p/XBMC-Main-Frodo/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgctxt "#30000" +msgid "Soundfont" +msgstr "" + +msgctxt "#30001" +msgid "To use FluidSynth you need a working sound font" +msgstr "" + +msgctxt "#30002" +msgid "Scan MIDI for title" +msgstr "" + +msgctxt "#30003" +msgid "Search in MIDI file for information to get an exact title" +msgstr "" + +msgctxt "#30010" +msgid "SoundFont audio decode" +msgstr "" + +msgctxt "#30011" +msgid "Soundfont not configured, check add-on settings" +msgstr "" diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/resources/settings.xml.in kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/resources/settings.xml.in --- kodi-audiodecoder-fluidsynth-2.0.0/audiodecoder.fluidsynth/resources/settings.xml.in 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/audiodecoder.fluidsynth/resources/settings.xml.in 2014-05-17 10:40:22.000000000 +0000 @@ -1,3 +1,20 @@ - - + +
+ + + + "@SOUND_FONT@" + + true + .sf2 + + + + + true + + + + +
diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/CMakeLists.txt kodi-audiodecoder-fluidsynth-2.1.0/CMakeLists.txt --- kodi-audiodecoder-fluidsynth-2.0.0/CMakeLists.txt 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/CMakeLists.txt 2014-05-17 10:40:22.000000000 +0000 @@ -1,11 +1,8 @@ +cmake_minimum_required(VERSION 3.5) project(audiodecoder.fluidsynth) -cmake_minimum_required(VERSION 2.6) - set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) -enable_language(CXX) - find_package(Kodi REQUIRED) find_package(FluidSynth REQUIRED) diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/debian/changelog kodi-audiodecoder-fluidsynth-2.1.0/debian/changelog --- kodi-audiodecoder-fluidsynth-2.0.0/debian/changelog 2018-03-05 08:50:33.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/debian/changelog 2014-05-17 10:40:22.000000000 +0000 @@ -1,9 +1,7 @@ -kodi-audiodecoder-fluidsynth (2.0.0-1~xenial) xenial; urgency=low +kodi-audiodecoder-fluidsynth (2.1.0-1~xenial) xenial; urgency=low [ xbmc ] * autogenerated dummy changelog - [ wsnipex ] - * no upstream changelog available + -- dummy Sat, 17 May 2014 11:40:22 +0100 - -- wsnipex Mon, 05 Mar 2018 09:50:33 +0100 diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/debian/changelog.tmp kodi-audiodecoder-fluidsynth-2.1.0/debian/changelog.tmp --- kodi-audiodecoder-fluidsynth-2.0.0/debian/changelog.tmp 2018-03-05 08:50:20.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/debian/changelog.tmp 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -kodi-audiodecoder-fluidsynth (2.0.0-1~#DIST#) #DIST#; urgency=low - - [ xbmc ] - * autogenerated dummy changelog - - -- dummy Sat, 17 May 2014 11:40:22 +0100 - diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/debian/kodi-audiodecoder-fluidsynth.install kodi-audiodecoder-fluidsynth-2.1.0/debian/kodi-audiodecoder-fluidsynth.install --- kodi-audiodecoder-fluidsynth-2.0.0/debian/kodi-audiodecoder-fluidsynth.install 2018-03-05 08:50:20.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/debian/kodi-audiodecoder-fluidsynth.install 2014-05-17 10:40:22.000000000 +0000 @@ -1,2 +1,3 @@ usr/lib usr/share + diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/depends/common/fluidsynth/0001-fix-install-path.patch kodi-audiodecoder-fluidsynth-2.1.0/depends/common/fluidsynth/0001-fix-install-path.patch --- kodi-audiodecoder-fluidsynth-2.0.0/depends/common/fluidsynth/0001-fix-install-path.patch 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/depends/common/fluidsynth/0001-fix-install-path.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ ---- fluidsynth/CMakeLists.txt.orig 2015-12-28 01:06:59.563034281 +0100 -+++ fluidsynth/CMakeLists.txt 2015-12-28 01:07:12.911034521 +0100 -@@ -85,11 +85,11 @@ - endif ( ${CMAKE_SYSTEM} MATCHES "OS2" ) - - # Initialize the library directory name suffix. --if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) -- set ( _init_lib_suffix "64" ) --else ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) -+#if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) -+# set ( _init_lib_suffix "64" ) -+#else ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) - set ( _init_lib_suffix "" ) --endif ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) -+ #endif ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) - set ( LIB_SUFFIX ${_init_lib_suffix} CACHE STRING - "library directory name suffix (32/64/nothing)" ) - mark_as_advanced ( LIB_SUFFIX ) diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/depends/common/fluidsynth/flags.txt kodi-audiodecoder-fluidsynth-2.1.0/depends/common/fluidsynth/flags.txt --- kodi-audiodecoder-fluidsynth-2.0.0/depends/common/fluidsynth/flags.txt 1970-01-01 00:00:00.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/depends/common/fluidsynth/flags.txt 2014-05-17 10:40:22.000000000 +0000 @@ -0,0 +1 @@ +-DLIB_SUFFIX= diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/depends/common/fluidsynth/fluidsynth.sha256 kodi-audiodecoder-fluidsynth-2.1.0/depends/common/fluidsynth/fluidsynth.sha256 --- kodi-audiodecoder-fluidsynth-2.0.0/depends/common/fluidsynth/fluidsynth.sha256 1970-01-01 00:00:00.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/depends/common/fluidsynth/fluidsynth.sha256 2014-05-17 10:40:22.000000000 +0000 @@ -0,0 +1 @@ +e97e63c1045e102465f1aa848f9d712c5528c58685b8d40062e4aaf6af7edb75 diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/depends/common/fluidsynth/fluidsynth.txt kodi-audiodecoder-fluidsynth-2.1.0/depends/common/fluidsynth/fluidsynth.txt --- kodi-audiodecoder-fluidsynth-2.0.0/depends/common/fluidsynth/fluidsynth.txt 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/depends/common/fluidsynth/fluidsynth.txt 2014-05-17 10:40:22.000000000 +0000 @@ -1 +1 @@ -fluidsynth http://downloads.sourceforge.net/project/fluidsynth/fluidsynth-1.1.6/fluidsynth-1.1.6.tar.gz +fluidsynth https://github.com/FluidSynth/fluidsynth/archive/v2.0.6.tar.gz diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/FindFluidSynth.cmake kodi-audiodecoder-fluidsynth-2.1.0/FindFluidSynth.cmake --- kodi-audiodecoder-fluidsynth-2.0.0/FindFluidSynth.cmake 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/FindFluidSynth.cmake 2014-05-17 10:40:22.000000000 +0000 @@ -7,16 +7,15 @@ find_package(PkgConfig) if(PKG_CONFIG_FOUND) - pkg_check_modules (FLUIDSYNTH fluidsynth) - list(APPEND FLUIDSYNTH_INCLUDE_DIRS ${FLUIDSYNTH_INCLUDEDIR}) + pkg_check_modules(PC_FLUIDSYNTH fluidsynth QUIET) endif() -if(NOT FLUIDSYNTH_FOUND) - find_path(FLUIDSYNTH_INCLUDE_DIRS fluidsynth.h) - find_library(FLUIDSYNTH_LIBRARIES NAMES fluidsynth) -endif() +find_path(FLUIDSYNTH_INCLUDE_DIRS fluidsynth.h + PATHS ${PC_FLUIDSYNTH_INCLUDEDIR}) +find_library(FLUIDSYNTH_LIBRARIES fluidsynth + PATHS ${PC_FLUIDSYNTH_LIBDIR}) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FluidSynth DEFAULT_MSG FLUIDSYNTH_INCLUDE_DIRS FLUIDSYNTH_LIBRARIES) +find_package_handle_standard_args(FluidSynth REQUIRED_VARS FLUIDSYNTH_INCLUDE_DIRS FLUIDSYNTH_LIBRARIES) mark_as_advanced(FLUIDSYNTH_INCLUDE_DIRS FLUIDSYNTH_LIBRARIES) diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/Jenkinsfile kodi-audiodecoder-fluidsynth-2.1.0/Jenkinsfile --- kodi-audiodecoder-fluidsynth-2.0.0/Jenkinsfile 1970-01-01 00:00:00.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/Jenkinsfile 2014-05-17 10:40:22.000000000 +0000 @@ -0,0 +1 @@ +buildPlugin(version: "Leia", platforms: ['ubuntu-ppa']) diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/README.md kodi-audiodecoder-fluidsynth-2.1.0/README.md --- kodi-audiodecoder-fluidsynth-2.0.0/README.md 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/README.md 2014-05-17 10:40:22.000000000 +0000 @@ -2,8 +2,8 @@ This is a [Kodi](http://kodi.tv) audio decoder addon for midi files. -[![Build Status](https://travis-ci.org/notspiff/audiodecoder.fluidsynth.svg?branch=master)](https://travis-ci.org/notspiff/audiodecoder.fluidsynth) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/notspiff/audiodecoder.fluidsynth?svg=true)](https://ci.appveyor.com/project/notspiff/audiodecoder-fluidsynth) +[![Build Status](https://travis-ci.org/xbmc/audiodecoder.fluidsynth.svg?branch=master)](https://travis-ci.org/xbmc/audiodecoder.fluidsynth) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/xbmc/audiodecoder.fluidsynth?svg=true)](https://ci.appveyor.com/project/xbmc/audiodecoder-fluidsynth) ## Build instructions @@ -16,8 +16,8 @@ The following instructions assume you will have built Kodi already in the `kodi-build` directory suggested by the README. -1. `git clone https://github.com/xbmc/xbmc.git` -2. `git clone https://github.com/notspiff/audiodecoder.fluidsynth.git` +1. `git clone --branch Leia https://github.com/xbmc/xbmc.git` +2. `git clone https://github.com/xbmc/audiodecoder.fluidsynth.git` 3. `cd audiodecoder.fluidsynth && mkdir build && cd build` 4. `cmake -DADDONS_TO_BUILD=audiodecoder.fluidsynth -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/kodi-build/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons` 5. `make` diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/src/FluidDecoder.cpp kodi-audiodecoder-fluidsynth-2.1.0/src/FluidDecoder.cpp --- kodi-audiodecoder-fluidsynth-2.0.0/src/FluidDecoder.cpp 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/src/FluidDecoder.cpp 2014-05-17 10:40:22.000000000 +0000 @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -29,8 +30,7 @@ fluid_player_t* player = nullptr; }; -class CFluidCodec : public kodi::addon::CInstanceAudioDecoder, - public kodi::addon::CAddonBase +class ATTRIBUTE_HIDDEN CFluidCodec : public kodi::addon::CInstanceAudioDecoder { public: CFluidCodec(KODI_HANDLE instance) : @@ -39,7 +39,7 @@ m_soundfont = kodi::GetSettingString("soundfont"); } - virtual ~CFluidCodec() + ~CFluidCodec() override { if (ctx.player) delete_fluid_player(ctx.player); @@ -49,15 +49,15 @@ delete_fluid_settings(ctx.settings); } - virtual bool Init(const std::string& filename, unsigned int filecache, - int& channels, int& samplerate, - int& bitspersample, int64_t& totaltime, - int& bitrate, AEDataFormat& format, - std::vector& channellist) override + bool Init(const std::string& filename, unsigned int filecache, + int& channels, int& samplerate, + int& bitspersample, int64_t& totaltime, + int& bitrate, AEDataFormat& format, + std::vector& channellist) override { if (m_soundfont.empty() || m_soundfont == "OFF") { - kodi::gui::dialogs::OK::ShowAndGetInput("Soundfont not configured", "Check add-on settings"); + kodi::QueueNotification(QUEUE_ERROR, kodi::GetLocalizedString(30010), kodi::GetLocalizedString(30011)); return false; } kodi::vfs::CFile file; @@ -89,7 +89,7 @@ return true; } - virtual int ReadPCM(uint8_t* buffer, int size, int& actualsize) override + int ReadPCM(uint8_t* buffer, int size, int& actualsize) override { if (fluid_player_get_status(ctx.player) == FLUID_PLAYER_DONE) return 1; @@ -99,11 +99,114 @@ return 0; } - virtual int64_t Seek(int64_t time) override + int64_t Seek(int64_t time) override { return -1; } +#define MIDI_HEADER 0x4D546864 +#define MIDI_MTrk 0x4D54726B +#define MIDI_TEXT_EVENT 0xFF01 +#define MIDI_COPYRIGHT 0xFF02 +#define MIDI_TRACK_NAME 0xFF03 +#define MIDI_INSTRUMENT_NAME 0xFF04 +#define MIDI_LENGTH_TEXT_LYRIC 0xFF05 +#define MIDI_LENGTH_TEXT_MARKER 0xFF06 +#define MIDI_LENGTH_TEXT_CUE_POINT 0xFF07 +#define MIDI_CHANNEL_PREFIX 0xFF20 +#define MIDI_TEMPO_MICRO_SEC 0xFF51 +#define MIDI_TIMESIGNATURE 0xFF58 +#define MIDI_END_OF_TRACK 0xFF2F + + bool ReadTag(const std::string& filename, std::string& title, + std::string& artist, int& length) override + { + if (!kodi::GetSettingBoolean("scantext")) + return false; + + kodi::vfs::CFile file; + if (!file.OpenFile(filename)) + return false; + + int len = file.GetLength(); + uint8_t* data = new uint8_t[len]; + if (!data) + return false; + + file.Read(data, len); + + uint32_t header = data[3] | data[2] << 8 | data[1] << 16 | data[0] << 24; + uint32_t headerLength = data[7] | data[6] << 8 | data[5] << 16 | data[4] << 24; + if (header != MIDI_HEADER || headerLength != 6) + return false; + + std::vector trackDataFormats; + unsigned int ptr = 14; + + unsigned int trackNameCnt = 0; + std::string firstTextEvent; + while (ptr < len) + { + uint32_t trackHeader = data[ptr+3] | data[ptr+2] << 8 | data[ptr+1] << 16 | data[ptr] << 24; + int32_t trackHeaderLength = data[ptr+7] | data[ptr+6] << 8 | data[ptr+5] << 16 | data[ptr+4] << 24; + + if (trackHeader != MIDI_MTrk) + break; + + unsigned int blockPtr = 0; + while (blockPtr < trackHeaderLength) + { + uint32_t blockIdentifier = data[blockPtr+ptr+10] | data[blockPtr+ptr+9] << 8 | data[blockPtr+ptr+8] << 16; + uint8_t blockLength = data[blockPtr+ptr+11]; + if (blockLength == 0 || blockIdentifier == MIDI_CHANNEL_PREFIX) + break; + + if (blockIdentifier == MIDI_TEXT_EVENT) + { + char* name = new char[blockLength+1]; + memset(name, 0, blockLength+1); + strncpy(name, reinterpret_cast(data+blockPtr+ptr+12), blockLength); + if (strncmp(name, "untitled", blockLength) != 0) + { + if (title.empty()) + title += name; + + if (firstTextEvent.empty()) + firstTextEvent = name; + } + delete[] name; + } + else if (blockIdentifier == MIDI_TRACK_NAME) + { + char* name = new char[blockLength+1]; + memset(name, 0, blockLength+1); + strncpy(name, reinterpret_cast(data+blockPtr+ptr+12), blockLength); + if (strncmp(name, "untitled", blockLength) != 0) + { + if (!title.empty()) + title += " - "; + title += name; + + trackNameCnt++; + } + delete[] name; + } + + blockPtr += blockLength+4; + } + + ptr += trackHeaderLength + 8; + } + + // Prevent the case the track i used for instruments + if (trackNameCnt > 3) + title = firstTextEvent; + + length = -1; + delete[] data; + return true; + } + private: FluidContext ctx; std::string m_soundfont; @@ -113,15 +216,13 @@ class ATTRIBUTE_HIDDEN CMyAddon : public kodi::addon::CAddonBase { public: - CMyAddon() { } - virtual ADDON_STATUS CreateInstance(int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE& addonInstance) override + CMyAddon() = default; + ADDON_STATUS CreateInstance(int instanceType, std::string instanceID, KODI_HANDLE instance, KODI_HANDLE& addonInstance) override { addonInstance = new CFluidCodec(instance); return ADDON_STATUS_OK; } - virtual ~CMyAddon() - { - } + ~CMyAddon() = default; }; diff -Nru kodi-audiodecoder-fluidsynth-2.0.0/.travis.yml kodi-audiodecoder-fluidsynth-2.1.0/.travis.yml --- kodi-audiodecoder-fluidsynth-2.0.0/.travis.yml 2017-10-04 11:03:35.000000000 +0000 +++ kodi-audiodecoder-fluidsynth-2.1.0/.travis.yml 2014-05-17 10:40:22.000000000 +0000 @@ -14,26 +14,13 @@ matrix: include: - os: linux - dist: trusty + dist: xenial sudo: required compiler: gcc - os: linux - dist: trusty + dist: xenial sudo: required compiler: clang - - os: osx - osx_image: xcode7.3 - - os: osx - osx_image: xcode6.4 - -# -# Some of the OS X images don't have cmake, contrary to what people -# on the Internet say -# -before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which cmake || brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which cmake || brew install cmake ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew upgrade cmake || true; fi # # The addon source is automatically checked out in $TRAVIS_BUILD_DIR, @@ -41,7 +28,7 @@ # before_script: - cd $TRAVIS_BUILD_DIR/.. - - git clone --depth=1 https://github.com/xbmc/xbmc.git + - git clone --branch Leia --depth=1 https://github.com/xbmc/xbmc.git - cd ${app_id} && mkdir build && cd build - mkdir -p definition/${app_id} - echo ${app_id} $TRAVIS_BUILD_DIR $TRAVIS_COMMIT > definition/${app_id}/${app_id}.txt