Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audiodecoder API Version 4.0.0 update #51

Merged
merged 3 commits into from
Nov 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions audiodecoder.timidity/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="audiodecoder.timidity"
version="20.0.0"
version="20.1.0"
name="Timidity Audio Decoder"
provider-name="spiff">
<requires>@ADDON_DEPENDS@</requires>
<extension
point="kodi.audiodecoder"
name="mid"
tags="true"
extension=".mid|.kar"
library_@PLATFORM@="@LIBRARY_FILENAME@"/>
library_@PLATFORM@="@LIBRARY_FILENAME@">
<support>
<extension name=".mid">
<description>30100</description>
</extension>
<extension name=".kar">
<description>30101</description>
</extension>
</support>
</extension>
<extension point="xbmc.addon.metadata">
<platform>@PLATFORM@</platform>
<license>GPL-2.0-or-later</license>
Expand All @@ -28,7 +36,7 @@
<summary lang="ru_RU">Программный синтезатор MIDI</summary>
<summary lang="zh_CN">MIDI 软件合成器</summary>
<description lang="da_DK">TiMidity er en software-synthesizer, der kan afspille MIDI-filer uden en hardware-synthesizer.[CR][CR]For at bruge TiMidity skal du have en fungerende timidity.cfg-konfigurationsfil eller lydskrifttyper. Kopier disse filer til de mapper, hvor du vil gemme, og vælg dem i add-on-indstillingerne.</description>
<description lang="de_DE">TiMidity ist ein Software-Synthesizer, der MIDI-Dateien ohne Hardware-Synthesizer abspielen kann.[CR][CR]Um TiMidity verwenden zu können, benötigen Sie eine funktionierende Konfigurationsdatei timidity.cfg oder Sound-Schriftarten. Kopieren Sie diese Dateien in das Verzeichnis, das Sie speichern möchten, und wählen Sie sie in den Add-On-Einstellungen aus.</description>
<description lang="de_DE">TiMidity ist ein Software-Synthesizer, der MIDI-Dateien ohne Hardware-Synthesizer abspielen kann.[CR][CR]Um TiMidity verwenden zu können, benötigen Sie eine funktionierende Konfigurationsdatei timidity.cfg oder Sound-Schriftarten. Kopieren Sie diese Dateien in das Verzeichnis, das Sie speichern möchten, und wählen Sie sie in den Addon-Einstellungen aus.</description>
<description lang="en_GB">TiMidity is a software synthesizer that can play MIDI files without a hardware synthesizer.[CR][CR]To use TiMidity you need a working timidity.cfg config file or sound fonts. Copy this files into the directory you intend to store and select it in the Add-on Settings.</description>
<description lang="es_ES">TiMidity es un sintetizador por software que puede reproducir archivos MIDI sin un sintetizador hardware.[CR][CR]Para usar TiMidity se ecesita un archivo valido de configuración timidity.cfg o Sound Fonts. Copie esos ficheros en la carpeta donde desee alojarlos e indíquela en los ajustes del addon.</description>
<description lang="ko_KR">TiMidity는 하드웨어 신디사이저 없이 MIDI 파일을 재생할 수 있는 소프트웨어 신디사이저입니다.[CR][CR]TiMidity를 사용하려면 작동하는 timidity.cfg 구성 파일 또는 사운드 글꼴이 필요합니다. 이 파일을 저장하려는 디렉토리에 복사하고 애드온 설정에서 선택하십시오.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@
msgid ""
msgstr ""
"Project-Id-Version: KODI Addons\n"
"Report-Msgid-Bugs-To: https://github.com/xbmc/audiodecoder.timidity/issues/\n"
"Report-Msgid-Bugs-To: [email protected]\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-09-26 14:30+0000\n"
"Last-Translator: Chillbo <[email protected]>\n"
"Language-Team: German <https://kodi.weblate.cloud/projects/kodi-add-ons-audio-decodersencoders/audiodecoder-timidity/de_de/>\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 "MIDI Software synthesizer"
msgstr "MIDI Software synthesizer"

msgctxt "Addon Description"
msgid "TiMidity is a software synthesizer that can play MIDI files without a hardware synthesizer.[CR][CR]To use TiMidity you need a working timidity.cfg config file or sound fonts. Copy this files into the directory you intend to store and select it in the Add-on Settings."
msgstr "TiMidity ist ein Software-Synthesizer, der MIDI-Dateien ohne Hardware-Synthesizer abspielen kann.[CR][CR]Um TiMidity verwenden zu können, benötigen Sie eine funktionierende Konfigurationsdatei timidity.cfg oder Sound-Schriftarten. Kopieren Sie diese Dateien in das Verzeichnis, das Sie speichern möchten, und wählen Sie sie in den Add-On-Einstellungen aus."
msgstr "TiMidity ist ein Software-Synthesizer, der MIDI-Dateien ohne Hardware-Synthesizer abspielen kann.[CR][CR]Um TiMidity verwenden zu können, benötigen Sie eine funktionierende Konfigurationsdatei timidity.cfg oder Sound-Schriftarten. Kopieren Sie diese Dateien in das Verzeichnis, das Sie speichern möchten, und wählen Sie sie in den Addon-Einstellungen aus."

# [Consistency] Make terms, settings names, brands and other minutiae, consistent throughout file.
# [Capitalization] Avoid capitalizing every second word. See http://grammarist.com/capitalization/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,15 @@ msgstr ""
msgctxt "#30011"
msgid "Soundfont not set in settings!"
msgstr ""

#. Supported file extension description about ".mid"
#: audiodecoder.timidity/addon.xml.in
msgctxt "#30100"
msgid "Is a MIDI (Musical Instrument Digital Interface) file used by music authoring, mixing programs and hardware devices."
msgstr ""

#. Supported file extension description about ".kar"
#: audiodecoder.timidity/addon.xml.in
msgctxt "#30101"
msgid "Karaoke MIDI File - Contains MIDI data as well as song lyrics stored in text."
msgstr ""
12 changes: 6 additions & 6 deletions src/TimidityCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,21 @@ bool CTimidityCodec::Init(const std::string& filename,
return true;
}

int CTimidityCodec::ReadPCM(uint8_t* buffer, int size, int& actualsize)
int CTimidityCodec::ReadPCM(uint8_t* buffer, size_t size, size_t& actualsize)
{
if (!buffer)
return -1;
return AUDIODECODER_READ_ERROR;

if (m_pos > Timidity_GetLength(m_song) / 1000 * 48000 * 4)
return -1;
return AUDIODECODER_READ_EOF;

actualsize = Timidity_FillBuffer(m_song, buffer, size);
if (actualsize == 0)
return -1;
return AUDIODECODER_READ_EOF;

m_pos += actualsize;

return 0;
return AUDIODECODER_READ_SUCCESS;
}

int64_t CTimidityCodec::Seek(int64_t time)
Expand All @@ -161,7 +161,7 @@ bool CTimidityCodec::ReadTag(const std::string& filename, kodi::addon::AudioDeco

//------------------------------------------------------------------------------

class ATTRIBUTE_HIDDEN CMyAddon : public kodi::addon::CAddonBase
class ATTR_DLL_LOCAL CMyAddon : public kodi::addon::CAddonBase
{
public:
CMyAddon() = default;
Expand Down
6 changes: 3 additions & 3 deletions src/TimidityCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ extern "C"
#define MIDI_TIMESIGNATURE 0xFF58
#define MIDI_END_OF_TRACK 0xFF2F

class ATTRIBUTE_HIDDEN CTimidityCodec : public kodi::addon::CInstanceAudioDecoder,
private kodi::tools::CDllHelper
class ATTR_DLL_LOCAL CTimidityCodec : public kodi::addon::CInstanceAudioDecoder,
private kodi::tools::CDllHelper
{
public:
CTimidityCodec(KODI_HANDLE instance, const std::string& version);
Expand All @@ -46,7 +46,7 @@ class ATTRIBUTE_HIDDEN CTimidityCodec : public kodi::addon::CInstanceAudioDecode
int& bitrate,
AudioEngineDataFormat& format,
std::vector<AudioEngineChannel>& 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;
bool ReadTag(const std::string& filename, kodi::addon::AudioDecoderInfoTag& tag) override;

Expand Down