Kodi Development 19.0
for Binary and Script based Add-Ons
audio_decoder.h
1/*
2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
8
9#ifndef C_API_ADDONINSTANCE_AUDIO_DECODER_H
10#define C_API_ADDONINSTANCE_AUDIO_DECODER_H
11
12#include "../addon_base.h"
13#include "../audio_engine.h"
14
15#define AUDIO_DECODER_LYRICS_SIZE 65535
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif /* __cplusplus */
21
22 // WARNING About size use malloc/new!
24 {
25 char title[ADDON_STANDARD_STRING_LENGTH_SMALL];
26 char artist[ADDON_STANDARD_STRING_LENGTH_SMALL];
27 char album[ADDON_STANDARD_STRING_LENGTH_SMALL];
28 char album_artist[ADDON_STANDARD_STRING_LENGTH_SMALL];
29 char media_type[ADDON_STANDARD_STRING_LENGTH_SMALL];
30 char genre[ADDON_STANDARD_STRING_LENGTH_SMALL];
31 int duration;
32 int track;
33 int disc;
34 char disc_subtitle[ADDON_STANDARD_STRING_LENGTH_SMALL];
35 int disc_total;
36 char release_date[ADDON_STANDARD_STRING_LENGTH_SMALL];
37 char lyrics[AUDIO_DECODER_LYRICS_SIZE];
38 int samplerate;
39 int channels;
40 int bitrate;
41 char comment[ADDON_STANDARD_STRING_LENGTH];
42 };
43
45 {
46 int dummy;
48
50 {
51 KODI_HANDLE kodiInstance;
53
56 {
57 KODI_HANDLE addonInstance;
58 bool(__cdecl* init)(const struct AddonInstance_AudioDecoder* instance,
59 const char* file,
60 unsigned int filecache,
61 int* channels,
62 int* samplerate,
63 int* bitspersample,
64 int64_t* totaltime,
65 int* bitrate,
66 enum AudioEngineDataFormat* format,
67 const enum AudioEngineChannel** info);
68 int(__cdecl* read_pcm)(const struct AddonInstance_AudioDecoder* instance,
69 uint8_t* buffer,
70 int size,
71 int* actualsize);
72 int64_t(__cdecl* seek)(const struct AddonInstance_AudioDecoder* instance, int64_t time);
73 bool(__cdecl* read_tag)(const struct AddonInstance_AudioDecoder* instance,
74 const char* file,
75 struct AUDIO_DECODER_INFO_TAG* tag);
76 int(__cdecl* track_count)(const struct AddonInstance_AudioDecoder* instance, const char* file);
78
80 {
81 struct AddonProps_AudioDecoder* props;
85
86#ifdef __cplusplus
87} /* extern "C" */
88#endif /* __cplusplus */
89
90#endif /* !C_API_ADDONINSTANCE_AUDIO_DECODER_H */
AudioEngineChannel
Definition: audio_engine.h:70
AudioEngineDataFormat
Definition: audio_engine.h:148
Definition: audio_decoder.h:24
Definition: audio_decoder.h:80
Definition: audio_decoder.h:45
Definition: audio_decoder.h:50
Definition: audio_decoder.h:56