From 673f0392855677950378083049ec8958e2b736cb Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sat, 6 Nov 2021 07:48:32 +0100 Subject: [PATCH 1/3] translation updates (taken from Matrix) --- audiodecoder.snesapu/addon.xml.in | 8 ++++++++ .../language/resource.language.da_dk/strings.po | 15 ++++++++------- .../language/resource.language.de_de/strings.po | 15 ++++++++------- .../language/resource.language.ko_kr/strings.po | 15 ++++++++------- .../language/resource.language.ru_ru/strings.po | 15 ++++++++------- .../language/resource.language.zh_cn/strings.po | 15 ++++++++------- 6 files changed, 48 insertions(+), 35 deletions(-) diff --git a/audiodecoder.snesapu/addon.xml.in b/audiodecoder.snesapu/addon.xml.in index da60529..bb99534 100644 --- a/audiodecoder.snesapu/addon.xml.in +++ b/audiodecoder.snesapu/addon.xml.in @@ -21,9 +21,17 @@ icon.png + SNES-SPC700 lydfil dataafkoder SNES-SPC700 Sound File Data Decoder SNES-SPC700 Sound File Data Decoder + SNES-SPC700 사운드 파일 데이터 디코더 + Декодер данных звуковых файлов SNES-SPC700 + SNES-SPC700 声音文件数据解码器 + SPC-formatet indeholder Super Nintendo (SNES) spilmusik. Det er opkaldt efter Sonys SPC700-bidrag til SNES's S-SMP-lydchip. SNES var et stort spring i lydteknologi fra NES, hvilket muliggjorde stereolyd, flere kanaler og fuldt samplede instrumenter. Das SPC-Format enthält Super Nintendo (SNES) Spielmusik. Es ist nach Sonys SPC700-Beitrag zum S-SMP-Audio-Chip des SNES benannt. Das SNES war ein großer Sprung in der Audiotechnologie des NES, der Stereoklang, mehr Kanäle und vollständig gesampelte Instrumente ermöglichte. The SPC format holds Super Nintendo (SNES) game music. It is named after Sony's SPC700 contribution to the SNES's S-SMP audio chip. The SNES was a major jump in audio technology from the NES allowing for stereo sound, more channels, and fully sampled instruments. + SPC 형식에는 슈퍼 닌텐도(SNES) 게임 음악이 들어 있습니다. SNES의 S-SMP 오디오 칩에 대한 Sony의 SPC700 기여에서 이름 붙여졌습니다. SNES는 스테레오 사운드, 더 많은 채널 및 완전히 샘플링된 악기를 허용하는 NES에서 오디오 기술의 주요한 진보였습니다. + В формате SPC хранится музыка из игр Super Nintendo (SNES). Он назван в честь вклада компанией Sony SPC700 в аудиочип S-SMP. SNES была большим скачком в технологии обработки звука по сравнению с NES, позволяя получить стереозвук, больше каналов и полностью сэмплированные инструменты. + SPC 格式保存超级任天堂(SNES)游戏音乐。它是以索尼 SPC700 对 SNES s-SMP 音频芯片的贡献命名的。SNES 是从 NES 到立体声、更多声道和全采样乐器的音频技术的重大飞跃。 diff --git a/audiodecoder.snesapu/resources/language/resource.language.da_dk/strings.po b/audiodecoder.snesapu/resources/language/resource.language.da_dk/strings.po index 653c37d..017f390 100644 --- a/audiodecoder.snesapu/resources/language/resource.language.da_dk/strings.po +++ b/audiodecoder.snesapu/resources/language/resource.language.da_dk/strings.po @@ -5,26 +5,27 @@ msgid "" msgstr "" "Project-Id-Version: KODI Addons\n" -"Report-Msgid-Bugs-To: https://github.com/xbmc/audiodecoder.snesapu/issues/\n" +"Report-Msgid-Bugs-To: translations@kodi.tv\n" "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2021-10-21 12:30+0000\n" +"Last-Translator: Christian Gade \n" +"Language-Team: Danish \n" "Language: da_dk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.8\n" msgctxt "Addon Summary" msgid "SNES-SPC700 Sound File Data Decoder" -msgstr "" +msgstr "SNES-SPC700 lydfil dataafkoder" msgctxt "Addon Description" msgid "The SPC format holds Super Nintendo (SNES) game music. It is named after Sony's SPC700 contribution to the SNES's S-SMP audio chip. The SNES was a major jump in audio technology from the NES allowing for stereo sound, more channels, and fully sampled instruments." -msgstr "" +msgstr "SPC-formatet indeholder Super Nintendo (SNES) spilmusik. Det er opkaldt efter Sonys SPC700-bidrag til SNES's S-SMP-lydchip. SNES var et stort spring i lydteknologi fra NES, hvilket muliggjorde stereolyd, flere kanaler og fuldt samplede instrumenter." #. Genre type of played game sound file msgctxt "#30100" msgid "Voice/Speech" -msgstr "" +msgstr "Stemme/tale" diff --git a/audiodecoder.snesapu/resources/language/resource.language.de_de/strings.po b/audiodecoder.snesapu/resources/language/resource.language.de_de/strings.po index 5801938..cc337c0 100644 --- a/audiodecoder.snesapu/resources/language/resource.language.de_de/strings.po +++ b/audiodecoder.snesapu/resources/language/resource.language.de_de/strings.po @@ -5,16 +5,17 @@ msgid "" msgstr "" "Project-Id-Version: KODI Addons\n" -"Report-Msgid-Bugs-To: https://github.com/xbmc/audiodecoder.snesapu/issues/\n" +"Report-Msgid-Bugs-To: translations@kodi.tv\n" "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Kodi Translation Team\n" -"Language-Team: German (Germany) (http://www.transifex.com/projects/p/kodi-addons/language/de_DE/)\n" -"Language: de_DE\n" +"PO-Revision-Date: 2021-10-03 11:47+0000\n" +"Last-Translator: Kai Sommerfeld \n" +"Language-Team: German \n" +"Language: de_de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.8\n" msgctxt "Addon Summary" msgid "SNES-SPC700 Sound File Data Decoder" @@ -27,4 +28,4 @@ msgstr "Das SPC-Format enthält Super Nintendo (SNES) Spielmusik. Es ist nach So #. Genre type of played game sound file msgctxt "#30100" msgid "Voice/Speech" -msgstr "" +msgstr "Stimme/Sprache" diff --git a/audiodecoder.snesapu/resources/language/resource.language.ko_kr/strings.po b/audiodecoder.snesapu/resources/language/resource.language.ko_kr/strings.po index 96d14af..de7b29b 100644 --- a/audiodecoder.snesapu/resources/language/resource.language.ko_kr/strings.po +++ b/audiodecoder.snesapu/resources/language/resource.language.ko_kr/strings.po @@ -5,26 +5,27 @@ msgid "" msgstr "" "Project-Id-Version: KODI Addons\n" -"Report-Msgid-Bugs-To: https://github.com/xbmc/audiodecoder.snesapu/issues/\n" +"Report-Msgid-Bugs-To: translations@kodi.tv\n" "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2021-10-03 11:47+0000\n" +"Last-Translator: Minho Park \n" +"Language-Team: Korean \n" "Language: ko_kr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 4.8\n" msgctxt "Addon Summary" msgid "SNES-SPC700 Sound File Data Decoder" -msgstr "" +msgstr "SNES-SPC700 사운드 파일 데이터 디코더" msgctxt "Addon Description" msgid "The SPC format holds Super Nintendo (SNES) game music. It is named after Sony's SPC700 contribution to the SNES's S-SMP audio chip. The SNES was a major jump in audio technology from the NES allowing for stereo sound, more channels, and fully sampled instruments." -msgstr "" +msgstr "SPC 형식에는 슈퍼 닌텐도(SNES) 게임 음악이 들어 있습니다. SNES의 S-SMP 오디오 칩에 대한 Sony의 SPC700 기여에서 이름 붙여졌습니다. SNES는 스테레오 사운드, 더 많은 채널 및 완전히 샘플링된 악기를 허용하는 NES에서 오디오 기술의 주요한 진보였습니다." #. Genre type of played game sound file msgctxt "#30100" msgid "Voice/Speech" -msgstr "" +msgstr "음성/말하기" diff --git a/audiodecoder.snesapu/resources/language/resource.language.ru_ru/strings.po b/audiodecoder.snesapu/resources/language/resource.language.ru_ru/strings.po index 3803831..df3170a 100644 --- a/audiodecoder.snesapu/resources/language/resource.language.ru_ru/strings.po +++ b/audiodecoder.snesapu/resources/language/resource.language.ru_ru/strings.po @@ -5,26 +5,27 @@ msgid "" msgstr "" "Project-Id-Version: KODI Addons\n" -"Report-Msgid-Bugs-To: https://github.com/xbmc/audiodecoder.snesapu/issues/\n" +"Report-Msgid-Bugs-To: translations@kodi.tv\n" "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2021-10-03 11:47+0000\n" +"Last-Translator: vdkbsd \n" +"Language-Team: Russian \n" "Language: ru_ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.8\n" msgctxt "Addon Summary" msgid "SNES-SPC700 Sound File Data Decoder" -msgstr "" +msgstr "Декодер данных звуковых файлов SNES-SPC700" msgctxt "Addon Description" msgid "The SPC format holds Super Nintendo (SNES) game music. It is named after Sony's SPC700 contribution to the SNES's S-SMP audio chip. The SNES was a major jump in audio technology from the NES allowing for stereo sound, more channels, and fully sampled instruments." -msgstr "" +msgstr "В формате SPC хранится музыка из игр Super Nintendo (SNES). Он назван в честь вклада компанией Sony SPC700 в аудиочип S-SMP. SNES была большим скачком в технологии обработки звука по сравнению с NES, позволяя получить стереозвук, больше каналов и полностью сэмплированные инструменты." #. Genre type of played game sound file msgctxt "#30100" msgid "Voice/Speech" -msgstr "" +msgstr "Голос/Речь" diff --git a/audiodecoder.snesapu/resources/language/resource.language.zh_cn/strings.po b/audiodecoder.snesapu/resources/language/resource.language.zh_cn/strings.po index 26c3fc1..db0b629 100644 --- a/audiodecoder.snesapu/resources/language/resource.language.zh_cn/strings.po +++ b/audiodecoder.snesapu/resources/language/resource.language.zh_cn/strings.po @@ -5,26 +5,27 @@ msgid "" msgstr "" "Project-Id-Version: KODI Addons\n" -"Report-Msgid-Bugs-To: https://github.com/xbmc/audiodecoder.snesapu/issues/\n" +"Report-Msgid-Bugs-To: translations@kodi.tv\n" "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2021-10-03 11:47+0000\n" +"Last-Translator: taxigps \n" +"Language-Team: Chinese (China) \n" "Language: zh_cn\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.8\n" msgctxt "Addon Summary" msgid "SNES-SPC700 Sound File Data Decoder" -msgstr "" +msgstr "SNES-SPC700 声音文件数据解码器" msgctxt "Addon Description" msgid "The SPC format holds Super Nintendo (SNES) game music. It is named after Sony's SPC700 contribution to the SNES's S-SMP audio chip. The SNES was a major jump in audio technology from the NES allowing for stereo sound, more channels, and fully sampled instruments." -msgstr "" +msgstr "SPC 格式保存超级任天堂(SNES)游戏音乐。它是以索尼 SPC700 对 SNES s-SMP 音频芯片的贡献命名的。SNES 是从 NES 到立体声、更多声道和全采样乐器的音频技术的重大飞跃。" #. Genre type of played game sound file msgctxt "#30100" msgid "Voice/Speech" -msgstr "" +msgstr "语音/对白" From 2f085f716cfa49ac0cb4c47813b1c63af272ff96 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sat, 6 Nov 2021 07:49:17 +0100 Subject: [PATCH 2/3] audiodecoder API Version 4.0.0 update --- audiodecoder.snesapu/addon.xml.in | 12 +++++-- .../resource.language.en_gb/strings.po | 12 +++++++ src/SPCCodec.cpp | 32 ++++++++----------- src/SPCCodec.h | 4 +-- 4 files changed, 37 insertions(+), 23 deletions(-) diff --git a/audiodecoder.snesapu/addon.xml.in b/audiodecoder.snesapu/addon.xml.in index bb99534..2888ceb 100644 --- a/audiodecoder.snesapu/addon.xml.in +++ b/audiodecoder.snesapu/addon.xml.in @@ -10,10 +10,18 @@ + library_@PLATFORM@="@LIBRARY_FILENAME@"> + + + 30200 + + + 30201 + + + @PLATFORM@ GPL-2.0-or-later diff --git a/audiodecoder.snesapu/resources/language/resource.language.en_gb/strings.po b/audiodecoder.snesapu/resources/language/resource.language.en_gb/strings.po index 4620425..d4d18c7 100644 --- a/audiodecoder.snesapu/resources/language/resource.language.en_gb/strings.po +++ b/audiodecoder.snesapu/resources/language/resource.language.en_gb/strings.po @@ -29,3 +29,15 @@ msgstr "" msgctxt "#30100" msgid "Voice/Speech" msgstr "" + +#. Supported file extension description about ".spc" +#: audiodecoder.snesapu/addon.xml.in +msgctxt "#30200" +msgid "Nintendo SNES audio data, developed by Nintendo and released in 1990." +msgstr "" + +#. Supported file extension description about ".rsn" +#: audiodecoder.snesapu/addon.xml.in +msgctxt "#30201" +msgid "A .RAR package renamed to .RSN, which is used to save .SPC files." +msgstr "" diff --git a/src/SPCCodec.cpp b/src/SPCCodec.cpp index 12dcc85..4d82035 100644 --- a/src/SPCCodec.cpp +++ b/src/SPCCodec.cpp @@ -46,7 +46,7 @@ bool CSPCCodec::Init(const std::string& filename, std::string toLoad(filename); int track = GetTrackNumber(toLoad); - if (kodi::tools::StringUtils::EndsWith(filename, ".spcstream")) + if (kodi::tools::StringUtils::EndsWith(filename, ".spc" KODI_ADDON_AUDIODECODER_TRACK_EXT)) { std::vector items; if (kodi::vfs::GetDirectory("rar://" + URLEncode(toLoad) + "/", ".spc", items)) @@ -92,19 +92,19 @@ bool CSPCCodec::Init(const std::string& filename, return true; } -int CSPCCodec::ReadPCM(uint8_t* buffer, int size, int& actualsize) +int CSPCCodec::ReadPCM(uint8_t* buffer, size_t size, size_t& actualsize) { if (ctx.pos >= ctx.tag.play_len) - return -1; + return AUDIODECODER_READ_EOF; spc_play(ctx.song, size / SPC_CHANNELS, (short*)buffer); actualsize = size; ctx.pos += actualsize / SPC_CHANNELS; if (actualsize) - return 0; + return AUDIODECODER_READ_SUCCESS; - return 1; + return AUDIODECODER_READ_ERROR; } int64_t CSPCCodec::Seek(int64_t time) @@ -128,7 +128,7 @@ bool CSPCCodec::ReadTag(const std::string& filename, kodi::addon::AudioDecoderIn bool isRSNBaseRead = kodi::tools::StringUtils::EndsWith(filename, ".rsn"); std::vector items; - if (kodi::tools::StringUtils::EndsWith(filename, ".spcstream") || isRSNBaseRead) + if (kodi::tools::StringUtils::EndsWith(filename, ".spc" KODI_ADDON_AUDIODECODER_TRACK_EXT) || isRSNBaseRead) { if (kodi::vfs::GetDirectory("rar://" + URLEncode(toLoad) + "/", ".spc", items)) toLoad = items[track].Path(); @@ -294,18 +294,12 @@ int CSPCCodec::TrackCount(const std::string& filename) int CSPCCodec::GetTrackNumber(std::string& toLoad) { int track = 0; - if (toLoad.rfind("stream") != std::string::npos) - { - size_t iStart = toLoad.rfind('-') + 1; - track = atoi(toLoad.substr(iStart, toLoad.size() - iStart - 10).c_str()) - 1; - // The directory we are in, is the file - // that contains the bitstream to play, - // so extract it - size_t slash = toLoad.rfind('\\'); - if (slash == std::string::npos) - slash = toLoad.rfind('/'); - toLoad = toLoad.substr(0, slash); - } + toLoad = kodi::addon::CInstanceAudioDecoder::GetTrack("spc", toLoad, track); + + // Correct if packed sound file with several sounds + if (track > 0) + --track; + return track; } @@ -351,7 +345,7 @@ std::string CSPCCodec::URLEncode(const std::string& strURLData) //------------------------------------------------------------------------------ -class ATTRIBUTE_HIDDEN CMyAddon : public kodi::addon::CAddonBase +class ATTR_DLL_LOCAL CMyAddon : public kodi::addon::CAddonBase { public: CMyAddon() = default; diff --git a/src/SPCCodec.h b/src/SPCCodec.h index 5546e6f..f5ab039 100644 --- a/src/SPCCodec.h +++ b/src/SPCCodec.h @@ -21,7 +21,7 @@ struct SPCContext uint8_t* data = nullptr; }; -class ATTRIBUTE_HIDDEN CSPCCodec : public kodi::addon::CInstanceAudioDecoder +class ATTR_DLL_LOCAL CSPCCodec : public kodi::addon::CInstanceAudioDecoder { public: CSPCCodec(KODI_HANDLE instance, const std::string& version); @@ -36,7 +36,7 @@ class ATTRIBUTE_HIDDEN CSPCCodec : public kodi::addon::CInstanceAudioDecoder int& bitrate, AudioEngineDataFormat& format, std::vector& channellist) override; - int ReadPCM(uint8_t* buffer, int size, int& actualsize) override; + int ReadPCM(uint8_t* buffer, size_t size, size_t& actualsize) override; int64_t Seek(int64_t time) override; int TrackCount(const std::string& filename) override; bool ReadTag(const std::string& filename, kodi::addon::AudioDecoderInfoTag& tag) override; From 5c1a1204c549862e7a35b2e4df6f61ae3af58102 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Tue, 19 Oct 2021 12:36:02 +0200 Subject: [PATCH 3/3] increase version to 20.1.0 --- audiodecoder.snesapu/addon.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audiodecoder.snesapu/addon.xml.in b/audiodecoder.snesapu/addon.xml.in index 2888ceb..9f7b472 100644 --- a/audiodecoder.snesapu/addon.xml.in +++ b/audiodecoder.snesapu/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@