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

#include <cddb.h>

Public Member Functions

 Xcddb ()
 
virtual ~Xcddb ()
 
void setCDDBIpAddress (const std::string &ip_address)
 
void setCacheDir (const std::string &pCacheDir)
 
bool queryCDinfo (MEDIA_DETECT::CCdInfo *pInfo, int inexact_list_select)
 
bool queryCDinfo (MEDIA_DETECT::CCdInfo *pInfo)
 
int getLastError () const
 
const char * getLastErrorText () const
 
const std::string & getYear () const
 
const std::string & getGenre () const
 
const std::string & getTrackArtist (int track) const
 
const std::string & getTrackTitle (int track) const
 
void getDiskArtist (std::string &strdisk_artist) const
 
void getDiskTitle (std::string &strdisk_title) const
 
const std::string & getTrackExtended (int track) const
 
uint32_t calc_disc_id (int nr_of_tracks, toc cdtoc[])
 
const std::string & getInexactArtist (int select) const
 
const std::string & getInexactTitle (int select) const
 
bool queryCache (uint32_t discid)
 
bool writeCacheFile (const char *pBuffer, uint32_t discid)
 
bool isCDCached (int nr_of_tracks, toc cdtoc[])
 
bool isCDCached (MEDIA_DETECT::CCdInfo *pInfo)
 

Protected Types

using CAutoPtrSocket = KODI::UTILS::CScopeGuard<int, -1, decltype(close)>
 

Protected Member Functions

void addTitle (const char *buffer)
 
void addExtended (const char *buffer)
 
void parseData (const char *buffer)
 
bool Send (const void *buffer, int bytes)
 
bool Send (const char *buffer)
 
std::string Recv (bool wait4point)
 
bool openSocket ()
 
bool closeSocket ()
 
int cddb_sum (int n)
 
void addInexactList (const char *list)
 
void addInexactListLine (int line_cnt, const char *line, int len)
 
const std::string & getInexactCommand (int select) const
 
std::string GetCacheFile (uint32_t disc_id) const
 
std::string TrimToUTF8 (const std::string &untrimmed)
 Trim and convert some text to UTF8.
 

Protected Attributes

std::string m_strNull
 
CAutoPtrSocket m_cddb_socket
 
int m_lastError
 
std::map< int, std::string > m_mapTitles
 
std::map< int, std::string > m_mapArtists
 
std::map< int, std::string > m_mapExtended_track
 
std::map< int, std::string > m_mapInexact_cddb_command_list
 
std::map< int, std::string > m_mapInexact_artist_list
 
std::map< int, std::string > m_mapInexact_title_list
 
std::string m_strDisk_artist
 
std::string m_strDisk_title
 
std::string m_strYear
 
std::string m_strGenre
 
struct toc cdtoc [100]
 
std::string m_cddb_ip_address
 
std::string cCacheDir
 

Static Protected Attributes

static const int recv_buffer = 4096
 

Member Typedef Documentation

◆ CAutoPtrSocket

using CDDB::Xcddb::CAutoPtrSocket = KODI::UTILS::CScopeGuard<int, -1, decltype(close)>
protected

Constructor & Destructor Documentation

◆ Xcddb()

Xcddb::Xcddb ( )

◆ ~Xcddb()

Xcddb::~Xcddb ( )
virtual

Member Function Documentation

◆ addExtended()

void Xcddb::addExtended ( const char * buffer)
protected

◆ addInexactList()

void Xcddb::addInexactList ( const char * list)
protected

◆ addInexactListLine()

void Xcddb::addInexactListLine ( int line_cnt,
const char * line,
int len )
protected

◆ addTitle()

void Xcddb::addTitle ( const char * buffer)
protected

◆ calc_disc_id()

uint32_t Xcddb::calc_disc_id ( int nr_of_tracks,
toc cdtoc[] )

◆ cddb_sum()

int Xcddb::cddb_sum ( int n)
protected

◆ closeSocket()

bool Xcddb::closeSocket ( )
protected

◆ GetCacheFile()

std::string Xcddb::GetCacheFile ( uint32_t disc_id) const
protected

◆ getDiskArtist()

void Xcddb::getDiskArtist ( std::string & strdisk_artist) const

◆ getDiskTitle()

void Xcddb::getDiskTitle ( std::string & strdisk_title) const

◆ getGenre()

const std::string & Xcddb::getGenre ( ) const

◆ getInexactArtist()

const std::string & Xcddb::getInexactArtist ( int select) const

◆ getInexactCommand()

const std::string & Xcddb::getInexactCommand ( int select) const
protected

◆ getInexactTitle()

const std::string & Xcddb::getInexactTitle ( int select) const

◆ getLastError()

int Xcddb::getLastError ( ) const

◆ getLastErrorText()

const char * Xcddb::getLastErrorText ( ) const

◆ getTrackArtist()

const std::string & Xcddb::getTrackArtist ( int track) const

◆ getTrackExtended()

const std::string & Xcddb::getTrackExtended ( int track) const

◆ getTrackTitle()

const std::string & Xcddb::getTrackTitle ( int track) const

◆ getYear()

const std::string & Xcddb::getYear ( ) const

◆ isCDCached() [1/2]

bool Xcddb::isCDCached ( int nr_of_tracks,
toc cdtoc[] )

◆ isCDCached() [2/2]

bool Xcddb::isCDCached ( MEDIA_DETECT::CCdInfo * pInfo)

◆ openSocket()

bool Xcddb::openSocket ( )
protected

◆ parseData()

void Xcddb::parseData ( const char * buffer)
protected
Todo
STRING_CLEANUP

◆ queryCache()

bool Xcddb::queryCache ( uint32_t discid)

◆ queryCDinfo() [1/2]

bool Xcddb::queryCDinfo ( MEDIA_DETECT::CCdInfo * pInfo)

◆ queryCDinfo() [2/2]

bool Xcddb::queryCDinfo ( MEDIA_DETECT::CCdInfo * pInfo,
int inexact_list_select )

◆ Recv()

std::string Xcddb::Recv ( bool wait4point)
protected

◆ Send() [1/2]

bool Xcddb::Send ( const char * buffer)
protected

◆ Send() [2/2]

bool Xcddb::Send ( const void * buffer,
int bytes )
protected

◆ setCacheDir()

void Xcddb::setCacheDir ( const std::string & pCacheDir)

◆ setCDDBIpAddress()

void Xcddb::setCDDBIpAddress ( const std::string & ip_address)

◆ TrimToUTF8()

std::string Xcddb::TrimToUTF8 ( const std::string & untrimmed)
protected

Trim and convert some text to UTF8.

Parameters
untrimmedTextoriginal text to trim and convert
Returns
a utf8 version of the trimmed text

◆ writeCacheFile()

bool Xcddb::writeCacheFile ( const char * pBuffer,
uint32_t discid )

Member Data Documentation

◆ cCacheDir

std::string CDDB::Xcddb::cCacheDir
protected

◆ cdtoc

struct toc CDDB::Xcddb::cdtoc[100]
protected

◆ m_cddb_ip_address

std::string CDDB::Xcddb::m_cddb_ip_address
protected

◆ m_cddb_socket

CAutoPtrSocket CDDB::Xcddb::m_cddb_socket
protected

◆ m_lastError

int CDDB::Xcddb::m_lastError
protected

◆ m_mapArtists

std::map<int, std::string> CDDB::Xcddb::m_mapArtists
protected

◆ m_mapExtended_track

std::map<int, std::string> CDDB::Xcddb::m_mapExtended_track
protected

◆ m_mapInexact_artist_list

std::map<int, std::string> CDDB::Xcddb::m_mapInexact_artist_list
protected

◆ m_mapInexact_cddb_command_list

std::map<int, std::string> CDDB::Xcddb::m_mapInexact_cddb_command_list
protected

◆ m_mapInexact_title_list

std::map<int, std::string> CDDB::Xcddb::m_mapInexact_title_list
protected

◆ m_mapTitles

std::map<int, std::string> CDDB::Xcddb::m_mapTitles
protected

◆ m_strDisk_artist

std::string CDDB::Xcddb::m_strDisk_artist
protected

◆ m_strDisk_title

std::string CDDB::Xcddb::m_strDisk_title
protected

◆ m_strGenre

std::string CDDB::Xcddb::m_strGenre
protected

◆ m_strNull

std::string CDDB::Xcddb::m_strNull
protected

◆ m_strYear

std::string CDDB::Xcddb::m_strYear
protected

◆ recv_buffer

const int CDDB::Xcddb::recv_buffer = 4096
staticprotected

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