Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
KODI::ADDONS::CAudioDecoder Class Reference

#include <AudioDecoder.h>

Inheritance diagram for KODI::ADDONS::CAudioDecoder:
ADDON::IAddonInstanceHandler KODI::ADDONS::IAddonSupportCheck ICodec MUSIC_INFO::IMusicInfoTagLoader XFILE::CMusicFileDirectory XFILE::IFileDirectory XFILE::IDirectory

Public Member Functions

 CAudioDecoder (const ADDON::AddonInfoPtr &addonInfo)
 
 ~CAudioDecoder () override
 
bool CreateDecoder ()
 
bool Init (const CFileItem &file, unsigned int filecache) override
 
int ReadPCM (uint8_t *buffer, size_t size, size_t *actualsize) override
 
bool Seek (int64_t time) override
 
bool CanInit () override
 
bool Load (const std::string &strFileName, MUSIC_INFO::CMusicInfoTag &tag, EmbeddedArt *art=nullptr) override
 
int GetTrackCount (const std::string &strPath) override
 
bool SupportsFile (const std::string &filename) override
 Function to query the respective add-ons used for the support of the desired file.
 
- Public Member Functions inherited from ADDON::IAddonInstanceHandler
 IAddonInstanceHandler (ADDON_TYPE type, const AddonInfoPtr &addonInfo, AddonInstanceId instanceId=ADDON_INSTANCE_ID_UNUSED, KODI_HANDLE parentInstance=nullptr, const std::string &uniqueWorkID="")
 Class constructor for handling add-on instance processes, allowing an add-on to handle multiple work simultaneously and independently.
 
virtual ~IAddonInstanceHandler ()
 
ADDON_TYPE UsedType () const
 
AddonInstanceId InstanceId () const
 
const std::string & UniqueWorkID ()
 
std::string ID () const
 
AddonInstanceId InstanceID () const
 
std::string Name () const
 
std::string Author () const
 
std::string Icon () const
 
std::string Path () const
 
std::string Profile () const
 
CAddonVersion Version () const
 
ADDON_STATUS CreateInstance ()
 
void DestroyInstance ()
 
const AddonDllPtrAddon () const
 
AddonInfoPtr GetAddonInfo () const
 
virtual void OnPreInstall ()
 
virtual void OnPostInstall (bool update, bool modal)
 
virtual void OnPreUnInstall ()
 
virtual void OnPostUnInstall ()
 
- Public Member Functions inherited from KODI::ADDONS::IAddonSupportCheck
 IAddonSupportCheck ()=default
 
virtual ~IAddonSupportCheck ()=default
 
- Public Member Functions inherited from ICodec
 ICodec ()
 
virtual ~ICodec ()=default
 
virtual bool CanSeek ()
 
virtual int ReadRaw (uint8_t **pBuffer, int *bufferSize)
 
virtual void SetTotalTime (int64_t totaltime)
 
virtual bool IsCaching () const
 
virtual int GetCacheLevel () const
 
- Public Member Functions inherited from MUSIC_INFO::IMusicInfoTagLoader
 IMusicInfoTagLoader (void)=default
 
virtual ~IMusicInfoTagLoader ()=default
 
- Public Member Functions inherited from XFILE::CMusicFileDirectory
 CMusicFileDirectory (void)
 
 ~CMusicFileDirectory (void) override
 
bool GetDirectory (const CURL &url, CFileItemList &items) override
 Get the items of the directory strPath.
 
bool Exists (const CURL &url) override
 Check for directory existence.
 
bool ContainsFiles (const CURL &url) override
 
bool AllowAll () const override
 Whether to allow all files/folders to be listed.
 
- Public Member Functions inherited from XFILE::IFileDirectory
 ~IFileDirectory () override=default
 
- Public Member Functions inherited from XFILE::IDirectory
 IDirectory ()
 
virtual ~IDirectory (void)
 
virtual float GetProgress () const
 Retrieve the progress of the current directory fetch (if possible).
 
virtual void CancelDirectory ()
 Cancel the current directory fetch (if possible).
 
virtual bool Create (const CURL &url)
 Create the directory.
 
virtual bool Remove (const CURL &url)
 Removes the directory.
 
virtual bool RemoveRecursive (const CURL &url)
 Recursively removes the directory.
 
virtual bool IsAllowed (const CURL &url) const
 Whether this file should be listed.
 
virtual DIR_CACHE_TYPE GetCacheType (const CURL &url) const
 How this directory should be cached.
 
void SetMask (const std::string &strMask)
 Set a mask of extensions for the files in the directory.
 
void SetFlags (int flags)
 Set the flags for this directory handler.
 
bool ProcessRequirements ()
 Process additional requirements before the directory fetch is performed. Some directory fetches may require authentication, keyboard input etc. The IDirectory subclass should call GetKeyboardInput, SetErrorDialog or RequireAuthentication and then return false from the GetDirectory method. CDirectory will then prompt for input from the user, before re-calling the GetDirectory method.
 
virtual bool Resolve (CFileItem &item) const
 Resolves a given item to a playable item.
 

Additional Inherited Members

- Static Public Member Functions inherited from XFILE::IDirectory
static void RegisterProfileManager (const CProfileManager &profileManager)
 
static void UnregisterProfileManager ()
 
- Public Attributes inherited from ICodec
int64_t m_TotalTime
 
int m_bitRate
 
int m_bitsPerSample
 
int m_bitsPerCodedSample
 
std::string m_CodecName
 
MUSIC_INFO::CMusicInfoTag m_tag
 
XFILE::CFile m_file
 
AEAudioFormat m_format
 
- Protected Member Functions inherited from XFILE::CMusicFileDirectory
- Protected Member Functions inherited from XFILE::IDirectory
bool GetKeyboardInput (const CVariant &heading, std::string &input, bool hiddenInput=false)
 Prompt the user for some keyboard input Call this method from the GetDirectory method to retrieve additional input from the user. If this function returns false then no input has been received, and the GetDirectory call should return false.
 
void SetErrorDialog (const CVariant &heading, const CVariant &line1, const CVariant &line2=0, const CVariant &line3=0)
 Show an error dialog on failure of GetDirectory call Call this method from the GetDirectory method to set an error message to be shown to the user.
 
void RequireAuthentication (const CURL &url)
 Prompt the user for authentication of a URL. Call this method from the GetDirectory method when authentication is required from the user, before returning false from the GetDirectory call. The user will be prompted for authentication, and GetDirectory will be re-called.
 
- Protected Attributes inherited from ADDON::IAddonInstanceHandler
KODI_ADDON_INSTANCE_INFO m_info {}
 
KODI_ADDON_INSTANCE_STRUCT m_ifc {}
 
- Protected Attributes inherited from XFILE::CMusicFileDirectory
std::string m_strExt
 
MUSIC_INFO::CMusicInfoTag m_tag
 
- Protected Attributes inherited from XFILE::IDirectory
std::string m_strFileMask
 Holds the file mask specified by SetMask()
 
int m_flags
 Directory flags - see DIR_FLAG.
 
CVariant m_requirements
 
- Static Protected Attributes inherited from XFILE::IDirectory
static const CProfileManagerm_profileManager = nullptr
 

Constructor & Destructor Documentation

◆ CAudioDecoder()

CAudioDecoder::CAudioDecoder ( const ADDON::AddonInfoPtr & addonInfo)
explicit

◆ ~CAudioDecoder()

CAudioDecoder::~CAudioDecoder ( )
override

Member Function Documentation

◆ CanInit()

bool KODI::ADDONS::CAudioDecoder::CanInit ( )
inlineoverridevirtual

Implements ICodec.

◆ CreateDecoder()

bool CAudioDecoder::CreateDecoder ( )

◆ GetTrackCount()

int CAudioDecoder::GetTrackCount ( const std::string & strPath)
overridevirtual

◆ Init()

bool CAudioDecoder::Init ( const CFileItem & file,
unsigned int filecache )
overridevirtual

for replaygain

Todo
About audio decoder in most cases Kodi's one not work, add fallback to use addon if this fails. Need API change about addons music info tag!

Implements ICodec.

◆ Load()

bool CAudioDecoder::Load ( const std::string & strFileName,
MUSIC_INFO::CMusicInfoTag & tag,
EmbeddedArt * art = nullptr )
overridevirtual

◆ ReadPCM()

int CAudioDecoder::ReadPCM ( uint8_t * buffer,
size_t size,
size_t * actualsize )
overridevirtual

Implements ICodec.

◆ Seek()

bool CAudioDecoder::Seek ( int64_t time)
overridevirtual

Implements ICodec.

◆ SupportsFile()

bool CAudioDecoder::SupportsFile ( const std::string & filename)
overridevirtual

Function to query the respective add-ons used for the support of the desired file.

Parameters
[in]filenameFile which is queried for addon support
Returns
True if addon supports the desired file, false if not
Note
Is set here with true as default and not with "= 0" in order to have class expandable and perhaps to be able to insert other query functions in the future.

Reimplemented from KODI::ADDONS::IAddonSupportCheck.


The documentation for this class was generated from the following files: